func (m *UserTrade) validateLiquidityEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, userTradeTypeLiquidityPropEnum); err != nil {
		return err
	}
	return nil
}
prop value enum
package models
import (
	"encoding/json"
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type UserTrade struct {
	Amount *float64 `json:"amount"`
	Direction Direction `json:"direction"`
	Fee *float64 `json:"fee"`
	FeeCurrency Currency `json:"fee_currency"`
	IndexPrice *float64 `json:"index_price"`
	InstrumentName InstrumentName `json:"instrument_name"`
	Iv float64 `json:"iv,omitempty"`
	Label string `json:"label,omitempty"`
	Liquidity string `json:"liquidity,omitempty"`
	MatchingID *string `json:"matching_id"`
	OrderID *string `json:"order_id"`
	OrderType string `json:"order_type,omitempty"`
	Price Price `json:"price"`
	SelfTrade *bool `json:"self_trade"`
	State OrderStateInUserTrade `json:"state"`
	TickDirection TickDirection `json:"tick_direction"`
	Timestamp *int64 `json:"timestamp"`
	TradeID TradeID `json:"trade_id"`
	TradeSeq TradeSeq `json:"trade_seq"`
}
func (m *UserTrade) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateAmount(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateDirection(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateFee(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateFeeCurrency(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateIndexPrice(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateInstrumentName(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateLiquidity(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateMatchingID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateOrderID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateOrderType(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validatePrice(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateSelfTrade(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateState(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTickDirection(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTimestamp(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTradeID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTradeSeq(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *UserTrade) validateAmount(formats strfmt.Registry) error {
	if err := validate.Required("amount", "body", m.Amount); err != nil {
		return err
	}
	return nil
}
func (m *UserTrade) validateDirection(formats strfmt.Registry) error {
	if err := m.Direction.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("direction")
		}
		return err
	}
	return nil
}
func (m *UserTrade) validateFee(formats strfmt.Registry) error {
	if err := validate.Required("fee", "body", m.Fee); err != nil {
		return err
	}
	return nil
}
func (m *UserTrade) validateFeeCurrency(formats strfmt.Registry) error {
	if err := m.FeeCurrency.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("fee_currency")
		}
		return err
	}
	return nil
}
func (m *UserTrade) validateIndexPrice(formats strfmt.Registry) error {
	if err := validate.Required("index_price", "body", m.IndexPrice); err != nil {
		return err
	}
	return nil
}
func (m *UserTrade) validateInstrumentName(formats strfmt.Registry) error {
	if err := m.InstrumentName.Validate(formats); err != nil {
		if ve, ok := err.(*errors.Validation); ok {
			return ve.ValidateName("instrument_name")
		}
		return err
	}
	return nil
}
var userTradeTypeLiquidityPropEnum []interface{}
func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["M","T"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		userTradeTypeLiquidityPropEnum = append(userTradeTypeLiquidityPropEnum, v)
	}
}
const (
	UserTradeLiquidityM string = "M"
	UserTradeLiquidityT string = "T"
)