pub struct Message<'a, Doc: Debug + Default + Clone + PartialEq + Serialize + Deserialize<'a> + Validate> {
pub xml_string: &'a str,
pub inner: BizMsgEnvlp<AppHdr<Signature, Signature>, Doc, Dmkr, Dmkr>,
}Fields§
§xml_string: &'a strXML string representing the inner type. Used internally to parse the inner type. An incoming message will use this field for helping to determine what the inner type is.
use the to_xml() method to get the XML string representation of the message
inner type.
inner: BizMsgEnvlp<AppHdr<Signature, Signature>, Doc, Dmkr, Dmkr>Internal representation of the message envelope
Implementations§
Source§impl<'a, Doc> Message<'a, Doc>
impl<'a, Doc> Message<'a, Doc>
pub fn builder() -> Self
Sourcepub fn app_hdr(&self) -> Option<AppHdr<Signature, Signature>>
pub fn app_hdr(&self) -> Option<AppHdr<Signature, Signature>>
Return the application header from the message envelope
Sourcepub fn set_app_hdr(self, app_hdr: AppHdr<Signature, Signature>) -> Self
pub fn set_app_hdr(self, app_hdr: AppHdr<Signature, Signature>) -> Self
Set the application header AppHdr of the message Note, this will overwrite the existing AppHdr
Sourcepub fn set_recipient(self, recipient: Party44Choice) -> Self
pub fn set_recipient(self, recipient: Party44Choice) -> Self
Set the recipient of the message
Sourcepub fn set_recipient_org_id(self, org_id: OrganisationIdentification29) -> Self
pub fn set_recipient_org_id(self, org_id: OrganisationIdentification29) -> Self
Set the recipient organization id of the message.
This is a simplified version of set_recipient that only takes an organization id.
Use the set_recipient_fi_id() method to set a financial institutiton id.
Note, this will overwrite any existing recipient.
Sourcepub fn set_recipient_fi_id(
self,
fin_instn_id: FinancialInstitutionIdentification18,
) -> Self
pub fn set_recipient_fi_id( self, fin_instn_id: FinancialInstitutionIdentification18, ) -> Self
Set the recipient financial institution id of the message.
This is a simplified version of set_recipient that only takes a financial institution id.
Use the set_recipient_org_id() method to set an organization id.
Note, this will overwrite any existing recipient.
Sourcepub fn set_recipient_prvt_id(self, prvt_id: PersonIdentification13) -> Self
pub fn set_recipient_prvt_id(self, prvt_id: PersonIdentification13) -> Self
Set the recipient private individual id of the message.
This is a simplified version of set_recipient that only takes a private individual id.
Use the set_recipient_org_id() method to set an organization id or the set_recipient_fi_id()
method to set a financial institution id.
Note, this will overwrite any existing recipient.
Sourcepub fn set_sender(self, sender: Party44Choice) -> Self
pub fn set_sender(self, sender: Party44Choice) -> Self
Set the sender of the message
Sourcepub fn set_sender_org_id(self, org_id: OrganisationIdentification29) -> Self
pub fn set_sender_org_id(self, org_id: OrganisationIdentification29) -> Self
Set the sender organization id of the message.
This is a simplified version of set_sender that only takes an organization id.
Use the set_sender_fi_id() method to set a financial institutiton id.
Note, this will overwrite any existing sender.
Sourcepub fn set_sender_fi_id(
self,
fin_instn_id: FinancialInstitutionIdentification18,
) -> Self
pub fn set_sender_fi_id( self, fin_instn_id: FinancialInstitutionIdentification18, ) -> Self
Set the sender financial institution id of the message.
This is a simplified version of set_sender that only takes a financial institution id.
Use the set_sender_org_id() method to set an organization id.
Note, this will overwrite any existing sender.
Sourcepub fn set_sender_prvt_id(self, prvt_id: PersonIdentification13) -> Self
pub fn set_sender_prvt_id(self, prvt_id: PersonIdentification13) -> Self
Set the sender private individual id of the message.
This is a simplified version of set_sender that only takes a private individual id.
Use the set_sender_org_id() method to set an organization id or the set_sender_fi_id()
method to set a financial institution id.
Note, this will overwrite any existing sender.
Sourcepub fn set_biz_msg_idr(self, idr: Max35Text) -> Self
pub fn set_biz_msg_idr(self, idr: Max35Text) -> Self
e.g. Document
Sourcepub fn set_msg_def_idr(self, idr: Max35Text) -> Self
pub fn set_msg_def_idr(self, idr: Max35Text) -> Self
e.g. pacs.008.001.07
Sourcepub fn set_cre_dt(self) -> Self
pub fn set_cre_dt(self) -> Self
Set the created date time of the message. This will be set to the current UTC time.
Sourcepub fn set_namespace(self) -> Self
pub fn set_namespace(self) -> Self
Set the xml namespace of the message and business header.
Sourcepub fn set_document(self, doc: Doc) -> Self
pub fn set_document(self, doc: Doc) -> Self
Set the document of the message.
Note, the document must set its own namespace value.
By default, all root iso-20022 message documents have
an attribute field, xmlns, that is used to set the document namespace.
The document namespace must be set before calling this method.
Sourcepub fn sign_document(
self,
signer: impl Signer<Signature>,
xpath: Option<&str>,
) -> Result<Self, Error>
pub fn sign_document( self, signer: impl Signer<Signature>, xpath: Option<&str>, ) -> Result<Self, Error>
Sign the document at an optional xpath, e.g. /Document/AcctOpngInstr
If no xpath is provided, the entire document will be signed, e.g. /Document
Note, this will overwrite any existing signature.
use iso_20022_sdk::prelude::*;
let msg = Message::<_>::builder()
// Document must be set before signing
.set_document(doc)
// Sign the entire document
.sign_document(&signer, None);
Sourcepub fn set_rltd(self, rltd: BusinessApplicationHeader7<Signature>) -> Self
pub fn set_rltd(self, rltd: BusinessApplicationHeader7<Signature>) -> Self
Set the related business reference of the message.