fixer-fix 0.10.1

Generated FIX protocol types for fixer
Documentation
// Code generated by fixer-gen. DO NOT EDIT.
#![allow(clippy::new_without_default)]
#![allow(clippy::needless_pass_by_value)]
#![allow(clippy::too_many_arguments)]
#![allow(unused_imports)]

use fixer::message::Message;
use fixer::fix_string::FIXString;
use fixer::errors::MessageRejectErrorEnum;
use fixer::session::session_id::SessionID;


use crate::field;
use crate::tag;

/// `PartyDetailsListReport` is the `fix50sp2` `PartyDetailsListReport` type, `MsgType` = CG.
pub struct PartyDetailsListReport {
    pub message: Message,
}

impl PartyDetailsListReport {
    /// Creates a new `PartyDetailsListReport` with required fields.
    pub fn new(party_details_list_report_id: field::PartyDetailsListReportIDField) -> Self {
        let mut msg = Message::new();
        msg.header.set_field(tag::MSG_TYPE, FIXString::from("CG".to_string()));

        msg.body.set_field(tag::PARTY_DETAILS_LIST_REPORT_ID, party_details_list_report_id.0);

        Self { message: msg }
    }

    /// Creates a `PartyDetailsListReport` from an existing `Message`.
    pub fn from_message(msg: Message) -> Self {
        Self { message: msg }
    }

    /// Returns the underlying `Message`.
    pub fn to_message(self) -> Message {
        self.message
    }




    /// Sets `ApplID`, Tag 1180.
    pub fn set_appl_id(&mut self, v: String) {
        self.message.body.set_field(tag::APPL_ID, FIXString::from(v));
    }

    /// Gets `ApplID`, Tag 1180.
    pub fn get_appl_id(&self) -> Result<String, MessageRejectErrorEnum> {
        let mut fld = field::ApplIDField::new(String::new());
        self.message.body.get_field(tag::APPL_ID, &mut fld.0)?;
        Ok(fld.value().to_string())
    }


    /// Returns true if `ApplID` is present, Tag 1180.
    pub fn has_appl_id(&self) -> bool {
        self.message.body.has(tag::APPL_ID)
    }




    /// Sets `ApplLastSeqNum`, Tag 1350.
    pub fn set_appl_last_seq_num(&mut self, v: isize) {
        self.message.body.set_field(tag::APPL_LAST_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `ApplLastSeqNum`, Tag 1350.
    pub fn get_appl_last_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::ApplLastSeqNumField::new(0);
        self.message.body.get_field(tag::APPL_LAST_SEQ_NUM, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `ApplLastSeqNum` is present, Tag 1350.
    pub fn has_appl_last_seq_num(&self) -> bool {
        self.message.body.has(tag::APPL_LAST_SEQ_NUM)
    }




    /// Sets `ApplResendFlag`, Tag 1352.
    pub fn set_appl_resend_flag(&mut self, v: bool) {
        self.message.body.set_field(tag::APPL_RESEND_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
    }

    /// Gets `ApplResendFlag`, Tag 1352.
    pub fn get_appl_resend_flag(&self) -> Result<bool, MessageRejectErrorEnum> {
        let mut fld = field::ApplResendFlagField::new(false);
        self.message.body.get_field(tag::APPL_RESEND_FLAG, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `ApplResendFlag` is present, Tag 1352.
    pub fn has_appl_resend_flag(&self) -> bool {
        self.message.body.has(tag::APPL_RESEND_FLAG)
    }




    /// Sets `ApplSeqNum`, Tag 1181.
    pub fn set_appl_seq_num(&mut self, v: isize) {
        self.message.body.set_field(tag::APPL_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `ApplSeqNum`, Tag 1181.
    pub fn get_appl_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::ApplSeqNumField::new(0);
        self.message.body.get_field(tag::APPL_SEQ_NUM, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `ApplSeqNum` is present, Tag 1181.
    pub fn has_appl_seq_num(&self) -> bool {
        self.message.body.has(tag::APPL_SEQ_NUM)
    }




    /// Sets `EncodedText`, Tag 355.
    pub fn set_encoded_text(&mut self, v: String) {
        self.message.body.set_field(tag::ENCODED_TEXT, FIXString::from(v));
    }

    /// Gets `EncodedText`, Tag 355.
    pub fn get_encoded_text(&self) -> Result<String, MessageRejectErrorEnum> {
        let mut fld = field::EncodedTextField::new(String::new());
        self.message.body.get_field(tag::ENCODED_TEXT, &mut fld.0)?;
        Ok(fld.value().to_string())
    }


    /// Returns true if `EncodedText` is present, Tag 355.
    pub fn has_encoded_text(&self) -> bool {
        self.message.body.has(tag::ENCODED_TEXT)
    }




    /// Sets `EncodedTextLen`, Tag 354.
    pub fn set_encoded_text_len(&mut self, v: isize) {
        self.message.body.set_field(tag::ENCODED_TEXT_LEN, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `EncodedTextLen`, Tag 354.
    pub fn get_encoded_text_len(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::EncodedTextLenField::new(0);
        self.message.body.get_field(tag::ENCODED_TEXT_LEN, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `EncodedTextLen` is present, Tag 354.
    pub fn has_encoded_text_len(&self) -> bool {
        self.message.body.has(tag::ENCODED_TEXT_LEN)
    }




    /// Sets `LastFragment`, Tag 893.
    pub fn set_last_fragment(&mut self, v: bool) {
        self.message.body.set_field(tag::LAST_FRAGMENT, fixer::fix_boolean::FIXBoolean::from(v));
    }

    /// Gets `LastFragment`, Tag 893.
    pub fn get_last_fragment(&self) -> Result<bool, MessageRejectErrorEnum> {
        let mut fld = field::LastFragmentField::new(false);
        self.message.body.get_field(tag::LAST_FRAGMENT, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `LastFragment` is present, Tag 893.
    pub fn has_last_fragment(&self) -> bool {
        self.message.body.has(tag::LAST_FRAGMENT)
    }




    /// Sets `NoPartyList`, Tag 1513.
    pub fn set_no_party_list(&mut self, v: isize) {
        self.message.body.set_field(tag::NO_PARTY_LIST, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `NoPartyList`, Tag 1513.
    pub fn get_no_party_list(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::NoPartyListField::new(0);
        self.message.body.get_field(tag::NO_PARTY_LIST, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `NoPartyList` is present, Tag 1513.
    pub fn has_no_party_list(&self) -> bool {
        self.message.body.has(tag::NO_PARTY_LIST)
    }




    /// Sets `PartyDetailsListReportID`, Tag 1510.
    pub fn set_party_details_list_report_id(&mut self, v: String) {
        self.message.body.set_field(tag::PARTY_DETAILS_LIST_REPORT_ID, FIXString::from(v));
    }

    /// Gets `PartyDetailsListReportID`, Tag 1510.
    pub fn get_party_details_list_report_id(&self) -> Result<String, MessageRejectErrorEnum> {
        let mut fld = field::PartyDetailsListReportIDField::new(String::new());
        self.message.body.get_field(tag::PARTY_DETAILS_LIST_REPORT_ID, &mut fld.0)?;
        Ok(fld.value().to_string())
    }


    /// Returns true if `PartyDetailsListReportID` is present, Tag 1510.
    pub fn has_party_details_list_report_id(&self) -> bool {
        self.message.body.has(tag::PARTY_DETAILS_LIST_REPORT_ID)
    }




    /// Sets `PartyDetailsListRequestID`, Tag 1505.
    pub fn set_party_details_list_request_id(&mut self, v: String) {
        self.message.body.set_field(tag::PARTY_DETAILS_LIST_REQUEST_ID, FIXString::from(v));
    }

    /// Gets `PartyDetailsListRequestID`, Tag 1505.
    pub fn get_party_details_list_request_id(&self) -> Result<String, MessageRejectErrorEnum> {
        let mut fld = field::PartyDetailsListRequestIDField::new(String::new());
        self.message.body.get_field(tag::PARTY_DETAILS_LIST_REQUEST_ID, &mut fld.0)?;
        Ok(fld.value().to_string())
    }


    /// Returns true if `PartyDetailsListRequestID` is present, Tag 1505.
    pub fn has_party_details_list_request_id(&self) -> bool {
        self.message.body.has(tag::PARTY_DETAILS_LIST_REQUEST_ID)
    }




    /// Sets `PartyDetailsRequestResult`, Tag 1511.
    pub fn set_party_details_request_result(&mut self, v: isize) {
        self.message.body.set_field(tag::PARTY_DETAILS_REQUEST_RESULT, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `PartyDetailsRequestResult`, Tag 1511.
    pub fn get_party_details_request_result(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::PartyDetailsRequestResultField::new(0);
        self.message.body.get_field(tag::PARTY_DETAILS_REQUEST_RESULT, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `PartyDetailsRequestResult` is present, Tag 1511.
    pub fn has_party_details_request_result(&self) -> bool {
        self.message.body.has(tag::PARTY_DETAILS_REQUEST_RESULT)
    }




    /// Sets `Text`, Tag 58.
    pub fn set_text(&mut self, v: String) {
        self.message.body.set_field(tag::TEXT, FIXString::from(v));
    }

    /// Gets `Text`, Tag 58.
    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
        let mut fld = field::TextField::new(String::new());
        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
        Ok(fld.value().to_string())
    }


    /// Returns true if `Text` is present, Tag 58.
    pub fn has_text(&self) -> bool {
        self.message.body.has(tag::TEXT)
    }




    /// Sets `TotNoPartyList`, Tag 1512.
    pub fn set_tot_no_party_list(&mut self, v: isize) {
        self.message.body.set_field(tag::TOT_NO_PARTY_LIST, fixer::fix_int::FIXInt::from(v));
    }

    /// Gets `TotNoPartyList`, Tag 1512.
    pub fn get_tot_no_party_list(&self) -> Result<isize, MessageRejectErrorEnum> {
        let mut fld = field::TotNoPartyListField::new(0);
        self.message.body.get_field(tag::TOT_NO_PARTY_LIST, &mut fld.0)?;
        Ok(fld.value())
    }


    /// Returns true if `TotNoPartyList` is present, Tag 1512.
    pub fn has_tot_no_party_list(&self) -> bool {
        self.message.body.has(tag::TOT_NO_PARTY_LIST)
    }


}

/// `RouteOut` is the callback type for routing `PartyDetailsListReport` messages.
pub type RouteOut = fn(msg: PartyDetailsListReport, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;

/// Route type returned by the `route` function.
pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);

/// Returns the begin string, message type, and route function for `PartyDetailsListReport`.
pub fn route(router: RouteOut) -> Route {
    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
        router(PartyDetailsListReport::from_message(msg.clone()), session_id)
    };
    ("9", "CG", Box::new(r))
}