/*
 * 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

import (
	"fmt"
)

type TradeOrderTimeInForce string

// List of TradeOrderTimeInForce
const (
	GTC TradeOrderTimeInForce = "GTC"
	IOC TradeOrderTimeInForce = "IOC"
	FOK TradeOrderTimeInForce = "FOK"
	GTD TradeOrderTimeInForce = "GTD"
	GTT TradeOrderTimeInForce = "GTT"
)

// AllowedTradeOrderTimeInForceEnumValues is all the allowed values of TradeOrderTimeInForce enum
var AllowedTradeOrderTimeInForceEnumValues = []TradeOrderTimeInForce{
	"GTC",
	"IOC",
	"FOK",
	"GTD",
	"GTT",
}

// validTradeOrderTimeInForceEnumValue provides a map of TradeOrderTimeInForces for fast verification of use input
var validTradeOrderTimeInForceEnumValues = map[TradeOrderTimeInForce]struct{}{
	"GTC": {},
	"IOC": {},
	"FOK": {},
	"GTD": {},
	"GTT": {},
}

// IsValid return true if the value is valid for the enum, false otherwise
func (v TradeOrderTimeInForce) IsValid() bool {
	_, ok := validTradeOrderTimeInForceEnumValues[v]
	return ok
}

// NewTradeOrderTimeInForceFromValue returns a pointer to a valid TradeOrderTimeInForce
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewTradeOrderTimeInForceFromValue(v string) (TradeOrderTimeInForce, error) {
	ev := TradeOrderTimeInForce(v)
	if ev.IsValid() {
		return ev, nil
	} else {
		return "", fmt.Errorf("invalid value '%v' for TradeOrderTimeInForce: valid values are %v", v, AllowedTradeOrderTimeInForceEnumValues)
	}
}

// AssertTradeOrderTimeInForceRequired checks if the required fields are not zero-ed
func AssertTradeOrderTimeInForceRequired(obj TradeOrderTimeInForce) error {
	return nil
}

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