// Code generated by quickfix. DO NOT EDIT.
package ordercancelrequest

import (
	"github.com/shopspring/decimal"

	"quantex.com/qfixdpl/quickfix"
	"quantex.com/qfixdpl/quickfix/gen/enum"
	"quantex.com/qfixdpl/quickfix/gen/field"
	"quantex.com/qfixdpl/quickfix/gen/fix41"
	"quantex.com/qfixdpl/quickfix/gen/tag"
)

// OrderCancelRequest is the fix41 OrderCancelRequest type, MsgType = F.
type OrderCancelRequest struct {
	fix41.Header
	*quickfix.Body
	fix41.Trailer
	Message *quickfix.Message
}

// FromMessage creates a OrderCancelRequest from a quickfix.Message instance.
func FromMessage(m *quickfix.Message) OrderCancelRequest {
	return OrderCancelRequest{
		Header:  fix41.Header{Header: &m.Header},
		Body:    &m.Body,
		Trailer: fix41.Trailer{Trailer: &m.Trailer},
		Message: m,
	}
}

// ToMessage returns a quickfix.Message instance.
func (m OrderCancelRequest) ToMessage() *quickfix.Message {
	return m.Message
}

// New returns a OrderCancelRequest initialized with the required fields for OrderCancelRequest.
func New(origclordid field.OrigClOrdIDField, clordid field.ClOrdIDField, symbol field.SymbolField, side field.SideField) (m OrderCancelRequest) {
	m.Message = quickfix.NewMessage()
	m.Header = fix41.NewHeader(&m.Message.Header)
	m.Body = &m.Message.Body
	m.Trailer.Trailer = &m.Message.Trailer

	m.Header.Set(field.NewMsgType("F"))
	m.Set(origclordid)
	m.Set(clordid)
	m.Set(symbol)
	m.Set(side)

	return
}

// A RouteOut is the callback type that should be implemented for routing Message.
type RouteOut func(msg OrderCancelRequest, sessionID quickfix.SessionID) quickfix.MessageRejectError

// Route returns the beginstring, message type, and MessageRoute for this Message type.
func Route(router RouteOut) (string, string, quickfix.MessageRoute) {
	r := func(msg *quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError {
		return router(FromMessage(msg), sessionID)
	}
	return "FIX.4.1", "F", r
}

// SetClOrdID sets ClOrdID, Tag 11.
func (m OrderCancelRequest) SetClOrdID(v string) {
	m.Set(field.NewClOrdID(v))
}

// SetIDSource sets IDSource, Tag 22.
func (m OrderCancelRequest) SetIDSource(v enum.IDSource) {
	m.Set(field.NewIDSource(v))
}

// SetOrderID sets OrderID, Tag 37.
func (m OrderCancelRequest) SetOrderID(v string) {
	m.Set(field.NewOrderID(v))
}

// SetOrderQty sets OrderQty, Tag 38.
func (m OrderCancelRequest) SetOrderQty(value decimal.Decimal, scale int32) {
	m.Set(field.NewOrderQty(value, scale))
}

// SetOrigClOrdID sets OrigClOrdID, Tag 41.
func (m OrderCancelRequest) SetOrigClOrdID(v string) {
	m.Set(field.NewOrigClOrdID(v))
}

// SetSecurityID sets SecurityID, Tag 48.
func (m OrderCancelRequest) SetSecurityID(v string) {
	m.Set(field.NewSecurityID(v))
}

// SetSide sets Side, Tag 54.
func (m OrderCancelRequest) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}

// SetSymbol sets Symbol, Tag 55.
func (m OrderCancelRequest) SetSymbol(v string) {
	m.Set(field.NewSymbol(v))
}

// SetText sets Text, Tag 58.
func (m OrderCancelRequest) SetText(v string) {
	m.Set(field.NewText(v))
}

// SetSymbolSfx sets SymbolSfx, Tag 65.
func (m OrderCancelRequest) SetSymbolSfx(v enum.SymbolSfx) {
	m.Set(field.NewSymbolSfx(v))
}

// SetListID sets ListID, Tag 66.
func (m OrderCancelRequest) SetListID(v string) {
	m.Set(field.NewListID(v))
}

// SetExecBroker sets ExecBroker, Tag 76.
func (m OrderCancelRequest) SetExecBroker(v string) {
	m.Set(field.NewExecBroker(v))
}

// SetIssuer sets Issuer, Tag 106.
func (m OrderCancelRequest) SetIssuer(v string) {
	m.Set(field.NewIssuer(v))
}

// SetSecurityDesc sets SecurityDesc, Tag 107.
func (m OrderCancelRequest) SetSecurityDesc(v string) {
	m.Set(field.NewSecurityDesc(v))
}

// SetClientID sets ClientID, Tag 109.
func (m OrderCancelRequest) SetClientID(v string) {
	m.Set(field.NewClientID(v))
}

// SetCashOrderQty sets CashOrderQty, Tag 152.
func (m OrderCancelRequest) SetCashOrderQty(value decimal.Decimal, scale int32) {
	m.Set(field.NewCashOrderQty(value, scale))
}

// SetSecurityType sets SecurityType, Tag 167.
func (m OrderCancelRequest) SetSecurityType(v enum.SecurityType) {
	m.Set(field.NewSecurityType(v))
}

// SetMaturityMonthYear sets MaturityMonthYear, Tag 200.
func (m OrderCancelRequest) SetMaturityMonthYear(v string) {
	m.Set(field.NewMaturityMonthYear(v))
}

// SetPutOrCall sets PutOrCall, Tag 201.
func (m OrderCancelRequest) SetPutOrCall(v enum.PutOrCall) {
	m.Set(field.NewPutOrCall(v))
}

// SetStrikePrice sets StrikePrice, Tag 202.
func (m OrderCancelRequest) SetStrikePrice(value decimal.Decimal, scale int32) {
	m.Set(field.NewStrikePrice(value, scale))
}

// SetMaturityDay sets MaturityDay, Tag 205.
func (m OrderCancelRequest) SetMaturityDay(v int) {
	m.Set(field.NewMaturityDay(v))
}

// SetOptAttribute sets OptAttribute, Tag 206.
func (m OrderCancelRequest) SetOptAttribute(v string) {
	m.Set(field.NewOptAttribute(v))
}

// SetSecurityExchange sets SecurityExchange, Tag 207.
func (m OrderCancelRequest) SetSecurityExchange(v string) {
	m.Set(field.NewSecurityExchange(v))
}

// GetClOrdID gets ClOrdID, Tag 11.
func (m OrderCancelRequest) GetClOrdID() (v string, err quickfix.MessageRejectError) {
	var f field.ClOrdIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetIDSource gets IDSource, Tag 22.
func (m OrderCancelRequest) GetIDSource() (v enum.IDSource, err quickfix.MessageRejectError) {
	var f field.IDSourceField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetOrderID gets OrderID, Tag 37.
func (m OrderCancelRequest) GetOrderID() (v string, err quickfix.MessageRejectError) {
	var f field.OrderIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetOrderQty gets OrderQty, Tag 38.
func (m OrderCancelRequest) GetOrderQty() (v decimal.Decimal, err quickfix.MessageRejectError) {
	var f field.OrderQtyField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetOrigClOrdID gets OrigClOrdID, Tag 41.
func (m OrderCancelRequest) GetOrigClOrdID() (v string, err quickfix.MessageRejectError) {
	var f field.OrigClOrdIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSecurityID gets SecurityID, Tag 48.
func (m OrderCancelRequest) GetSecurityID() (v string, err quickfix.MessageRejectError) {
	var f field.SecurityIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSide gets Side, Tag 54.
func (m OrderCancelRequest) GetSide() (v enum.Side, err quickfix.MessageRejectError) {
	var f field.SideField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSymbol gets Symbol, Tag 55.
func (m OrderCancelRequest) GetSymbol() (v string, err quickfix.MessageRejectError) {
	var f field.SymbolField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetText gets Text, Tag 58.
func (m OrderCancelRequest) GetText() (v string, err quickfix.MessageRejectError) {
	var f field.TextField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSymbolSfx gets SymbolSfx, Tag 65.
func (m OrderCancelRequest) GetSymbolSfx() (v enum.SymbolSfx, err quickfix.MessageRejectError) {
	var f field.SymbolSfxField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetListID gets ListID, Tag 66.
func (m OrderCancelRequest) GetListID() (v string, err quickfix.MessageRejectError) {
	var f field.ListIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetExecBroker gets ExecBroker, Tag 76.
func (m OrderCancelRequest) GetExecBroker() (v string, err quickfix.MessageRejectError) {
	var f field.ExecBrokerField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetIssuer gets Issuer, Tag 106.
func (m OrderCancelRequest) GetIssuer() (v string, err quickfix.MessageRejectError) {
	var f field.IssuerField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSecurityDesc gets SecurityDesc, Tag 107.
func (m OrderCancelRequest) GetSecurityDesc() (v string, err quickfix.MessageRejectError) {
	var f field.SecurityDescField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetClientID gets ClientID, Tag 109.
func (m OrderCancelRequest) GetClientID() (v string, err quickfix.MessageRejectError) {
	var f field.ClientIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetCashOrderQty gets CashOrderQty, Tag 152.
func (m OrderCancelRequest) GetCashOrderQty() (v decimal.Decimal, err quickfix.MessageRejectError) {
	var f field.CashOrderQtyField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSecurityType gets SecurityType, Tag 167.
func (m OrderCancelRequest) GetSecurityType() (v enum.SecurityType, err quickfix.MessageRejectError) {
	var f field.SecurityTypeField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetMaturityMonthYear gets MaturityMonthYear, Tag 200.
func (m OrderCancelRequest) GetMaturityMonthYear() (v string, err quickfix.MessageRejectError) {
	var f field.MaturityMonthYearField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetPutOrCall gets PutOrCall, Tag 201.
func (m OrderCancelRequest) GetPutOrCall() (v enum.PutOrCall, err quickfix.MessageRejectError) {
	var f field.PutOrCallField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetStrikePrice gets StrikePrice, Tag 202.
func (m OrderCancelRequest) GetStrikePrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
	var f field.StrikePriceField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetMaturityDay gets MaturityDay, Tag 205.
func (m OrderCancelRequest) GetMaturityDay() (v int, err quickfix.MessageRejectError) {
	var f field.MaturityDayField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetOptAttribute gets OptAttribute, Tag 206.
func (m OrderCancelRequest) GetOptAttribute() (v string, err quickfix.MessageRejectError) {
	var f field.OptAttributeField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetSecurityExchange gets SecurityExchange, Tag 207.
func (m OrderCancelRequest) GetSecurityExchange() (v string, err quickfix.MessageRejectError) {
	var f field.SecurityExchangeField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// HasClOrdID returns true if ClOrdID is present, Tag 11.
func (m OrderCancelRequest) HasClOrdID() bool {
	return m.Has(tag.ClOrdID)
}

// HasIDSource returns true if IDSource is present, Tag 22.
func (m OrderCancelRequest) HasIDSource() bool {
	return m.Has(tag.IDSource)
}

// HasOrderID returns true if OrderID is present, Tag 37.
func (m OrderCancelRequest) HasOrderID() bool {
	return m.Has(tag.OrderID)
}

// HasOrderQty returns true if OrderQty is present, Tag 38.
func (m OrderCancelRequest) HasOrderQty() bool {
	return m.Has(tag.OrderQty)
}

// HasOrigClOrdID returns true if OrigClOrdID is present, Tag 41.
func (m OrderCancelRequest) HasOrigClOrdID() bool {
	return m.Has(tag.OrigClOrdID)
}

// HasSecurityID returns true if SecurityID is present, Tag 48.
func (m OrderCancelRequest) HasSecurityID() bool {
	return m.Has(tag.SecurityID)
}

// HasSide returns true if Side is present, Tag 54.
func (m OrderCancelRequest) HasSide() bool {
	return m.Has(tag.Side)
}

// HasSymbol returns true if Symbol is present, Tag 55.
func (m OrderCancelRequest) HasSymbol() bool {
	return m.Has(tag.Symbol)
}

// HasText returns true if Text is present, Tag 58.
func (m OrderCancelRequest) HasText() bool {
	return m.Has(tag.Text)
}

// HasSymbolSfx returns true if SymbolSfx is present, Tag 65.
func (m OrderCancelRequest) HasSymbolSfx() bool {
	return m.Has(tag.SymbolSfx)
}

// HasListID returns true if ListID is present, Tag 66.
func (m OrderCancelRequest) HasListID() bool {
	return m.Has(tag.ListID)
}

// HasExecBroker returns true if ExecBroker is present, Tag 76.
func (m OrderCancelRequest) HasExecBroker() bool {
	return m.Has(tag.ExecBroker)
}

// HasIssuer returns true if Issuer is present, Tag 106.
func (m OrderCancelRequest) HasIssuer() bool {
	return m.Has(tag.Issuer)
}

// HasSecurityDesc returns true if SecurityDesc is present, Tag 107.
func (m OrderCancelRequest) HasSecurityDesc() bool {
	return m.Has(tag.SecurityDesc)
}

// HasClientID returns true if ClientID is present, Tag 109.
func (m OrderCancelRequest) HasClientID() bool {
	return m.Has(tag.ClientID)
}

// HasCashOrderQty returns true if CashOrderQty is present, Tag 152.
func (m OrderCancelRequest) HasCashOrderQty() bool {
	return m.Has(tag.CashOrderQty)
}

// HasSecurityType returns true if SecurityType is present, Tag 167.
func (m OrderCancelRequest) HasSecurityType() bool {
	return m.Has(tag.SecurityType)
}

// HasMaturityMonthYear returns true if MaturityMonthYear is present, Tag 200.
func (m OrderCancelRequest) HasMaturityMonthYear() bool {
	return m.Has(tag.MaturityMonthYear)
}

// HasPutOrCall returns true if PutOrCall is present, Tag 201.
func (m OrderCancelRequest) HasPutOrCall() bool {
	return m.Has(tag.PutOrCall)
}

// HasStrikePrice returns true if StrikePrice is present, Tag 202.
func (m OrderCancelRequest) HasStrikePrice() bool {
	return m.Has(tag.StrikePrice)
}

// HasMaturityDay returns true if MaturityDay is present, Tag 205.
func (m OrderCancelRequest) HasMaturityDay() bool {
	return m.Has(tag.MaturityDay)
}

// HasOptAttribute returns true if OptAttribute is present, Tag 206.
func (m OrderCancelRequest) HasOptAttribute() bool {
	return m.Has(tag.OptAttribute)
}

// HasSecurityExchange returns true if SecurityExchange is present, Tag 207.
func (m OrderCancelRequest) HasSecurityExchange() bool {
	return m.Has(tag.SecurityExchange)
}
