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

import (
	"quantex.com/qfixpt/quickfix"
	"quantex.com/qfixpt/quickfix/gen/enum"
	"quantex.com/qfixpt/quickfix/gen/field"
	"quantex.com/qfixpt/quickfix/gen/fix40"
	"quantex.com/qfixpt/quickfix/gen/tag"
)

// OrderStatusRequest is the fix40 OrderStatusRequest type, MsgType = H.
type OrderStatusRequest struct {
	fix40.Header
	*quickfix.Body
	fix40.Trailer
	Message *quickfix.Message
}

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

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

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

	m.Header.Set(field.NewMsgType("H"))
	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 OrderStatusRequest, 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.0", "H", r
}

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

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

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

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

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

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

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

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

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

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

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

// GetSide gets Side, Tag 54.
func (m OrderStatusRequest) 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 OrderStatusRequest) GetSymbol() (v string, err quickfix.MessageRejectError) {
	var f field.SymbolField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

// GetExecBroker gets ExecBroker, Tag 76.
func (m OrderStatusRequest) 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 OrderStatusRequest) 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 OrderStatusRequest) 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 OrderStatusRequest) GetClientID() (v string, err quickfix.MessageRejectError) {
	var f field.ClientIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

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

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

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

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

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

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

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

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