// Code generated by go:generate; DO NOT EDIT.
package bfxapi

var AllOrderTypes = map[OrderType]struct{}{
	OrderTypeLimit:                {},
	OrderTypeExchangeLimit:        {},
	OrderTypeMarket:               {},
	OrderTypeExchangeMarket:       {},
	OrderTypeStop:                 {},
	OrderTypeExchangeStop:         {},
	OrderTypeStopLimit:            {},
	OrderTypeExchangeStopLimit:    {},
	OrderTypeTrailingStop:         {},
	OrderTypeExchangeTrailingStop: {},
	OrderTypeFOK:                  {},
	OrderTypeExchangeFOK:          {},
	OrderTypeIOC:                  {},
	OrderTypeExchangeIOC:          {},
}

var AllOrderTypesSlice = []OrderType{
	OrderTypeLimit,
	OrderTypeExchangeLimit,
	OrderTypeMarket,
	OrderTypeExchangeMarket,
	OrderTypeStop,
	OrderTypeExchangeStop,
	OrderTypeStopLimit,
	OrderTypeExchangeStopLimit,
	OrderTypeTrailingStop,
	OrderTypeExchangeTrailingStop,
	OrderTypeFOK,
	OrderTypeExchangeFOK,
	OrderTypeIOC,
	OrderTypeExchangeIOC,
}

func OrderTypeStrings(slice []OrderType) (out []string) {
	for _, el := range slice {
		out = append(out, string(el))
	}
	return out
}

// OrderTypeKeys converts a map of OrderType to a slice of OrderType
func OrderTypeKeys(values map[OrderType]struct{}) (slice []OrderType) {
	for k := range values {
		slice = append(slice, k)
	}
	return slice
}

// ValidateOrderType validates a value of type OrderType
func ValidateOrderType(ch OrderType) bool {
	_, ok := AllOrderTypes[ch]
	return ok
}
