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

import (
	"github.com/shopspring/decimal"

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

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

// FromMessage creates a QuoteRequest from a quickfix.Message instance.
func FromMessage(m *quickfix.Message) QuoteRequest {
	return QuoteRequest{
		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 QuoteRequest) ToMessage() *quickfix.Message {
	return m.Message
}

// New returns a QuoteRequest initialized with the required fields for QuoteRequest.
func New(quotereqid field.QuoteReqIDField, symbol field.SymbolField) (m QuoteRequest) {
	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("R"))
	m.Set(quotereqid)
	m.Set(symbol)

	return
}

// A RouteOut is the callback type that should be implemented for routing Message.
type RouteOut func(msg QuoteRequest, 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", "R", r
}

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

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

// SetOrdType sets OrdType, Tag 40.
func (m QuoteRequest) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}

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

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

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

// SetFutSettDate sets FutSettDate, Tag 64.
func (m QuoteRequest) SetFutSettDate(v string) {
	m.Set(field.NewFutSettDate(v))
}

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

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

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

// SetQuoteReqID sets QuoteReqID, Tag 131.
func (m QuoteRequest) SetQuoteReqID(v string) {
	m.Set(field.NewQuoteReqID(v))
}

// SetPrevClosePx sets PrevClosePx, Tag 140.
func (m QuoteRequest) SetPrevClosePx(value decimal.Decimal, scale int32) {
	m.Set(field.NewPrevClosePx(value, scale))
}

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

// SetOrderQty2 sets OrderQty2, Tag 192.
func (m QuoteRequest) SetOrderQty2(value decimal.Decimal, scale int32) {
	m.Set(field.NewOrderQty2(value, scale))
}

// SetFutSettDate2 sets FutSettDate2, Tag 193.
func (m QuoteRequest) SetFutSettDate2(v string) {
	m.Set(field.NewFutSettDate2(v))
}

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

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

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

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

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

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

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

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

// GetOrdType gets OrdType, Tag 40.
func (m QuoteRequest) GetOrdType() (v enum.OrdType, err quickfix.MessageRejectError) {
	var f field.OrdTypeField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

// GetFutSettDate gets FutSettDate, Tag 64.
func (m QuoteRequest) GetFutSettDate() (v string, err quickfix.MessageRejectError) {
	var f field.FutSettDateField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

// GetIssuer gets Issuer, Tag 106.
func (m QuoteRequest) 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 QuoteRequest) GetSecurityDesc() (v string, err quickfix.MessageRejectError) {
	var f field.SecurityDescField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetQuoteReqID gets QuoteReqID, Tag 131.
func (m QuoteRequest) GetQuoteReqID() (v string, err quickfix.MessageRejectError) {
	var f field.QuoteReqIDField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetPrevClosePx gets PrevClosePx, Tag 140.
func (m QuoteRequest) GetPrevClosePx() (v decimal.Decimal, err quickfix.MessageRejectError) {
	var f field.PrevClosePxField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

// GetOrderQty2 gets OrderQty2, Tag 192.
func (m QuoteRequest) GetOrderQty2() (v decimal.Decimal, err quickfix.MessageRejectError) {
	var f field.OrderQty2Field
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetFutSettDate2 gets FutSettDate2, Tag 193.
func (m QuoteRequest) GetFutSettDate2() (v string, err quickfix.MessageRejectError) {
	var f field.FutSettDate2Field
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

// GetMaturityMonthYear gets MaturityMonthYear, Tag 200.
func (m QuoteRequest) 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 QuoteRequest) 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 QuoteRequest) 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 QuoteRequest) 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 QuoteRequest) 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 QuoteRequest) GetSecurityExchange() (v string, err quickfix.MessageRejectError) {
	var f field.SecurityExchangeField
	if err = m.Get(&f); err == nil {
		v = f.Value()
	}
	return
}

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

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

// HasOrdType returns true if OrdType is present, Tag 40.
func (m QuoteRequest) HasOrdType() bool {
	return m.Has(tag.OrdType)
}

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

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

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

// HasFutSettDate returns true if FutSettDate is present, Tag 64.
func (m QuoteRequest) HasFutSettDate() bool {
	return m.Has(tag.FutSettDate)
}

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

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

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

// HasQuoteReqID returns true if QuoteReqID is present, Tag 131.
func (m QuoteRequest) HasQuoteReqID() bool {
	return m.Has(tag.QuoteReqID)
}

// HasPrevClosePx returns true if PrevClosePx is present, Tag 140.
func (m QuoteRequest) HasPrevClosePx() bool {
	return m.Has(tag.PrevClosePx)
}

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

// HasOrderQty2 returns true if OrderQty2 is present, Tag 192.
func (m QuoteRequest) HasOrderQty2() bool {
	return m.Has(tag.OrderQty2)
}

// HasFutSettDate2 returns true if FutSettDate2 is present, Tag 193.
func (m QuoteRequest) HasFutSettDate2() bool {
	return m.Has(tag.FutSettDate2)
}

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

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

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

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

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

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