/*
 * OPEN OUTCRY API
 *
 * # Introduction This API is documented in **OpenAPI 3.0 format**.  This API the following operations: * Retrieve a list of available instruments * Retrieve a list of executed trades  # Basics * API calls have to be secured with HTTPS. * All data has to be submitted UTF-8 encoded. * The reply is sent JSON encoded.
 *
 * API version: 1.0.0
 * Generated by: OpenAPI Generator (https://openapi-generator.tech)
 */

package api

type TradingAccountInstrument struct {

	// Ticker-like name of the instrument. For monetary instruments, a currency pair is used.
	Name string `json:"name"`

	Amount float64 `json:"amount"`

	AmountReserved float64 `json:"amountReserved"`

	AmountAvailable float64 `json:"amountAvailable"`

	Value float64 `json:"value"`

	// ISO 4217 Currency symbol
	Currency string `json:"currency"`
}

// AssertTradingAccountInstrumentRequired checks if the required fields are not zero-ed
func AssertTradingAccountInstrumentRequired(obj TradingAccountInstrument) error {
	elements := map[string]interface{}{
		"name":            obj.Name,
		"amount":          obj.Amount,
		"amountReserved":  obj.AmountReserved,
		"amountAvailable": obj.AmountAvailable,
		"value":           obj.Value,
		"currency":        obj.Currency,
	}
	for name, el := range elements {
		if isZero := IsZeroValue(el); isZero {
			return &RequiredError{Field: name}
		}
	}

	return nil
}

// AssertTradingAccountInstrumentConstraints checks if the values respects the defined constraints
func AssertTradingAccountInstrumentConstraints(obj TradingAccountInstrument) error {
	return nil
}
