use crate::parse_result::{ErrorCollector, ParserConfig};
use crate::validation::{Validate, helpers};
use serde::{Deserialize, Serialize};
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AccountIdentification4Choice {
#[serde(rename = "IBAN", skip_serializing_if = "Option::is_none")]
pub iban: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<GenericAccountIdentification1>,
}
impl Validate for AccountIdentification4Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.iban {
helpers::validate_pattern(
val,
"IBAN",
"[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}",
&helpers::child_path(path, "IBAN"),
config,
collector,
);
}
if let Some(ref val) = self.othr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AccountIdentification4Choice1 {
#[serde(rename = "IBAN", skip_serializing_if = "Option::is_none")]
pub iban: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<GenericAccountIdentification11>,
}
impl Validate for AccountIdentification4Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.iban {
helpers::validate_pattern(
val,
"IBAN",
"[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}",
&helpers::child_path(path, "IBAN"),
config,
collector,
);
}
if let Some(ref val) = self.othr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AccountSchemeName1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for AccountSchemeName1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AccountSchemeName1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for AccountSchemeName1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ActiveOrHistoricCurrencyAndAmount {
#[serde(rename = "@Ccy")]
pub ccy: String,
#[serde(rename = "$value")]
pub value: f64,
}
impl Validate for ActiveOrHistoricCurrencyAndAmount {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AmendmentInformationDetails131 {
#[serde(rename = "OrgnlMndtId", skip_serializing_if = "Option::is_none")]
pub orgnl_mndt_id: Option<String>,
#[serde(rename = "OrgnlCdtrSchmeId", skip_serializing_if = "Option::is_none")]
pub orgnl_cdtr_schme_id: Option<PartyIdentification1354>,
#[serde(rename = "OrgnlCdtrAgt", skip_serializing_if = "Option::is_none")]
pub orgnl_cdtr_agt: Option<BranchAndFinancialInstitutionIdentification64>,
#[serde(rename = "OrgnlCdtrAgtAcct", skip_serializing_if = "Option::is_none")]
pub orgnl_cdtr_agt_acct: Option<CashAccount38>,
#[serde(rename = "OrgnlDbtr", skip_serializing_if = "Option::is_none")]
pub orgnl_dbtr: Option<PartyIdentification1354>,
#[serde(rename = "OrgnlDbtrAcct", skip_serializing_if = "Option::is_none")]
pub orgnl_dbtr_acct: Option<CashAccount38>,
#[serde(rename = "OrgnlDbtrAgt", skip_serializing_if = "Option::is_none")]
pub orgnl_dbtr_agt: Option<BranchAndFinancialInstitutionIdentification65>,
#[serde(rename = "OrgnlDbtrAgtAcct", skip_serializing_if = "Option::is_none")]
pub orgnl_dbtr_agt_acct: Option<CashAccount38>,
#[serde(rename = "OrgnlFnlColltnDt", skip_serializing_if = "Option::is_none")]
pub orgnl_fnl_colltn_dt: Option<String>,
#[serde(rename = "OrgnlFrqcy", skip_serializing_if = "Option::is_none")]
pub orgnl_frqcy: Option<Frequency36Choice>,
#[serde(rename = "OrgnlRsn", skip_serializing_if = "Option::is_none")]
pub orgnl_rsn: Option<MandateSetupReason1Choice>,
#[serde(rename = "OrgnlTrckgDays", skip_serializing_if = "Option::is_none")]
pub orgnl_trckg_days: Option<String>,
}
impl Validate for AmendmentInformationDetails131 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.orgnl_mndt_id {
helpers::validate_length(
val,
"OrgnlMndtId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlMndtId"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_cdtr_schme_id
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlCdtrSchmeId"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_cdtr_agt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlCdtrAgt"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_cdtr_agt_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlCdtrAgtAcct"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgnlDbtr"), config, collector);
}
if let Some(ref val) = self.orgnl_dbtr_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlDbtrAcct"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_dbtr_agt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlDbtrAgt"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_dbtr_agt_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlDbtrAgtAcct"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_frqcy
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgnlFrqcy"), config, collector);
}
if let Some(ref val) = self.orgnl_rsn
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgnlRsn"), config, collector);
}
if let Some(ref val) = self.orgnl_trckg_days {
helpers::validate_pattern(
val,
"OrgnlTrckgDays",
"[0-9]{2}",
&helpers::child_path(path, "OrgnlTrckgDays"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct AmountType4Choice1 {
#[serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none")]
pub instd_amt: Option<CBPRAmount1>,
#[serde(rename = "EqvtAmt", skip_serializing_if = "Option::is_none")]
pub eqvt_amt: Option<EquivalentAmount21>,
}
impl Validate for AmountType4Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.instd_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "InstdAmt"), config, collector);
}
if let Some(ref val) = self.eqvt_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "EqvtAmt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification61 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification181,
}
impl Validate for BranchAndFinancialInstitutionIdentification61 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification62 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification182,
}
impl Validate for BranchAndFinancialInstitutionIdentification62 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification63 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification181,
#[serde(rename = "BrnchId", skip_serializing_if = "Option::is_none")]
pub brnch_id: Option<BranchData31>,
}
impl Validate for BranchAndFinancialInstitutionIdentification63 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
if let Some(ref val) = self.brnch_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "BrnchId"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification64 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification183,
}
impl Validate for BranchAndFinancialInstitutionIdentification64 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification65 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification184,
}
impl Validate for BranchAndFinancialInstitutionIdentification65 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification66 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification185,
}
impl Validate for BranchAndFinancialInstitutionIdentification66 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification67 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification186,
}
impl Validate for BranchAndFinancialInstitutionIdentification67 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchAndFinancialInstitutionIdentification68 {
#[serde(rename = "FinInstnId")]
pub fin_instn_id: FinancialInstitutionIdentification187,
}
impl Validate for BranchAndFinancialInstitutionIdentification68 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.fin_instn_id
.validate(&helpers::child_path(path, "FinInstnId"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct BranchData31 {
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
impl Validate for BranchData31 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.id {
helpers::validate_length(
val,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
}
if let Some(ref val) = self.id {
helpers::validate_pattern(
val,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CBPRAmount1 {
#[serde(rename = "@Ccy")]
pub ccy: String,
#[serde(rename = "$value")]
pub value: f64,
}
impl Validate for CBPRAmount1 {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CashAccount38 {
#[serde(rename = "Id")]
pub id: AccountIdentification4Choice,
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<CashAccountType2Choice>,
#[serde(rename = "Ccy", skip_serializing_if = "Option::is_none")]
pub ccy: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "Prxy", skip_serializing_if = "Option::is_none")]
pub prxy: Option<ProxyAccountIdentification1>,
}
impl Validate for CashAccount38 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.id
.validate(&helpers::child_path(path, "Id"), config, collector);
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.ccy {
helpers::validate_pattern(
val,
"Ccy",
"[A-Z]{3,3}",
&helpers::child_path(path, "Ccy"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(70),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.prxy
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prxy"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CashAccount381 {
#[serde(rename = "Id")]
pub id: AccountIdentification4Choice1,
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<CashAccountType2Choice1>,
#[serde(rename = "Ccy", skip_serializing_if = "Option::is_none")]
pub ccy: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "Prxy", skip_serializing_if = "Option::is_none")]
pub prxy: Option<ProxyAccountIdentification11>,
}
impl Validate for CashAccount381 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.id
.validate(&helpers::child_path(path, "Id"), config, collector);
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.ccy {
helpers::validate_pattern(
val,
"Ccy",
"[A-Z]{3,3}",
&helpers::child_path(path, "Ccy"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(70),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.prxy
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prxy"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CashAccount382 {
#[serde(rename = "Id")]
pub id: AccountIdentification4Choice1,
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<CashAccountType2Choice1>,
#[serde(rename = "Ccy", skip_serializing_if = "Option::is_none")]
pub ccy: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "Prxy", skip_serializing_if = "Option::is_none")]
pub prxy: Option<ProxyAccountIdentification11>,
}
impl Validate for CashAccount382 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.id
.validate(&helpers::child_path(path, "Id"), config, collector);
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.ccy {
helpers::validate_pattern(
val,
"Ccy",
"[A-Z]{3,3}",
&helpers::child_path(path, "Ccy"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(70),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.prxy
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prxy"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CashAccountType2Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for CashAccountType2Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CashAccountType2Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for CashAccountType2Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CategoryPurpose1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for CategoryPurpose1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum ChargeBearerType1Code1 {
#[default]
#[serde(rename = "CRED")]
CodeCRED,
#[serde(rename = "SHAR")]
CodeSHAR,
}
impl Validate for ChargeBearerType1Code1 {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Charges71 {
#[serde(rename = "Amt")]
pub amt: CBPRAmount1,
#[serde(rename = "Agt")]
pub agt: BranchAndFinancialInstitutionIdentification61,
}
impl Validate for Charges71 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
self.agt
.validate(&helpers::child_path(path, "Agt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum ClearingChannel2Code {
#[default]
#[serde(rename = "RTGS")]
CodeRTGS,
#[serde(rename = "RTNS")]
CodeRTNS,
#[serde(rename = "MPNS")]
CodeMPNS,
#[serde(rename = "BOOK")]
CodeBOOK,
}
impl Validate for ClearingChannel2Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemIdentification2Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ClearingSystemIdentification2Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(5),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemIdentification2Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
}
impl Validate for ClearingSystemIdentification2Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(5),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemIdentification2Choice2 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ClearingSystemIdentification2Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(5),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemMemberIdentification2 {
#[serde(rename = "ClrSysId", skip_serializing_if = "Option::is_none")]
pub clr_sys_id: Option<ClearingSystemIdentification2Choice>,
#[serde(rename = "MmbId")]
pub mmb_id: String,
}
impl Validate for ClearingSystemMemberIdentification2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.clr_sys_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysId"), config, collector);
}
helpers::validate_length(
&self.mmb_id,
"MmbId",
Some(1),
Some(35),
&helpers::child_path(path, "MmbId"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemMemberIdentification21 {
#[serde(rename = "ClrSysId")]
pub clr_sys_id: ClearingSystemIdentification2Choice1,
#[serde(rename = "MmbId")]
pub mmb_id: String,
}
impl Validate for ClearingSystemMemberIdentification21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.clr_sys_id
.validate(&helpers::child_path(path, "ClrSysId"), config, collector);
helpers::validate_length(
&self.mmb_id,
"MmbId",
Some(1),
Some(28),
&helpers::child_path(path, "MmbId"),
config,
collector,
);
helpers::validate_pattern(
&self.mmb_id,
"MmbId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "MmbId"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ClearingSystemMemberIdentification22 {
#[serde(rename = "ClrSysId")]
pub clr_sys_id: ClearingSystemIdentification2Choice2,
#[serde(rename = "MmbId")]
pub mmb_id: String,
}
impl Validate for ClearingSystemMemberIdentification22 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.clr_sys_id
.validate(&helpers::child_path(path, "ClrSysId"), config, collector);
helpers::validate_length(
&self.mmb_id,
"MmbId",
Some(1),
Some(28),
&helpers::child_path(path, "MmbId"),
config,
collector,
);
helpers::validate_pattern(
&self.mmb_id,
"MmbId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "MmbId"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum CreditDebitCode {
#[default]
#[serde(rename = "CRDT")]
CodeCRDT,
#[serde(rename = "DBIT")]
CodeDBIT,
}
impl Validate for CreditDebitCode {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CreditorReferenceInformation21 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<CreditorReferenceType21>,
#[serde(rename = "Ref", skip_serializing_if = "Option::is_none")]
pub ref_attr: Option<String>,
}
impl Validate for CreditorReferenceInformation21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.ref_attr {
helpers::validate_length(
val,
"Ref",
Some(1),
Some(35),
&helpers::child_path(path, "Ref"),
config,
collector,
);
}
if let Some(ref val) = self.ref_attr {
helpers::validate_pattern(
val,
"Ref",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Ref"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CreditorReferenceType1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<DocumentType3Code>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for CreditorReferenceType1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Cd"), config, collector);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct CreditorReferenceType21 {
#[serde(rename = "CdOrPrtry")]
pub cd_or_prtry: CreditorReferenceType1Choice1,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for CreditorReferenceType21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.cd_or_prtry
.validate(&helpers::child_path(path, "CdOrPrtry"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DateAndDateTime2Choice1 {
#[serde(rename = "Dt", skip_serializing_if = "Option::is_none")]
pub dt: Option<String>,
#[serde(rename = "DtTm", skip_serializing_if = "Option::is_none")]
pub dt_tm: Option<String>,
}
impl Validate for DateAndDateTime2Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dt_tm {
helpers::validate_pattern(
val,
"DtTm",
".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
&helpers::child_path(path, "DtTm"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DateAndPlaceOfBirth1 {
#[serde(rename = "BirthDt")]
pub birth_dt: String,
#[serde(rename = "PrvcOfBirth", skip_serializing_if = "Option::is_none")]
pub prvc_of_birth: Option<String>,
#[serde(rename = "CityOfBirth")]
pub city_of_birth: String,
#[serde(rename = "CtryOfBirth")]
pub ctry_of_birth: String,
}
impl Validate for DateAndPlaceOfBirth1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.prvc_of_birth {
helpers::validate_length(
val,
"PrvcOfBirth",
Some(1),
Some(35),
&helpers::child_path(path, "PrvcOfBirth"),
config,
collector,
);
}
helpers::validate_length(
&self.city_of_birth,
"CityOfBirth",
Some(1),
Some(35),
&helpers::child_path(path, "CityOfBirth"),
config,
collector,
);
helpers::validate_pattern(
&self.ctry_of_birth,
"CtryOfBirth",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfBirth"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DateAndPlaceOfBirth11 {
#[serde(rename = "BirthDt")]
pub birth_dt: String,
#[serde(rename = "PrvcOfBirth", skip_serializing_if = "Option::is_none")]
pub prvc_of_birth: Option<String>,
#[serde(rename = "CityOfBirth")]
pub city_of_birth: String,
#[serde(rename = "CtryOfBirth")]
pub ctry_of_birth: String,
}
impl Validate for DateAndPlaceOfBirth11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.prvc_of_birth {
helpers::validate_length(
val,
"PrvcOfBirth",
Some(1),
Some(35),
&helpers::child_path(path, "PrvcOfBirth"),
config,
collector,
);
}
if let Some(ref val) = self.prvc_of_birth {
helpers::validate_pattern(
val,
"PrvcOfBirth",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "PrvcOfBirth"),
config,
collector,
);
}
helpers::validate_length(
&self.city_of_birth,
"CityOfBirth",
Some(1),
Some(35),
&helpers::child_path(path, "CityOfBirth"),
config,
collector,
);
helpers::validate_pattern(
&self.city_of_birth,
"CityOfBirth",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "CityOfBirth"),
config,
collector,
);
helpers::validate_pattern(
&self.ctry_of_birth,
"CtryOfBirth",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfBirth"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DatePeriod2 {
#[serde(rename = "FrDt")]
pub fr_dt: String,
#[serde(rename = "ToDt")]
pub to_dt: String,
}
impl Validate for DatePeriod2 {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DiscountAmountAndType1 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<DiscountAmountType1Choice>,
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
}
impl Validate for DiscountAmountAndType1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DiscountAmountAndType11 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<DiscountAmountType1Choice1>,
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
}
impl Validate for DiscountAmountAndType11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DiscountAmountType1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for DiscountAmountType1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DiscountAmountType1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for DiscountAmountType1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DocumentAdjustment11 {
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
#[serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none")]
pub cdt_dbt_ind: Option<CreditDebitCode>,
#[serde(rename = "Rsn", skip_serializing_if = "Option::is_none")]
pub rsn: Option<String>,
#[serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none")]
pub addtl_inf: Option<String>,
}
impl Validate for DocumentAdjustment11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
if let Some(ref val) = self.cdt_dbt_ind
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtDbtInd"), config, collector);
}
if let Some(ref val) = self.rsn {
helpers::validate_length(
val,
"Rsn",
Some(1),
Some(4),
&helpers::child_path(path, "Rsn"),
config,
collector,
);
}
if let Some(ref val) = self.rsn {
helpers::validate_pattern(
val,
"Rsn",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Rsn"),
config,
collector,
);
}
if let Some(ref val) = self.addtl_inf {
helpers::validate_length(
val,
"AddtlInf",
Some(1),
Some(140),
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
if let Some(ref val) = self.addtl_inf {
helpers::validate_pattern(
val,
"AddtlInf",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DocumentLineIdentification11 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<DocumentLineType11>,
#[serde(rename = "Nb", skip_serializing_if = "Option::is_none")]
pub nb: Option<String>,
#[serde(rename = "RltdDt", skip_serializing_if = "Option::is_none")]
pub rltd_dt: Option<String>,
}
impl Validate for DocumentLineIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.nb {
helpers::validate_length(
val,
"Nb",
Some(1),
Some(35),
&helpers::child_path(path, "Nb"),
config,
collector,
);
}
if let Some(ref val) = self.nb {
helpers::validate_pattern(
val,
"Nb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nb"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DocumentLineInformation11 {
#[serde(rename = "Id")]
pub id: Vec<DocumentLineIdentification11>,
#[serde(rename = "Desc", skip_serializing_if = "Option::is_none")]
pub desc: Option<String>,
#[serde(rename = "Amt", skip_serializing_if = "Option::is_none")]
pub amt: Option<RemittanceAmount31>,
}
impl Validate for DocumentLineInformation11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
for item in &self.id {
item.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.desc {
helpers::validate_length(
val,
"Desc",
Some(1),
Some(35),
&helpers::child_path(path, "Desc"),
config,
collector,
);
}
if let Some(ref val) = self.desc {
helpers::validate_pattern(
val,
"Desc",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Desc"),
config,
collector,
);
}
if let Some(ref val) = self.amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DocumentLineType1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for DocumentLineType1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct DocumentLineType11 {
#[serde(rename = "CdOrPrtry")]
pub cd_or_prtry: DocumentLineType1Choice,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for DocumentLineType11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.cd_or_prtry
.validate(&helpers::child_path(path, "CdOrPrtry"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum DocumentType3Code {
#[default]
#[serde(rename = "RADM")]
CodeRADM,
#[serde(rename = "RPIN")]
CodeRPIN,
#[serde(rename = "FXDR")]
CodeFXDR,
#[serde(rename = "DISP")]
CodeDISP,
#[serde(rename = "PUOR")]
CodePUOR,
#[serde(rename = "SCOR")]
CodeSCOR,
}
impl Validate for DocumentType3Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum DocumentType6Code {
#[default]
#[serde(rename = "MSIN")]
CodeMSIN,
#[serde(rename = "CNFA")]
CodeCNFA,
#[serde(rename = "DNFA")]
CodeDNFA,
#[serde(rename = "CINV")]
CodeCINV,
#[serde(rename = "CREN")]
CodeCREN,
#[serde(rename = "DEBN")]
CodeDEBN,
#[serde(rename = "HIRI")]
CodeHIRI,
#[serde(rename = "SBIN")]
CodeSBIN,
#[serde(rename = "CMCN")]
CodeCMCN,
#[serde(rename = "SOAC")]
CodeSOAC,
#[serde(rename = "DISP")]
CodeDISP,
#[serde(rename = "BOLD")]
CodeBOLD,
#[serde(rename = "VCHR")]
CodeVCHR,
#[serde(rename = "AROI")]
CodeAROI,
#[serde(rename = "TSUT")]
CodeTSUT,
#[serde(rename = "PUOR")]
CodePUOR,
}
impl Validate for DocumentType6Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct EquivalentAmount21 {
#[serde(rename = "Amt")]
pub amt: CBPRAmount1,
#[serde(rename = "CcyOfTrf")]
pub ccy_of_trf: String,
}
impl Validate for EquivalentAmount21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
helpers::validate_pattern(
&self.ccy_of_trf,
"CcyOfTrf",
"[A-Z]{3,3}",
&helpers::child_path(path, "CcyOfTrf"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialIdentificationSchemeName1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for FinancialIdentificationSchemeName1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification181 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
}
impl Validate for FinancialInstitutionIdentification181 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification182 {
#[serde(rename = "BICFI")]
pub bicfi: String,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
}
impl Validate for FinancialInstitutionIdentification182 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_pattern(
&self.bicfi,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification183 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress243>,
}
impl Validate for FinancialInstitutionIdentification183 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification184 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification2>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress243>,
}
impl Validate for FinancialInstitutionIdentification184 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification185 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification22>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<GenericFinancialIdentification11>,
}
impl Validate for FinancialInstitutionIdentification185 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.othr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification186 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification22>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
}
impl Validate for FinancialInstitutionIdentification186 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FinancialInstitutionIdentification187 {
#[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
pub bicfi: Option<String>,
#[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<GenericFinancialIdentification11>,
}
impl Validate for FinancialInstitutionIdentification187 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.bicfi {
helpers::validate_pattern(
val,
"BICFI",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "BICFI"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_mmb_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.othr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Frequency36Choice {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<Frequency6Code>,
#[serde(rename = "Prd", skip_serializing_if = "Option::is_none")]
pub prd: Option<FrequencyPeriod1>,
#[serde(rename = "PtInTm", skip_serializing_if = "Option::is_none")]
pub pt_in_tm: Option<FrequencyAndMoment1>,
}
impl Validate for Frequency36Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.prd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prd"), config, collector);
}
if let Some(ref val) = self.pt_in_tm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PtInTm"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum Frequency6Code {
#[default]
#[serde(rename = "YEAR")]
CodeYEAR,
#[serde(rename = "MNTH")]
CodeMNTH,
#[serde(rename = "QURT")]
CodeQURT,
#[serde(rename = "MIAN")]
CodeMIAN,
#[serde(rename = "WEEK")]
CodeWEEK,
#[serde(rename = "DAIL")]
CodeDAIL,
#[serde(rename = "ADHO")]
CodeADHO,
#[serde(rename = "INDA")]
CodeINDA,
#[serde(rename = "FRTN")]
CodeFRTN,
}
impl Validate for Frequency6Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FrequencyAndMoment1 {
#[serde(rename = "Tp")]
pub tp: Frequency6Code,
#[serde(rename = "PtInTm")]
pub pt_in_tm: String,
}
impl Validate for FrequencyAndMoment1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.tp
.validate(&helpers::child_path(path, "Tp"), config, collector);
helpers::validate_pattern(
&self.pt_in_tm,
"PtInTm",
"[0-9]{2}",
&helpers::child_path(path, "PtInTm"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct FrequencyPeriod1 {
#[serde(rename = "Tp")]
pub tp: Frequency6Code,
#[serde(rename = "CntPerPrd")]
pub cnt_per_prd: f64,
}
impl Validate for FrequencyPeriod1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.tp
.validate(&helpers::child_path(path, "Tp"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Garnishment31 {
#[serde(rename = "Tp")]
pub tp: GarnishmentType11,
#[serde(rename = "Grnshee", skip_serializing_if = "Option::is_none")]
pub grnshee: Option<PartyIdentification1355>,
#[serde(rename = "GrnshmtAdmstr", skip_serializing_if = "Option::is_none")]
pub grnshmt_admstr: Option<PartyIdentification1355>,
#[serde(rename = "RefNb", skip_serializing_if = "Option::is_none")]
pub ref_nb: Option<String>,
#[serde(rename = "Dt", skip_serializing_if = "Option::is_none")]
pub dt: Option<String>,
#[serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none")]
pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "FmlyMdclInsrncInd", skip_serializing_if = "Option::is_none")]
pub fmly_mdcl_insrnc_ind: Option<bool>,
#[serde(rename = "MplyeeTermntnInd", skip_serializing_if = "Option::is_none")]
pub mplyee_termntn_ind: Option<bool>,
}
impl Validate for Garnishment31 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.tp
.validate(&helpers::child_path(path, "Tp"), config, collector);
if let Some(ref val) = self.grnshee
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Grnshee"), config, collector);
}
if let Some(ref val) = self.grnshmt_admstr
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "GrnshmtAdmstr"),
config,
collector,
);
}
if let Some(ref val) = self.ref_nb {
helpers::validate_length(
val,
"RefNb",
Some(1),
Some(140),
&helpers::child_path(path, "RefNb"),
config,
collector,
);
}
if let Some(ref val) = self.ref_nb {
helpers::validate_pattern(
val,
"RefNb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "RefNb"),
config,
collector,
);
}
if let Some(ref val) = self.rmtd_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "RmtdAmt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GarnishmentType1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for GarnishmentType1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GarnishmentType11 {
#[serde(rename = "CdOrPrtry")]
pub cd_or_prtry: GarnishmentType1Choice1,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GarnishmentType11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.cd_or_prtry
.validate(&helpers::child_path(path, "CdOrPrtry"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericAccountIdentification1 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<AccountSchemeName1Choice>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericAccountIdentification1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(34),
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericAccountIdentification11 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<AccountSchemeName1Choice1>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericAccountIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(34),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]*(/[0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ])?)*)",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericFinancialIdentification11 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<FinancialIdentificationSchemeName1Choice1>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericFinancialIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericOrganisationIdentification1 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<OrganisationIdentificationSchemeName1Choice>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericOrganisationIdentification1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericOrganisationIdentification11 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<OrganisationIdentificationSchemeName1Choice1>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericOrganisationIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericOrganisationIdentification12 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm")]
pub schme_nm: OrganisationIdentificationSchemeName1Choice2,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericOrganisationIdentification12 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
self.schme_nm
.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericOrganisationIdentification13 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<OrganisationIdentificationSchemeName1Choice3>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericOrganisationIdentification13 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericPersonIdentification1 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<PersonIdentificationSchemeName1Choice>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericPersonIdentification1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericPersonIdentification11 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<PersonIdentificationSchemeName1Choice1>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericPersonIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericPersonIdentification12 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm")]
pub schme_nm: PersonIdentificationSchemeName1Choice2,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericPersonIdentification12 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
self.schme_nm
.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GenericPersonIdentification13 {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
pub schme_nm: Option<PersonIdentificationSchemeName1Choice3>,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for GenericPersonIdentification13 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(35),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
if let Some(ref val) = self.schme_nm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
}
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct GroupHeader901 {
#[serde(rename = "MsgId")]
pub msg_id: String,
#[serde(rename = "CreDtTm")]
pub cre_dt_tm: String,
#[serde(rename = "NbOfTxs")]
pub nb_of_txs: Max15NumericTextfixed,
#[serde(rename = "SttlmInf")]
pub sttlm_inf: SettlementInstruction71,
}
impl Validate for GroupHeader901 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.msg_id,
"MsgId",
Some(1),
Some(35),
&helpers::child_path(path, "MsgId"),
config,
collector,
);
helpers::validate_pattern(
&self.msg_id,
"MsgId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "MsgId"),
config,
collector,
);
helpers::validate_pattern(
&self.cre_dt_tm,
"CreDtTm",
".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
&helpers::child_path(path, "CreDtTm"),
config,
collector,
);
self.nb_of_txs
.validate(&helpers::child_path(path, "NbOfTxs"), config, collector);
self.sttlm_inf
.validate(&helpers::child_path(path, "SttlmInf"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct LocalInstrument2Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for LocalInstrument2Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(35),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct MandateRelatedInformation141 {
#[serde(rename = "MndtId", skip_serializing_if = "Option::is_none")]
pub mndt_id: Option<String>,
#[serde(rename = "DtOfSgntr", skip_serializing_if = "Option::is_none")]
pub dt_of_sgntr: Option<String>,
#[serde(rename = "AmdmntInd", skip_serializing_if = "Option::is_none")]
pub amdmnt_ind: Option<bool>,
#[serde(rename = "AmdmntInfDtls", skip_serializing_if = "Option::is_none")]
pub amdmnt_inf_dtls: Option<AmendmentInformationDetails131>,
#[serde(rename = "ElctrncSgntr", skip_serializing_if = "Option::is_none")]
pub elctrnc_sgntr: Option<String>,
#[serde(rename = "FrstColltnDt", skip_serializing_if = "Option::is_none")]
pub frst_colltn_dt: Option<String>,
#[serde(rename = "FnlColltnDt", skip_serializing_if = "Option::is_none")]
pub fnl_colltn_dt: Option<String>,
#[serde(rename = "Frqcy", skip_serializing_if = "Option::is_none")]
pub frqcy: Option<Frequency36Choice>,
#[serde(rename = "Rsn", skip_serializing_if = "Option::is_none")]
pub rsn: Option<MandateSetupReason1Choice>,
#[serde(rename = "TrckgDays", skip_serializing_if = "Option::is_none")]
pub trckg_days: Option<String>,
}
impl Validate for MandateRelatedInformation141 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.mndt_id {
helpers::validate_length(
val,
"MndtId",
Some(1),
Some(35),
&helpers::child_path(path, "MndtId"),
config,
collector,
);
}
if let Some(ref val) = self.amdmnt_inf_dtls
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "AmdmntInfDtls"),
config,
collector,
);
}
if let Some(ref val) = self.elctrnc_sgntr {
helpers::validate_length(
val,
"ElctrncSgntr",
Some(1),
Some(1025),
&helpers::child_path(path, "ElctrncSgntr"),
config,
collector,
);
}
if let Some(ref val) = self.frqcy
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Frqcy"), config, collector);
}
if let Some(ref val) = self.rsn
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Rsn"), config, collector);
}
if let Some(ref val) = self.trckg_days {
helpers::validate_pattern(
val,
"TrckgDays",
"[0-9]{2}",
&helpers::child_path(path, "TrckgDays"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct MandateSetupReason1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for MandateSetupReason1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(70),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum Max15NumericTextfixed {
#[default]
#[serde(rename = "1")]
Code1,
}
impl Validate for Max15NumericTextfixed {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentification29 {
#[serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none")]
pub any_bic: Option<String>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericOrganisationIdentification1>>,
}
impl Validate for OrganisationIdentification29 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.any_bic {
helpers::validate_pattern(
val,
"AnyBIC",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "AnyBIC"),
config,
collector,
);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentification291 {
#[serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none")]
pub any_bic: Option<String>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericOrganisationIdentification11>>,
}
impl Validate for OrganisationIdentification291 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.any_bic {
helpers::validate_pattern(
val,
"AnyBIC",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "AnyBIC"),
config,
collector,
);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentification292 {
#[serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none")]
pub any_bic: Option<String>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericOrganisationIdentification12>>,
}
impl Validate for OrganisationIdentification292 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.any_bic {
helpers::validate_pattern(
val,
"AnyBIC",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "AnyBIC"),
config,
collector,
);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentification293 {
#[serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none")]
pub any_bic: Option<String>,
#[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
pub lei: Option<String>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericOrganisationIdentification13>>,
}
impl Validate for OrganisationIdentification293 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.any_bic {
helpers::validate_pattern(
val,
"AnyBIC",
"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
&helpers::child_path(path, "AnyBIC"),
config,
collector,
);
}
if let Some(ref val) = self.lei {
helpers::validate_pattern(
val,
"LEI",
"[A-Z0-9]{18,18}[0-9]{2,2}",
&helpers::child_path(path, "LEI"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentificationSchemeName1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for OrganisationIdentificationSchemeName1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentificationSchemeName1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for OrganisationIdentificationSchemeName1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentificationSchemeName1Choice2 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
}
impl Validate for OrganisationIdentificationSchemeName1Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OrganisationIdentificationSchemeName1Choice3 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for OrganisationIdentificationSchemeName1Choice3 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OriginalGroupInformation291 {
#[serde(rename = "OrgnlMsgId")]
pub orgnl_msg_id: String,
#[serde(rename = "OrgnlMsgNmId")]
pub orgnl_msg_nm_id: String,
#[serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none")]
pub orgnl_cre_dt_tm: Option<String>,
}
impl Validate for OriginalGroupInformation291 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
helpers::validate_length(
&self.orgnl_msg_id,
"OrgnlMsgId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlMsgId"),
config,
collector,
);
helpers::validate_pattern(
&self.orgnl_msg_id,
"OrgnlMsgId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlMsgId"),
config,
collector,
);
helpers::validate_length(
&self.orgnl_msg_nm_id,
"OrgnlMsgNmId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlMsgNmId"),
config,
collector,
);
helpers::validate_pattern(
&self.orgnl_msg_nm_id,
"OrgnlMsgNmId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlMsgNmId"),
config,
collector,
);
if let Some(ref val) = self.orgnl_cre_dt_tm {
helpers::validate_pattern(
val,
"OrgnlCreDtTm",
".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
&helpers::child_path(path, "OrgnlCreDtTm"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct OriginalTransactionReference281 {
#[serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none")]
pub intr_bk_sttlm_amt: Option<CBPRAmount1>,
#[serde(rename = "Amt", skip_serializing_if = "Option::is_none")]
pub amt: Option<AmountType4Choice1>,
#[serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none")]
pub intr_bk_sttlm_dt: Option<String>,
#[serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none")]
pub reqd_colltn_dt: Option<String>,
#[serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none")]
pub reqd_exctn_dt: Option<DateAndDateTime2Choice1>,
#[serde(rename = "CdtrSchmeId", skip_serializing_if = "Option::is_none")]
pub cdtr_schme_id: Option<PartyIdentification1354>,
#[serde(rename = "SttlmInf", skip_serializing_if = "Option::is_none")]
pub sttlm_inf: Option<SettlementInstruction72>,
#[serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none")]
pub pmt_tp_inf: Option<PaymentTypeInformation271>,
#[serde(rename = "PmtMtd", skip_serializing_if = "Option::is_none")]
pub pmt_mtd: Option<PaymentMethod4Code>,
#[serde(rename = "MndtRltdInf", skip_serializing_if = "Option::is_none")]
pub mndt_rltd_inf: Option<MandateRelatedInformation141>,
#[serde(rename = "RmtInf", skip_serializing_if = "Option::is_none")]
pub rmt_inf: Option<RemittanceInformation161>,
#[serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none")]
pub ultmt_dbtr: Option<Party40Choice1>,
#[serde(rename = "Dbtr", skip_serializing_if = "Option::is_none")]
pub dbtr: Option<Party40Choice4>,
#[serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none")]
pub dbtr_acct: Option<CashAccount381>,
#[serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none")]
pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification67>,
#[serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none")]
pub dbtr_agt_acct: Option<CashAccount381>,
#[serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none")]
pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification63>,
#[serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none")]
pub cdtr_agt_acct: Option<CashAccount381>,
#[serde(rename = "Cdtr", skip_serializing_if = "Option::is_none")]
pub cdtr: Option<Party40Choice5>,
#[serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none")]
pub cdtr_acct: Option<CashAccount381>,
#[serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none")]
pub ultmt_cdtr: Option<Party40Choice1>,
#[serde(rename = "Purp", skip_serializing_if = "Option::is_none")]
pub purp: Option<Purpose2Choice1>,
}
impl Validate for OriginalTransactionReference281 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.intr_bk_sttlm_amt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "IntrBkSttlmAmt"),
config,
collector,
);
}
if let Some(ref val) = self.amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Amt"), config, collector);
}
if let Some(ref val) = self.reqd_exctn_dt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ReqdExctnDt"), config, collector);
}
if let Some(ref val) = self.cdtr_schme_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrSchmeId"), config, collector);
}
if let Some(ref val) = self.sttlm_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SttlmInf"), config, collector);
}
if let Some(ref val) = self.pmt_tp_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PmtTpInf"), config, collector);
}
if let Some(ref val) = self.pmt_mtd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PmtMtd"), config, collector);
}
if let Some(ref val) = self.mndt_rltd_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "MndtRltdInf"), config, collector);
}
if let Some(ref val) = self.rmt_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "RmtInf"), config, collector);
}
if let Some(ref val) = self.ultmt_dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "UltmtDbtr"), config, collector);
}
if let Some(ref val) = self.dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Dbtr"), config, collector);
}
if let Some(ref val) = self.dbtr_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DbtrAcct"), config, collector);
}
if let Some(ref val) = self.dbtr_agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DbtrAgt"), config, collector);
}
if let Some(ref val) = self.dbtr_agt_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DbtrAgtAcct"), config, collector);
}
if let Some(ref val) = self.cdtr_agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrAgt"), config, collector);
}
if let Some(ref val) = self.cdtr_agt_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrAgtAcct"), config, collector);
}
if let Some(ref val) = self.cdtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Cdtr"), config, collector);
}
if let Some(ref val) = self.cdtr_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrAcct"), config, collector);
}
if let Some(ref val) = self.ultmt_cdtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "UltmtCdtr"), config, collector);
}
if let Some(ref val) = self.purp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Purp"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party38Choice {
#[serde(rename = "OrgId", skip_serializing_if = "Option::is_none")]
pub org_id: Option<OrganisationIdentification29>,
#[serde(rename = "PrvtId", skip_serializing_if = "Option::is_none")]
pub prvt_id: Option<PersonIdentification13>,
}
impl Validate for Party38Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.org_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgId"), config, collector);
}
if let Some(ref val) = self.prvt_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PrvtId"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party38Choice1 {
#[serde(rename = "OrgId", skip_serializing_if = "Option::is_none")]
pub org_id: Option<OrganisationIdentification291>,
#[serde(rename = "PrvtId", skip_serializing_if = "Option::is_none")]
pub prvt_id: Option<PersonIdentification131>,
}
impl Validate for Party38Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.org_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgId"), config, collector);
}
if let Some(ref val) = self.prvt_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PrvtId"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party38Choice2 {
#[serde(rename = "OrgId", skip_serializing_if = "Option::is_none")]
pub org_id: Option<OrganisationIdentification292>,
#[serde(rename = "PrvtId", skip_serializing_if = "Option::is_none")]
pub prvt_id: Option<PersonIdentification132>,
}
impl Validate for Party38Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.org_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgId"), config, collector);
}
if let Some(ref val) = self.prvt_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PrvtId"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party38Choice3 {
#[serde(rename = "OrgId", skip_serializing_if = "Option::is_none")]
pub org_id: Option<OrganisationIdentification293>,
#[serde(rename = "PrvtId", skip_serializing_if = "Option::is_none")]
pub prvt_id: Option<PersonIdentification133>,
}
impl Validate for Party38Choice3 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.org_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgId"), config, collector);
}
if let Some(ref val) = self.prvt_id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PrvtId"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party40Choice1 {
#[serde(rename = "Pty", skip_serializing_if = "Option::is_none")]
pub pty: Option<PartyIdentification1351>,
}
impl Validate for Party40Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Pty"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party40Choice2 {
#[serde(rename = "Pty", skip_serializing_if = "Option::is_none")]
pub pty: Option<PartyIdentification1352>,
#[serde(rename = "Agt", skip_serializing_if = "Option::is_none")]
pub agt: Option<BranchAndFinancialInstitutionIdentification61>,
}
impl Validate for Party40Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Pty"), config, collector);
}
if let Some(ref val) = self.agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Agt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party40Choice3 {
#[serde(rename = "Pty", skip_serializing_if = "Option::is_none")]
pub pty: Option<PartyIdentification1353>,
#[serde(rename = "Agt", skip_serializing_if = "Option::is_none")]
pub agt: Option<BranchAndFinancialInstitutionIdentification61>,
}
impl Validate for Party40Choice3 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Pty"), config, collector);
}
if let Some(ref val) = self.agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Agt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party40Choice4 {
#[serde(rename = "Pty", skip_serializing_if = "Option::is_none")]
pub pty: Option<PartyIdentification1352>,
#[serde(rename = "Agt", skip_serializing_if = "Option::is_none")]
pub agt: Option<BranchAndFinancialInstitutionIdentification66>,
}
impl Validate for Party40Choice4 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Pty"), config, collector);
}
if let Some(ref val) = self.agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Agt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Party40Choice5 {
#[serde(rename = "Pty", skip_serializing_if = "Option::is_none")]
pub pty: Option<PartyIdentification1353>,
#[serde(rename = "Agt", skip_serializing_if = "Option::is_none")]
pub agt: Option<BranchAndFinancialInstitutionIdentification68>,
}
impl Validate for Party40Choice5 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Pty"), config, collector);
}
if let Some(ref val) = self.agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Agt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PartyIdentification1351 {
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress242>,
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<Party38Choice1>,
#[serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none")]
pub ctry_of_res: Option<String>,
}
impl Validate for PartyIdentification1351 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.ctry_of_res {
helpers::validate_pattern(
val,
"CtryOfRes",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfRes"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PartyIdentification1352 {
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<Party38Choice2>,
#[serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none")]
pub ctry_of_res: Option<String>,
}
impl Validate for PartyIdentification1352 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.ctry_of_res {
helpers::validate_pattern(
val,
"CtryOfRes",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfRes"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PartyIdentification1353 {
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress241>,
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<Party38Choice1>,
#[serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none")]
pub ctry_of_res: Option<String>,
}
impl Validate for PartyIdentification1353 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.ctry_of_res {
helpers::validate_pattern(
val,
"CtryOfRes",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfRes"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PartyIdentification1354 {
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress243>,
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<Party38Choice>,
#[serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none")]
pub ctry_of_res: Option<String>,
}
impl Validate for PartyIdentification1354 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.ctry_of_res {
helpers::validate_pattern(
val,
"CtryOfRes",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfRes"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PartyIdentification1355 {
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
#[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
pub pstl_adr: Option<PostalAddress242>,
#[serde(rename = "Id", skip_serializing_if = "Option::is_none")]
pub id: Option<Party38Choice3>,
#[serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none")]
pub ctry_of_res: Option<String>,
}
impl Validate for PartyIdentification1355 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.pstl_adr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
}
if let Some(ref val) = self.id
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Id"), config, collector);
}
if let Some(ref val) = self.ctry_of_res {
helpers::validate_pattern(
val,
"CtryOfRes",
"[A-Z]{2,2}",
&helpers::child_path(path, "CtryOfRes"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum PaymentMethod4Code {
#[default]
#[serde(rename = "CHK")]
CodeCHK,
#[serde(rename = "TRF")]
CodeTRF,
#[serde(rename = "DD")]
CodeDD,
#[serde(rename = "TRA")]
CodeTRA,
}
impl Validate for PaymentMethod4Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PaymentReturnReason61 {
#[serde(rename = "Orgtr", skip_serializing_if = "Option::is_none")]
pub orgtr: Option<PartyIdentification1353>,
#[serde(rename = "Rsn")]
pub rsn: ReturnReason5Choice1,
#[serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none")]
pub addtl_inf: Option<Vec<String>>,
}
impl Validate for PaymentReturnReason61 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.orgtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Orgtr"), config, collector);
}
self.rsn
.validate(&helpers::child_path(path, "Rsn"), config, collector);
if let Some(ref vec) = self.addtl_inf {
for item in vec {
helpers::validate_length(
item,
"AddtlInf",
Some(1),
Some(105),
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
}
if let Some(ref vec) = self.addtl_inf {
for item in vec {
helpers::validate_pattern(
item,
"AddtlInf",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PaymentReturnV09 {
#[serde(rename = "GrpHdr")]
pub grp_hdr: GroupHeader901,
#[serde(rename = "TxInf")]
pub tx_inf: PaymentTransaction1121,
}
impl Validate for PaymentReturnV09 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.grp_hdr
.validate(&helpers::child_path(path, "GrpHdr"), config, collector);
self.tx_inf
.validate(&helpers::child_path(path, "TxInf"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PaymentTransaction1121 {
#[serde(rename = "RtrId", skip_serializing_if = "Option::is_none")]
pub rtr_id: Option<String>,
#[serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none")]
pub orgnl_grp_inf: Option<OriginalGroupInformation291>,
#[serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none")]
pub orgnl_instr_id: Option<String>,
#[serde(rename = "OrgnlEndToEndId")]
pub orgnl_end_to_end_id: String,
#[serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none")]
pub orgnl_tx_id: Option<String>,
#[serde(rename = "OrgnlUETR")]
pub orgnl_uetr: String,
#[serde(rename = "OrgnlClrSysRef", skip_serializing_if = "Option::is_none")]
pub orgnl_clr_sys_ref: Option<String>,
#[serde(
rename = "OrgnlIntrBkSttlmAmt",
skip_serializing_if = "Option::is_none"
)]
pub orgnl_intr_bk_sttlm_amt: Option<CBPRAmount1>,
#[serde(rename = "OrgnlIntrBkSttlmDt", skip_serializing_if = "Option::is_none")]
pub orgnl_intr_bk_sttlm_dt: Option<String>,
#[serde(rename = "RtrdIntrBkSttlmAmt")]
pub rtrd_intr_bk_sttlm_amt: CBPRAmount1,
#[serde(rename = "IntrBkSttlmDt")]
pub intr_bk_sttlm_dt: String,
#[serde(rename = "SttlmPrty", skip_serializing_if = "Option::is_none")]
pub sttlm_prty: Option<Priority3Code>,
#[serde(rename = "SttlmTmIndctn", skip_serializing_if = "Option::is_none")]
pub sttlm_tm_indctn: Option<SettlementDateTimeIndication11>,
#[serde(rename = "RtrdInstdAmt", skip_serializing_if = "Option::is_none")]
pub rtrd_instd_amt: Option<CBPRAmount1>,
#[serde(rename = "XchgRate", skip_serializing_if = "Option::is_none")]
pub xchg_rate: Option<f64>,
#[serde(rename = "ChrgBr")]
pub chrg_br: ChargeBearerType1Code1,
#[serde(rename = "ChrgsInf", skip_serializing_if = "Option::is_none")]
pub chrgs_inf: Option<Vec<Charges71>>,
#[serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none")]
pub clr_sys_ref: Option<String>,
#[serde(rename = "InstgAgt")]
pub instg_agt: BranchAndFinancialInstitutionIdentification62,
#[serde(rename = "InstdAgt")]
pub instd_agt: BranchAndFinancialInstitutionIdentification62,
#[serde(rename = "RtrChain")]
pub rtr_chain: TransactionParties71,
#[serde(rename = "RtrRsnInf")]
pub rtr_rsn_inf: PaymentReturnReason61,
#[serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none")]
pub orgnl_tx_ref: Option<OriginalTransactionReference281>,
}
impl Validate for PaymentTransaction1121 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.rtr_id {
helpers::validate_length(
val,
"RtrId",
Some(1),
Some(35),
&helpers::child_path(path, "RtrId"),
config,
collector,
);
}
if let Some(ref val) = self.rtr_id {
helpers::validate_pattern(
val,
"RtrId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "RtrId"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_grp_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgnlGrpInf"), config, collector);
}
if let Some(ref val) = self.orgnl_instr_id {
helpers::validate_length(
val,
"OrgnlInstrId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlInstrId"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_instr_id {
helpers::validate_pattern(
val,
"OrgnlInstrId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlInstrId"),
config,
collector,
);
}
helpers::validate_length(
&self.orgnl_end_to_end_id,
"OrgnlEndToEndId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlEndToEndId"),
config,
collector,
);
helpers::validate_pattern(
&self.orgnl_end_to_end_id,
"OrgnlEndToEndId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlEndToEndId"),
config,
collector,
);
if let Some(ref val) = self.orgnl_tx_id {
helpers::validate_length(
val,
"OrgnlTxId",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlTxId"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_tx_id {
helpers::validate_pattern(
val,
"OrgnlTxId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlTxId"),
config,
collector,
);
}
helpers::validate_pattern(
&self.orgnl_uetr,
"OrgnlUETR",
"[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}",
&helpers::child_path(path, "OrgnlUETR"),
config,
collector,
);
if let Some(ref val) = self.orgnl_clr_sys_ref {
helpers::validate_length(
val,
"OrgnlClrSysRef",
Some(1),
Some(35),
&helpers::child_path(path, "OrgnlClrSysRef"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_clr_sys_ref {
helpers::validate_pattern(
val,
"OrgnlClrSysRef",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "OrgnlClrSysRef"),
config,
collector,
);
}
if let Some(ref val) = self.orgnl_intr_bk_sttlm_amt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "OrgnlIntrBkSttlmAmt"),
config,
collector,
);
}
self.rtrd_intr_bk_sttlm_amt.validate(
&helpers::child_path(path, "RtrdIntrBkSttlmAmt"),
config,
collector,
);
if let Some(ref val) = self.sttlm_prty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SttlmPrty"), config, collector);
}
if let Some(ref val) = self.sttlm_tm_indctn
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "SttlmTmIndctn"),
config,
collector,
);
}
if let Some(ref val) = self.rtrd_instd_amt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "RtrdInstdAmt"),
config,
collector,
);
}
self.chrg_br
.validate(&helpers::child_path(path, "ChrgBr"), config, collector);
if let Some(ref vec) = self.chrgs_inf
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "ChrgsInf"), config, collector);
}
}
if let Some(ref val) = self.clr_sys_ref {
helpers::validate_length(
val,
"ClrSysRef",
Some(1),
Some(35),
&helpers::child_path(path, "ClrSysRef"),
config,
collector,
);
}
if let Some(ref val) = self.clr_sys_ref {
helpers::validate_pattern(
val,
"ClrSysRef",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "ClrSysRef"),
config,
collector,
);
}
self.instg_agt
.validate(&helpers::child_path(path, "InstgAgt"), config, collector);
self.instd_agt
.validate(&helpers::child_path(path, "InstdAgt"), config, collector);
self.rtr_chain
.validate(&helpers::child_path(path, "RtrChain"), config, collector);
self.rtr_rsn_inf
.validate(&helpers::child_path(path, "RtrRsnInf"), config, collector);
if let Some(ref val) = self.orgnl_tx_ref
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "OrgnlTxRef"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PaymentTypeInformation271 {
#[serde(rename = "InstrPrty", skip_serializing_if = "Option::is_none")]
pub instr_prty: Option<Priority2Code>,
#[serde(rename = "ClrChanl", skip_serializing_if = "Option::is_none")]
pub clr_chanl: Option<ClearingChannel2Code>,
#[serde(rename = "SvcLvl", skip_serializing_if = "Option::is_none")]
pub svc_lvl: Option<Vec<ServiceLevel8Choice1>>,
#[serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none")]
pub lcl_instrm: Option<LocalInstrument2Choice1>,
#[serde(rename = "SeqTp", skip_serializing_if = "Option::is_none")]
pub seq_tp: Option<SequenceType3Code>,
#[serde(rename = "CtgyPurp", skip_serializing_if = "Option::is_none")]
pub ctgy_purp: Option<CategoryPurpose1Choice1>,
}
impl Validate for PaymentTypeInformation271 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.instr_prty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "InstrPrty"), config, collector);
}
if let Some(ref val) = self.clr_chanl
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "ClrChanl"), config, collector);
}
if let Some(ref vec) = self.svc_lvl
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "SvcLvl"), config, collector);
}
}
if let Some(ref val) = self.lcl_instrm
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "LclInstrm"), config, collector);
}
if let Some(ref val) = self.seq_tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SeqTp"), config, collector);
}
if let Some(ref val) = self.ctgy_purp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CtgyPurp"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentification13 {
#[serde(rename = "DtAndPlcOfBirth", skip_serializing_if = "Option::is_none")]
pub dt_and_plc_of_birth: Option<DateAndPlaceOfBirth1>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericPersonIdentification1>>,
}
impl Validate for PersonIdentification13 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dt_and_plc_of_birth
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "DtAndPlcOfBirth"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentification131 {
#[serde(rename = "DtAndPlcOfBirth", skip_serializing_if = "Option::is_none")]
pub dt_and_plc_of_birth: Option<DateAndPlaceOfBirth11>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericPersonIdentification11>>,
}
impl Validate for PersonIdentification131 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dt_and_plc_of_birth
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "DtAndPlcOfBirth"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentification132 {
#[serde(rename = "DtAndPlcOfBirth", skip_serializing_if = "Option::is_none")]
pub dt_and_plc_of_birth: Option<DateAndPlaceOfBirth11>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericPersonIdentification12>>,
}
impl Validate for PersonIdentification132 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dt_and_plc_of_birth
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "DtAndPlcOfBirth"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentification133 {
#[serde(rename = "DtAndPlcOfBirth", skip_serializing_if = "Option::is_none")]
pub dt_and_plc_of_birth: Option<DateAndPlaceOfBirth11>,
#[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
pub othr: Option<Vec<GenericPersonIdentification13>>,
}
impl Validate for PersonIdentification133 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dt_and_plc_of_birth
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "DtAndPlcOfBirth"),
config,
collector,
);
}
if let Some(ref vec) = self.othr
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Othr"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentificationSchemeName1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for PersonIdentificationSchemeName1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentificationSchemeName1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for PersonIdentificationSchemeName1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentificationSchemeName1Choice2 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
}
impl Validate for PersonIdentificationSchemeName1Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PersonIdentificationSchemeName1Choice3 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for PersonIdentificationSchemeName1Choice3 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PostalAddress241 {
#[serde(rename = "Dept", skip_serializing_if = "Option::is_none")]
pub dept: Option<String>,
#[serde(rename = "SubDept", skip_serializing_if = "Option::is_none")]
pub sub_dept: Option<String>,
#[serde(rename = "StrtNm", skip_serializing_if = "Option::is_none")]
pub strt_nm: Option<String>,
#[serde(rename = "BldgNb", skip_serializing_if = "Option::is_none")]
pub bldg_nb: Option<String>,
#[serde(rename = "BldgNm", skip_serializing_if = "Option::is_none")]
pub bldg_nm: Option<String>,
#[serde(rename = "Flr", skip_serializing_if = "Option::is_none")]
pub flr: Option<String>,
#[serde(rename = "PstBx", skip_serializing_if = "Option::is_none")]
pub pst_bx: Option<String>,
#[serde(rename = "Room", skip_serializing_if = "Option::is_none")]
pub room: Option<String>,
#[serde(rename = "PstCd", skip_serializing_if = "Option::is_none")]
pub pst_cd: Option<String>,
#[serde(rename = "TwnNm", skip_serializing_if = "Option::is_none")]
pub twn_nm: Option<String>,
#[serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none")]
pub twn_lctn_nm: Option<String>,
#[serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none")]
pub dstrct_nm: Option<String>,
#[serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none")]
pub ctry_sub_dvsn: Option<String>,
#[serde(rename = "Ctry", skip_serializing_if = "Option::is_none")]
pub ctry: Option<String>,
#[serde(rename = "AdrLine", skip_serializing_if = "Option::is_none")]
pub adr_line: Option<Vec<String>>,
}
impl Validate for PostalAddress241 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dept {
helpers::validate_length(
val,
"Dept",
Some(1),
Some(70),
&helpers::child_path(path, "Dept"),
config,
collector,
);
}
if let Some(ref val) = self.dept {
helpers::validate_pattern(
val,
"Dept",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Dept"),
config,
collector,
);
}
if let Some(ref val) = self.sub_dept {
helpers::validate_length(
val,
"SubDept",
Some(1),
Some(70),
&helpers::child_path(path, "SubDept"),
config,
collector,
);
}
if let Some(ref val) = self.sub_dept {
helpers::validate_pattern(
val,
"SubDept",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "SubDept"),
config,
collector,
);
}
if let Some(ref val) = self.strt_nm {
helpers::validate_length(
val,
"StrtNm",
Some(1),
Some(70),
&helpers::child_path(path, "StrtNm"),
config,
collector,
);
}
if let Some(ref val) = self.strt_nm {
helpers::validate_pattern(
val,
"StrtNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "StrtNm"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nb {
helpers::validate_length(
val,
"BldgNb",
Some(1),
Some(16),
&helpers::child_path(path, "BldgNb"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nb {
helpers::validate_pattern(
val,
"BldgNb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "BldgNb"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nm {
helpers::validate_length(
val,
"BldgNm",
Some(1),
Some(35),
&helpers::child_path(path, "BldgNm"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nm {
helpers::validate_pattern(
val,
"BldgNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "BldgNm"),
config,
collector,
);
}
if let Some(ref val) = self.flr {
helpers::validate_length(
val,
"Flr",
Some(1),
Some(70),
&helpers::child_path(path, "Flr"),
config,
collector,
);
}
if let Some(ref val) = self.flr {
helpers::validate_pattern(
val,
"Flr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Flr"),
config,
collector,
);
}
if let Some(ref val) = self.pst_bx {
helpers::validate_length(
val,
"PstBx",
Some(1),
Some(16),
&helpers::child_path(path, "PstBx"),
config,
collector,
);
}
if let Some(ref val) = self.pst_bx {
helpers::validate_pattern(
val,
"PstBx",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "PstBx"),
config,
collector,
);
}
if let Some(ref val) = self.room {
helpers::validate_length(
val,
"Room",
Some(1),
Some(70),
&helpers::child_path(path, "Room"),
config,
collector,
);
}
if let Some(ref val) = self.room {
helpers::validate_pattern(
val,
"Room",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Room"),
config,
collector,
);
}
if let Some(ref val) = self.pst_cd {
helpers::validate_length(
val,
"PstCd",
Some(1),
Some(16),
&helpers::child_path(path, "PstCd"),
config,
collector,
);
}
if let Some(ref val) = self.pst_cd {
helpers::validate_pattern(
val,
"PstCd",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "PstCd"),
config,
collector,
);
}
if let Some(ref val) = self.twn_nm {
helpers::validate_length(
val,
"TwnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnNm"),
config,
collector,
);
}
if let Some(ref val) = self.twn_nm {
helpers::validate_pattern(
val,
"TwnNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TwnNm"),
config,
collector,
);
}
if let Some(ref val) = self.twn_lctn_nm {
helpers::validate_length(
val,
"TwnLctnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnLctnNm"),
config,
collector,
);
}
if let Some(ref val) = self.twn_lctn_nm {
helpers::validate_pattern(
val,
"TwnLctnNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TwnLctnNm"),
config,
collector,
);
}
if let Some(ref val) = self.dstrct_nm {
helpers::validate_length(
val,
"DstrctNm",
Some(1),
Some(35),
&helpers::child_path(path, "DstrctNm"),
config,
collector,
);
}
if let Some(ref val) = self.dstrct_nm {
helpers::validate_pattern(
val,
"DstrctNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "DstrctNm"),
config,
collector,
);
}
if let Some(ref val) = self.ctry_sub_dvsn {
helpers::validate_length(
val,
"CtrySubDvsn",
Some(1),
Some(35),
&helpers::child_path(path, "CtrySubDvsn"),
config,
collector,
);
}
if let Some(ref val) = self.ctry_sub_dvsn {
helpers::validate_pattern(
val,
"CtrySubDvsn",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "CtrySubDvsn"),
config,
collector,
);
}
if let Some(ref val) = self.ctry {
helpers::validate_pattern(
val,
"Ctry",
"[A-Z]{2,2}",
&helpers::child_path(path, "Ctry"),
config,
collector,
);
}
if let Some(ref vec) = self.adr_line {
for item in vec {
helpers::validate_length(
item,
"AdrLine",
Some(1),
Some(70),
&helpers::child_path(path, "AdrLine"),
config,
collector,
);
}
}
if let Some(ref vec) = self.adr_line {
for item in vec {
helpers::validate_pattern(
item,
"AdrLine",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AdrLine"),
config,
collector,
);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PostalAddress242 {
#[serde(rename = "Dept", skip_serializing_if = "Option::is_none")]
pub dept: Option<String>,
#[serde(rename = "SubDept", skip_serializing_if = "Option::is_none")]
pub sub_dept: Option<String>,
#[serde(rename = "StrtNm", skip_serializing_if = "Option::is_none")]
pub strt_nm: Option<String>,
#[serde(rename = "BldgNb", skip_serializing_if = "Option::is_none")]
pub bldg_nb: Option<String>,
#[serde(rename = "BldgNm", skip_serializing_if = "Option::is_none")]
pub bldg_nm: Option<String>,
#[serde(rename = "Flr", skip_serializing_if = "Option::is_none")]
pub flr: Option<String>,
#[serde(rename = "PstBx", skip_serializing_if = "Option::is_none")]
pub pst_bx: Option<String>,
#[serde(rename = "Room", skip_serializing_if = "Option::is_none")]
pub room: Option<String>,
#[serde(rename = "PstCd", skip_serializing_if = "Option::is_none")]
pub pst_cd: Option<String>,
#[serde(rename = "TwnNm")]
pub twn_nm: String,
#[serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none")]
pub twn_lctn_nm: Option<String>,
#[serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none")]
pub dstrct_nm: Option<String>,
#[serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none")]
pub ctry_sub_dvsn: Option<String>,
#[serde(rename = "Ctry")]
pub ctry: String,
#[serde(rename = "AdrLine", skip_serializing_if = "Option::is_none")]
pub adr_line: Option<Vec<String>>,
}
impl Validate for PostalAddress242 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dept {
helpers::validate_length(
val,
"Dept",
Some(1),
Some(70),
&helpers::child_path(path, "Dept"),
config,
collector,
);
}
if let Some(ref val) = self.dept {
helpers::validate_pattern(
val,
"Dept",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Dept"),
config,
collector,
);
}
if let Some(ref val) = self.sub_dept {
helpers::validate_length(
val,
"SubDept",
Some(1),
Some(70),
&helpers::child_path(path, "SubDept"),
config,
collector,
);
}
if let Some(ref val) = self.sub_dept {
helpers::validate_pattern(
val,
"SubDept",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "SubDept"),
config,
collector,
);
}
if let Some(ref val) = self.strt_nm {
helpers::validate_length(
val,
"StrtNm",
Some(1),
Some(70),
&helpers::child_path(path, "StrtNm"),
config,
collector,
);
}
if let Some(ref val) = self.strt_nm {
helpers::validate_pattern(
val,
"StrtNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "StrtNm"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nb {
helpers::validate_length(
val,
"BldgNb",
Some(1),
Some(16),
&helpers::child_path(path, "BldgNb"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nb {
helpers::validate_pattern(
val,
"BldgNb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "BldgNb"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nm {
helpers::validate_length(
val,
"BldgNm",
Some(1),
Some(35),
&helpers::child_path(path, "BldgNm"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nm {
helpers::validate_pattern(
val,
"BldgNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "BldgNm"),
config,
collector,
);
}
if let Some(ref val) = self.flr {
helpers::validate_length(
val,
"Flr",
Some(1),
Some(70),
&helpers::child_path(path, "Flr"),
config,
collector,
);
}
if let Some(ref val) = self.flr {
helpers::validate_pattern(
val,
"Flr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Flr"),
config,
collector,
);
}
if let Some(ref val) = self.pst_bx {
helpers::validate_length(
val,
"PstBx",
Some(1),
Some(16),
&helpers::child_path(path, "PstBx"),
config,
collector,
);
}
if let Some(ref val) = self.pst_bx {
helpers::validate_pattern(
val,
"PstBx",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "PstBx"),
config,
collector,
);
}
if let Some(ref val) = self.room {
helpers::validate_length(
val,
"Room",
Some(1),
Some(70),
&helpers::child_path(path, "Room"),
config,
collector,
);
}
if let Some(ref val) = self.room {
helpers::validate_pattern(
val,
"Room",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Room"),
config,
collector,
);
}
if let Some(ref val) = self.pst_cd {
helpers::validate_length(
val,
"PstCd",
Some(1),
Some(16),
&helpers::child_path(path, "PstCd"),
config,
collector,
);
}
if let Some(ref val) = self.pst_cd {
helpers::validate_pattern(
val,
"PstCd",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "PstCd"),
config,
collector,
);
}
helpers::validate_length(
&self.twn_nm,
"TwnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnNm"),
config,
collector,
);
helpers::validate_pattern(
&self.twn_nm,
"TwnNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TwnNm"),
config,
collector,
);
if let Some(ref val) = self.twn_lctn_nm {
helpers::validate_length(
val,
"TwnLctnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnLctnNm"),
config,
collector,
);
}
if let Some(ref val) = self.twn_lctn_nm {
helpers::validate_pattern(
val,
"TwnLctnNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TwnLctnNm"),
config,
collector,
);
}
if let Some(ref val) = self.dstrct_nm {
helpers::validate_length(
val,
"DstrctNm",
Some(1),
Some(35),
&helpers::child_path(path, "DstrctNm"),
config,
collector,
);
}
if let Some(ref val) = self.dstrct_nm {
helpers::validate_pattern(
val,
"DstrctNm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "DstrctNm"),
config,
collector,
);
}
if let Some(ref val) = self.ctry_sub_dvsn {
helpers::validate_length(
val,
"CtrySubDvsn",
Some(1),
Some(35),
&helpers::child_path(path, "CtrySubDvsn"),
config,
collector,
);
}
if let Some(ref val) = self.ctry_sub_dvsn {
helpers::validate_pattern(
val,
"CtrySubDvsn",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "CtrySubDvsn"),
config,
collector,
);
}
helpers::validate_pattern(
&self.ctry,
"Ctry",
"[A-Z]{2,2}",
&helpers::child_path(path, "Ctry"),
config,
collector,
);
if let Some(ref vec) = self.adr_line {
for item in vec {
helpers::validate_length(
item,
"AdrLine",
Some(1),
Some(70),
&helpers::child_path(path, "AdrLine"),
config,
collector,
);
}
}
if let Some(ref vec) = self.adr_line {
for item in vec {
helpers::validate_pattern(
item,
"AdrLine",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AdrLine"),
config,
collector,
);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct PostalAddress243 {
#[serde(rename = "Dept", skip_serializing_if = "Option::is_none")]
pub dept: Option<String>,
#[serde(rename = "SubDept", skip_serializing_if = "Option::is_none")]
pub sub_dept: Option<String>,
#[serde(rename = "StrtNm", skip_serializing_if = "Option::is_none")]
pub strt_nm: Option<String>,
#[serde(rename = "BldgNb", skip_serializing_if = "Option::is_none")]
pub bldg_nb: Option<String>,
#[serde(rename = "BldgNm", skip_serializing_if = "Option::is_none")]
pub bldg_nm: Option<String>,
#[serde(rename = "Flr", skip_serializing_if = "Option::is_none")]
pub flr: Option<String>,
#[serde(rename = "PstBx", skip_serializing_if = "Option::is_none")]
pub pst_bx: Option<String>,
#[serde(rename = "Room", skip_serializing_if = "Option::is_none")]
pub room: Option<String>,
#[serde(rename = "PstCd", skip_serializing_if = "Option::is_none")]
pub pst_cd: Option<String>,
#[serde(rename = "TwnNm", skip_serializing_if = "Option::is_none")]
pub twn_nm: Option<String>,
#[serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none")]
pub twn_lctn_nm: Option<String>,
#[serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none")]
pub dstrct_nm: Option<String>,
#[serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none")]
pub ctry_sub_dvsn: Option<String>,
#[serde(rename = "Ctry", skip_serializing_if = "Option::is_none")]
pub ctry: Option<String>,
#[serde(rename = "AdrLine", skip_serializing_if = "Option::is_none")]
pub adr_line: Option<Vec<String>>,
}
impl Validate for PostalAddress243 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dept {
helpers::validate_length(
val,
"Dept",
Some(1),
Some(70),
&helpers::child_path(path, "Dept"),
config,
collector,
);
}
if let Some(ref val) = self.sub_dept {
helpers::validate_length(
val,
"SubDept",
Some(1),
Some(70),
&helpers::child_path(path, "SubDept"),
config,
collector,
);
}
if let Some(ref val) = self.strt_nm {
helpers::validate_length(
val,
"StrtNm",
Some(1),
Some(70),
&helpers::child_path(path, "StrtNm"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nb {
helpers::validate_length(
val,
"BldgNb",
Some(1),
Some(16),
&helpers::child_path(path, "BldgNb"),
config,
collector,
);
}
if let Some(ref val) = self.bldg_nm {
helpers::validate_length(
val,
"BldgNm",
Some(1),
Some(35),
&helpers::child_path(path, "BldgNm"),
config,
collector,
);
}
if let Some(ref val) = self.flr {
helpers::validate_length(
val,
"Flr",
Some(1),
Some(70),
&helpers::child_path(path, "Flr"),
config,
collector,
);
}
if let Some(ref val) = self.pst_bx {
helpers::validate_length(
val,
"PstBx",
Some(1),
Some(16),
&helpers::child_path(path, "PstBx"),
config,
collector,
);
}
if let Some(ref val) = self.room {
helpers::validate_length(
val,
"Room",
Some(1),
Some(70),
&helpers::child_path(path, "Room"),
config,
collector,
);
}
if let Some(ref val) = self.pst_cd {
helpers::validate_length(
val,
"PstCd",
Some(1),
Some(16),
&helpers::child_path(path, "PstCd"),
config,
collector,
);
}
if let Some(ref val) = self.twn_nm {
helpers::validate_length(
val,
"TwnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnNm"),
config,
collector,
);
}
if let Some(ref val) = self.twn_lctn_nm {
helpers::validate_length(
val,
"TwnLctnNm",
Some(1),
Some(35),
&helpers::child_path(path, "TwnLctnNm"),
config,
collector,
);
}
if let Some(ref val) = self.dstrct_nm {
helpers::validate_length(
val,
"DstrctNm",
Some(1),
Some(35),
&helpers::child_path(path, "DstrctNm"),
config,
collector,
);
}
if let Some(ref val) = self.ctry_sub_dvsn {
helpers::validate_length(
val,
"CtrySubDvsn",
Some(1),
Some(35),
&helpers::child_path(path, "CtrySubDvsn"),
config,
collector,
);
}
if let Some(ref val) = self.ctry {
helpers::validate_pattern(
val,
"Ctry",
"[A-Z]{2,2}",
&helpers::child_path(path, "Ctry"),
config,
collector,
);
}
if let Some(ref vec) = self.adr_line {
for item in vec {
helpers::validate_length(
item,
"AdrLine",
Some(1),
Some(70),
&helpers::child_path(path, "AdrLine"),
config,
collector,
);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum Priority2Code {
#[default]
#[serde(rename = "HIGH")]
CodeHIGH,
#[serde(rename = "NORM")]
CodeNORM,
}
impl Validate for Priority2Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum Priority3Code {
#[default]
#[serde(rename = "URGT")]
CodeURGT,
#[serde(rename = "HIGH")]
CodeHIGH,
#[serde(rename = "NORM")]
CodeNORM,
}
impl Validate for Priority3Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ProxyAccountIdentification1 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<ProxyAccountType1Choice>,
#[serde(rename = "Id")]
pub id: String,
}
impl Validate for ProxyAccountIdentification1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(2048),
&helpers::child_path(path, "Id"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ProxyAccountIdentification11 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<ProxyAccountType1Choice1>,
#[serde(rename = "Id")]
pub id: String,
}
impl Validate for ProxyAccountIdentification11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
helpers::validate_length(
&self.id,
"Id",
Some(1),
Some(320),
&helpers::child_path(path, "Id"),
config,
collector,
);
helpers::validate_pattern(
&self.id,
"Id",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Id"),
config,
collector,
);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ProxyAccountType1Choice {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ProxyAccountType1Choice {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ProxyAccountType1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ProxyAccountType1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct Purpose2Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for Purpose2Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ReferredDocumentInformation71 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<ReferredDocumentType41>,
#[serde(rename = "Nb", skip_serializing_if = "Option::is_none")]
pub nb: Option<String>,
#[serde(rename = "RltdDt", skip_serializing_if = "Option::is_none")]
pub rltd_dt: Option<String>,
#[serde(rename = "LineDtls", skip_serializing_if = "Option::is_none")]
pub line_dtls: Option<Vec<DocumentLineInformation11>>,
}
impl Validate for ReferredDocumentInformation71 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.nb {
helpers::validate_length(
val,
"Nb",
Some(1),
Some(35),
&helpers::child_path(path, "Nb"),
config,
collector,
);
}
if let Some(ref val) = self.nb {
helpers::validate_pattern(
val,
"Nb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nb"),
config,
collector,
);
}
if let Some(ref vec) = self.line_dtls
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "LineDtls"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ReferredDocumentType3Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<DocumentType6Code>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ReferredDocumentType3Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Cd"), config, collector);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ReferredDocumentType41 {
#[serde(rename = "CdOrPrtry")]
pub cd_or_prtry: ReferredDocumentType3Choice1,
#[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
pub issr: Option<String>,
}
impl Validate for ReferredDocumentType41 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.cd_or_prtry
.validate(&helpers::child_path(path, "CdOrPrtry"), config, collector);
if let Some(ref val) = self.issr {
helpers::validate_length(
val,
"Issr",
Some(1),
Some(35),
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
if let Some(ref val) = self.issr {
helpers::validate_pattern(
val,
"Issr",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Issr"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct RemittanceAmount21 {
#[serde(rename = "DuePyblAmt", skip_serializing_if = "Option::is_none")]
pub due_pybl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "DscntApldAmt", skip_serializing_if = "Option::is_none")]
pub dscnt_apld_amt: Option<Vec<DiscountAmountAndType11>>,
#[serde(rename = "CdtNoteAmt", skip_serializing_if = "Option::is_none")]
pub cdt_note_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none")]
pub tax_amt: Option<Vec<TaxAmountAndType12>>,
#[serde(rename = "AdjstmntAmtAndRsn", skip_serializing_if = "Option::is_none")]
pub adjstmnt_amt_and_rsn: Option<Vec<DocumentAdjustment11>>,
#[serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none")]
pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
}
impl Validate for RemittanceAmount21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.due_pybl_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DuePyblAmt"), config, collector);
}
if let Some(ref vec) = self.dscnt_apld_amt
&& config.validate_optional_fields
{
for item in vec {
item.validate(
&helpers::child_path(path, "DscntApldAmt"),
config,
collector,
);
}
}
if let Some(ref val) = self.cdt_note_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtNoteAmt"), config, collector);
}
if let Some(ref vec) = self.tax_amt
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "TaxAmt"), config, collector);
}
}
if let Some(ref vec) = self.adjstmnt_amt_and_rsn
&& config.validate_optional_fields
{
for item in vec {
item.validate(
&helpers::child_path(path, "AdjstmntAmtAndRsn"),
config,
collector,
);
}
}
if let Some(ref val) = self.rmtd_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "RmtdAmt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct RemittanceAmount31 {
#[serde(rename = "DuePyblAmt", skip_serializing_if = "Option::is_none")]
pub due_pybl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "DscntApldAmt", skip_serializing_if = "Option::is_none")]
pub dscnt_apld_amt: Option<Vec<DiscountAmountAndType1>>,
#[serde(rename = "CdtNoteAmt", skip_serializing_if = "Option::is_none")]
pub cdt_note_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none")]
pub tax_amt: Option<Vec<TaxAmountAndType11>>,
#[serde(rename = "AdjstmntAmtAndRsn", skip_serializing_if = "Option::is_none")]
pub adjstmnt_amt_and_rsn: Option<Vec<DocumentAdjustment11>>,
#[serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none")]
pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
}
impl Validate for RemittanceAmount31 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.due_pybl_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DuePyblAmt"), config, collector);
}
if let Some(ref vec) = self.dscnt_apld_amt
&& config.validate_optional_fields
{
for item in vec {
item.validate(
&helpers::child_path(path, "DscntApldAmt"),
config,
collector,
);
}
}
if let Some(ref val) = self.cdt_note_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtNoteAmt"), config, collector);
}
if let Some(ref vec) = self.tax_amt
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "TaxAmt"), config, collector);
}
}
if let Some(ref vec) = self.adjstmnt_amt_and_rsn
&& config.validate_optional_fields
{
for item in vec {
item.validate(
&helpers::child_path(path, "AdjstmntAmtAndRsn"),
config,
collector,
);
}
}
if let Some(ref val) = self.rmtd_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "RmtdAmt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct RemittanceInformation161 {
#[serde(rename = "Ustrd", skip_serializing_if = "Option::is_none")]
pub ustrd: Option<String>,
#[serde(rename = "Strd", skip_serializing_if = "Option::is_none")]
pub strd: Option<Vec<StructuredRemittanceInformation161>>,
}
impl Validate for RemittanceInformation161 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.ustrd {
helpers::validate_length(
val,
"Ustrd",
Some(1),
Some(140),
&helpers::child_path(path, "Ustrd"),
config,
collector,
);
}
if let Some(ref val) = self.ustrd {
helpers::validate_pattern(
val,
"Ustrd",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Ustrd"),
config,
collector,
);
}
if let Some(ref vec) = self.strd
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Strd"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ReturnReason5Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
}
impl Validate for ReturnReason5Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum SequenceType3Code {
#[default]
#[serde(rename = "FRST")]
CodeFRST,
#[serde(rename = "RCUR")]
CodeRCUR,
#[serde(rename = "FNAL")]
CodeFNAL,
#[serde(rename = "OOFF")]
CodeOOFF,
#[serde(rename = "RPRE")]
CodeRPRE,
}
impl Validate for SequenceType3Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct ServiceLevel8Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for ServiceLevel8Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct SettlementDateTimeIndication11 {
#[serde(rename = "DbtDtTm", skip_serializing_if = "Option::is_none")]
pub dbt_dt_tm: Option<String>,
#[serde(rename = "CdtDtTm", skip_serializing_if = "Option::is_none")]
pub cdt_dt_tm: Option<String>,
}
impl Validate for SettlementDateTimeIndication11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.dbt_dt_tm {
helpers::validate_pattern(
val,
"DbtDtTm",
".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
&helpers::child_path(path, "DbtDtTm"),
config,
collector,
);
}
if let Some(ref val) = self.cdt_dt_tm {
helpers::validate_pattern(
val,
"CdtDtTm",
".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
&helpers::child_path(path, "CdtDtTm"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct SettlementInstruction71 {
#[serde(rename = "SttlmMtd")]
pub sttlm_mtd: SettlementMethod1Code1,
#[serde(rename = "SttlmAcct", skip_serializing_if = "Option::is_none")]
pub sttlm_acct: Option<CashAccount381>,
}
impl Validate for SettlementInstruction71 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.sttlm_mtd
.validate(&helpers::child_path(path, "SttlmMtd"), config, collector);
if let Some(ref val) = self.sttlm_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SttlmAcct"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct SettlementInstruction72 {
#[serde(rename = "SttlmMtd")]
pub sttlm_mtd: SettlementMethod1Code2,
#[serde(rename = "SttlmAcct", skip_serializing_if = "Option::is_none")]
pub sttlm_acct: Option<CashAccount382>,
#[serde(rename = "InstgRmbrsmntAgt", skip_serializing_if = "Option::is_none")]
pub instg_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(
rename = "InstgRmbrsmntAgtAcct",
skip_serializing_if = "Option::is_none"
)]
pub instg_rmbrsmnt_agt_acct: Option<CashAccount382>,
#[serde(rename = "InstdRmbrsmntAgt", skip_serializing_if = "Option::is_none")]
pub instd_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(
rename = "InstdRmbrsmntAgtAcct",
skip_serializing_if = "Option::is_none"
)]
pub instd_rmbrsmnt_agt_acct: Option<CashAccount382>,
#[serde(rename = "ThrdRmbrsmntAgt", skip_serializing_if = "Option::is_none")]
pub thrd_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(
rename = "ThrdRmbrsmntAgtAcct",
skip_serializing_if = "Option::is_none"
)]
pub thrd_rmbrsmnt_agt_acct: Option<CashAccount382>,
}
impl Validate for SettlementInstruction72 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
self.sttlm_mtd
.validate(&helpers::child_path(path, "SttlmMtd"), config, collector);
if let Some(ref val) = self.sttlm_acct
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "SttlmAcct"), config, collector);
}
if let Some(ref val) = self.instg_rmbrsmnt_agt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "InstgRmbrsmntAgt"),
config,
collector,
);
}
if let Some(ref val) = self.instg_rmbrsmnt_agt_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "InstgRmbrsmntAgtAcct"),
config,
collector,
);
}
if let Some(ref val) = self.instd_rmbrsmnt_agt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "InstdRmbrsmntAgt"),
config,
collector,
);
}
if let Some(ref val) = self.instd_rmbrsmnt_agt_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "InstdRmbrsmntAgtAcct"),
config,
collector,
);
}
if let Some(ref val) = self.thrd_rmbrsmnt_agt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "ThrdRmbrsmntAgt"),
config,
collector,
);
}
if let Some(ref val) = self.thrd_rmbrsmnt_agt_acct
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "ThrdRmbrsmntAgtAcct"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum SettlementMethod1Code1 {
#[default]
#[serde(rename = "INDA")]
CodeINDA,
#[serde(rename = "INGA")]
CodeINGA,
}
impl Validate for SettlementMethod1Code1 {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum SettlementMethod1Code2 {
#[default]
#[serde(rename = "INDA")]
CodeINDA,
#[serde(rename = "INGA")]
CodeINGA,
#[serde(rename = "COVE")]
CodeCOVE,
}
impl Validate for SettlementMethod1Code2 {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct StructuredRemittanceInformation161 {
#[serde(rename = "RfrdDocInf", skip_serializing_if = "Option::is_none")]
pub rfrd_doc_inf: Option<Vec<ReferredDocumentInformation71>>,
#[serde(rename = "RfrdDocAmt", skip_serializing_if = "Option::is_none")]
pub rfrd_doc_amt: Option<RemittanceAmount21>,
#[serde(rename = "CdtrRefInf", skip_serializing_if = "Option::is_none")]
pub cdtr_ref_inf: Option<CreditorReferenceInformation21>,
#[serde(rename = "Invcr", skip_serializing_if = "Option::is_none")]
pub invcr: Option<PartyIdentification1355>,
#[serde(rename = "Invcee", skip_serializing_if = "Option::is_none")]
pub invcee: Option<PartyIdentification1355>,
#[serde(rename = "TaxRmt", skip_serializing_if = "Option::is_none")]
pub tax_rmt: Option<TaxInformation71>,
#[serde(rename = "GrnshmtRmt", skip_serializing_if = "Option::is_none")]
pub grnshmt_rmt: Option<Garnishment31>,
#[serde(rename = "AddtlRmtInf", skip_serializing_if = "Option::is_none")]
pub addtl_rmt_inf: Option<Vec<String>>,
}
impl Validate for StructuredRemittanceInformation161 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref vec) = self.rfrd_doc_inf
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "RfrdDocInf"), config, collector);
}
}
if let Some(ref val) = self.rfrd_doc_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "RfrdDocAmt"), config, collector);
}
if let Some(ref val) = self.cdtr_ref_inf
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrRefInf"), config, collector);
}
if let Some(ref val) = self.invcr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Invcr"), config, collector);
}
if let Some(ref val) = self.invcee
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Invcee"), config, collector);
}
if let Some(ref val) = self.tax_rmt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "TaxRmt"), config, collector);
}
if let Some(ref val) = self.grnshmt_rmt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "GrnshmtRmt"), config, collector);
}
if let Some(ref vec) = self.addtl_rmt_inf {
for item in vec {
helpers::validate_length(
item,
"AddtlRmtInf",
Some(1),
Some(140),
&helpers::child_path(path, "AddtlRmtInf"),
config,
collector,
);
}
}
if let Some(ref vec) = self.addtl_rmt_inf {
for item in vec {
helpers::validate_pattern(
item,
"AddtlRmtInf",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AddtlRmtInf"),
config,
collector,
);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAmount2 {
#[serde(rename = "Rate", skip_serializing_if = "Option::is_none")]
pub rate: Option<f64>,
#[serde(rename = "TaxblBaseAmt", skip_serializing_if = "Option::is_none")]
pub taxbl_base_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "TtlAmt", skip_serializing_if = "Option::is_none")]
pub ttl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "Dtls", skip_serializing_if = "Option::is_none")]
pub dtls: Option<Vec<TaxRecordDetails2>>,
}
impl Validate for TaxAmount2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.taxbl_base_amt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "TaxblBaseAmt"),
config,
collector,
);
}
if let Some(ref val) = self.ttl_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "TtlAmt"), config, collector);
}
if let Some(ref vec) = self.dtls
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Dtls"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAmountAndType11 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<TaxAmountType1Choice1>,
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
}
impl Validate for TaxAmountAndType11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAmountAndType12 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<TaxAmountType1Choice2>,
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
}
impl Validate for TaxAmountAndType12 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAmountType1Choice1 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for TaxAmountType1Choice1 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAmountType1Choice2 {
#[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
pub cd: Option<String>,
#[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
pub prtry: Option<String>,
}
impl Validate for TaxAmountType1Choice2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cd {
helpers::validate_length(
val,
"Cd",
Some(1),
Some(4),
&helpers::child_path(path, "Cd"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_length(
val,
"Prtry",
Some(1),
Some(35),
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
if let Some(ref val) = self.prtry {
helpers::validate_pattern(
val,
"Prtry",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Prtry"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxAuthorisation11 {
#[serde(rename = "Titl", skip_serializing_if = "Option::is_none")]
pub titl: Option<String>,
#[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
pub nm: Option<String>,
}
impl Validate for TaxAuthorisation11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.titl {
helpers::validate_length(
val,
"Titl",
Some(1),
Some(35),
&helpers::child_path(path, "Titl"),
config,
collector,
);
}
if let Some(ref val) = self.titl {
helpers::validate_pattern(
val,
"Titl",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Titl"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_length(
val,
"Nm",
Some(1),
Some(140),
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
if let Some(ref val) = self.nm {
helpers::validate_pattern(
val,
"Nm",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Nm"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxInformation71 {
#[serde(rename = "Cdtr", skip_serializing_if = "Option::is_none")]
pub cdtr: Option<TaxParty11>,
#[serde(rename = "Dbtr", skip_serializing_if = "Option::is_none")]
pub dbtr: Option<TaxParty21>,
#[serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none")]
pub ultmt_dbtr: Option<TaxParty21>,
#[serde(rename = "AdmstnZone", skip_serializing_if = "Option::is_none")]
pub admstn_zone: Option<String>,
#[serde(rename = "RefNb", skip_serializing_if = "Option::is_none")]
pub ref_nb: Option<String>,
#[serde(rename = "Mtd", skip_serializing_if = "Option::is_none")]
pub mtd: Option<String>,
#[serde(rename = "TtlTaxblBaseAmt", skip_serializing_if = "Option::is_none")]
pub ttl_taxbl_base_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "TtlTaxAmt", skip_serializing_if = "Option::is_none")]
pub ttl_tax_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
#[serde(rename = "Dt", skip_serializing_if = "Option::is_none")]
pub dt: Option<String>,
#[serde(rename = "SeqNb", skip_serializing_if = "Option::is_none")]
pub seq_nb: Option<f64>,
#[serde(rename = "Rcrd", skip_serializing_if = "Option::is_none")]
pub rcrd: Option<Vec<TaxRecord21>>,
}
impl Validate for TaxInformation71 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.cdtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Cdtr"), config, collector);
}
if let Some(ref val) = self.dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Dbtr"), config, collector);
}
if let Some(ref val) = self.ultmt_dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "UltmtDbtr"), config, collector);
}
if let Some(ref val) = self.admstn_zone {
helpers::validate_length(
val,
"AdmstnZone",
Some(1),
Some(35),
&helpers::child_path(path, "AdmstnZone"),
config,
collector,
);
}
if let Some(ref val) = self.admstn_zone {
helpers::validate_pattern(
val,
"AdmstnZone",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AdmstnZone"),
config,
collector,
);
}
if let Some(ref val) = self.ref_nb {
helpers::validate_length(
val,
"RefNb",
Some(1),
Some(140),
&helpers::child_path(path, "RefNb"),
config,
collector,
);
}
if let Some(ref val) = self.ref_nb {
helpers::validate_pattern(
val,
"RefNb",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "RefNb"),
config,
collector,
);
}
if let Some(ref val) = self.mtd {
helpers::validate_length(
val,
"Mtd",
Some(1),
Some(35),
&helpers::child_path(path, "Mtd"),
config,
collector,
);
}
if let Some(ref val) = self.mtd {
helpers::validate_pattern(
val,
"Mtd",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Mtd"),
config,
collector,
);
}
if let Some(ref val) = self.ttl_taxbl_base_amt
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "TtlTaxblBaseAmt"),
config,
collector,
);
}
if let Some(ref val) = self.ttl_tax_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "TtlTaxAmt"), config, collector);
}
if let Some(ref vec) = self.rcrd
&& config.validate_optional_fields
{
for item in vec {
item.validate(&helpers::child_path(path, "Rcrd"), config, collector);
}
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxParty11 {
#[serde(rename = "TaxId", skip_serializing_if = "Option::is_none")]
pub tax_id: Option<String>,
#[serde(rename = "RegnId", skip_serializing_if = "Option::is_none")]
pub regn_id: Option<String>,
#[serde(rename = "TaxTp", skip_serializing_if = "Option::is_none")]
pub tax_tp: Option<String>,
}
impl Validate for TaxParty11 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tax_id {
helpers::validate_length(
val,
"TaxId",
Some(1),
Some(35),
&helpers::child_path(path, "TaxId"),
config,
collector,
);
}
if let Some(ref val) = self.tax_id {
helpers::validate_pattern(
val,
"TaxId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TaxId"),
config,
collector,
);
}
if let Some(ref val) = self.regn_id {
helpers::validate_length(
val,
"RegnId",
Some(1),
Some(35),
&helpers::child_path(path, "RegnId"),
config,
collector,
);
}
if let Some(ref val) = self.regn_id {
helpers::validate_pattern(
val,
"RegnId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "RegnId"),
config,
collector,
);
}
if let Some(ref val) = self.tax_tp {
helpers::validate_length(
val,
"TaxTp",
Some(1),
Some(35),
&helpers::child_path(path, "TaxTp"),
config,
collector,
);
}
if let Some(ref val) = self.tax_tp {
helpers::validate_pattern(
val,
"TaxTp",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TaxTp"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxParty21 {
#[serde(rename = "TaxId", skip_serializing_if = "Option::is_none")]
pub tax_id: Option<String>,
#[serde(rename = "RegnId", skip_serializing_if = "Option::is_none")]
pub regn_id: Option<String>,
#[serde(rename = "TaxTp", skip_serializing_if = "Option::is_none")]
pub tax_tp: Option<String>,
#[serde(rename = "Authstn", skip_serializing_if = "Option::is_none")]
pub authstn: Option<TaxAuthorisation11>,
}
impl Validate for TaxParty21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tax_id {
helpers::validate_length(
val,
"TaxId",
Some(1),
Some(35),
&helpers::child_path(path, "TaxId"),
config,
collector,
);
}
if let Some(ref val) = self.tax_id {
helpers::validate_pattern(
val,
"TaxId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TaxId"),
config,
collector,
);
}
if let Some(ref val) = self.regn_id {
helpers::validate_length(
val,
"RegnId",
Some(1),
Some(35),
&helpers::child_path(path, "RegnId"),
config,
collector,
);
}
if let Some(ref val) = self.regn_id {
helpers::validate_pattern(
val,
"RegnId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "RegnId"),
config,
collector,
);
}
if let Some(ref val) = self.tax_tp {
helpers::validate_length(
val,
"TaxTp",
Some(1),
Some(35),
&helpers::child_path(path, "TaxTp"),
config,
collector,
);
}
if let Some(ref val) = self.tax_tp {
helpers::validate_pattern(
val,
"TaxTp",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "TaxTp"),
config,
collector,
);
}
if let Some(ref val) = self.authstn
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Authstn"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxPeriod2 {
#[serde(rename = "Yr", skip_serializing_if = "Option::is_none")]
pub yr: Option<String>,
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<TaxRecordPeriod1Code>,
#[serde(rename = "FrToDt", skip_serializing_if = "Option::is_none")]
pub fr_to_dt: Option<DatePeriod2>,
}
impl Validate for TaxPeriod2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Tp"), config, collector);
}
if let Some(ref val) = self.fr_to_dt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "FrToDt"), config, collector);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxRecord21 {
#[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
pub tp: Option<String>,
#[serde(rename = "Ctgy", skip_serializing_if = "Option::is_none")]
pub ctgy: Option<String>,
#[serde(rename = "CtgyDtls", skip_serializing_if = "Option::is_none")]
pub ctgy_dtls: Option<String>,
#[serde(rename = "DbtrSts", skip_serializing_if = "Option::is_none")]
pub dbtr_sts: Option<String>,
#[serde(rename = "CertId", skip_serializing_if = "Option::is_none")]
pub cert_id: Option<String>,
#[serde(rename = "FrmsCd", skip_serializing_if = "Option::is_none")]
pub frms_cd: Option<String>,
#[serde(rename = "Prd", skip_serializing_if = "Option::is_none")]
pub prd: Option<TaxPeriod2>,
#[serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none")]
pub tax_amt: Option<TaxAmount2>,
#[serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none")]
pub addtl_inf: Option<String>,
}
impl Validate for TaxRecord21 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.tp {
helpers::validate_length(
val,
"Tp",
Some(1),
Some(35),
&helpers::child_path(path, "Tp"),
config,
collector,
);
}
if let Some(ref val) = self.tp {
helpers::validate_pattern(
val,
"Tp",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Tp"),
config,
collector,
);
}
if let Some(ref val) = self.ctgy {
helpers::validate_length(
val,
"Ctgy",
Some(1),
Some(35),
&helpers::child_path(path, "Ctgy"),
config,
collector,
);
}
if let Some(ref val) = self.ctgy {
helpers::validate_pattern(
val,
"Ctgy",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "Ctgy"),
config,
collector,
);
}
if let Some(ref val) = self.ctgy_dtls {
helpers::validate_length(
val,
"CtgyDtls",
Some(1),
Some(35),
&helpers::child_path(path, "CtgyDtls"),
config,
collector,
);
}
if let Some(ref val) = self.ctgy_dtls {
helpers::validate_pattern(
val,
"CtgyDtls",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "CtgyDtls"),
config,
collector,
);
}
if let Some(ref val) = self.dbtr_sts {
helpers::validate_length(
val,
"DbtrSts",
Some(1),
Some(35),
&helpers::child_path(path, "DbtrSts"),
config,
collector,
);
}
if let Some(ref val) = self.dbtr_sts {
helpers::validate_pattern(
val,
"DbtrSts",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "DbtrSts"),
config,
collector,
);
}
if let Some(ref val) = self.cert_id {
helpers::validate_length(
val,
"CertId",
Some(1),
Some(35),
&helpers::child_path(path, "CertId"),
config,
collector,
);
}
if let Some(ref val) = self.cert_id {
helpers::validate_pattern(
val,
"CertId",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "CertId"),
config,
collector,
);
}
if let Some(ref val) = self.frms_cd {
helpers::validate_length(
val,
"FrmsCd",
Some(1),
Some(35),
&helpers::child_path(path, "FrmsCd"),
config,
collector,
);
}
if let Some(ref val) = self.frms_cd {
helpers::validate_pattern(
val,
"FrmsCd",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "FrmsCd"),
config,
collector,
);
}
if let Some(ref val) = self.prd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prd"), config, collector);
}
if let Some(ref val) = self.tax_amt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "TaxAmt"), config, collector);
}
if let Some(ref val) = self.addtl_inf {
helpers::validate_length(
val,
"AddtlInf",
Some(1),
Some(140),
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
if let Some(ref val) = self.addtl_inf {
helpers::validate_pattern(
val,
"AddtlInf",
"[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
&helpers::child_path(path, "AddtlInf"),
config,
collector,
);
}
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TaxRecordDetails2 {
#[serde(rename = "Prd", skip_serializing_if = "Option::is_none")]
pub prd: Option<TaxPeriod2>,
#[serde(rename = "Amt")]
pub amt: ActiveOrHistoricCurrencyAndAmount,
}
impl Validate for TaxRecordDetails2 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.prd
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "Prd"), config, collector);
}
self.amt
.validate(&helpers::child_path(path, "Amt"), config, collector);
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub enum TaxRecordPeriod1Code {
#[default]
#[serde(rename = "MM01")]
CodeMM01,
#[serde(rename = "MM02")]
CodeMM02,
#[serde(rename = "MM03")]
CodeMM03,
#[serde(rename = "MM04")]
CodeMM04,
#[serde(rename = "MM05")]
CodeMM05,
#[serde(rename = "MM06")]
CodeMM06,
#[serde(rename = "MM07")]
CodeMM07,
#[serde(rename = "MM08")]
CodeMM08,
#[serde(rename = "MM09")]
CodeMM09,
#[serde(rename = "MM10")]
CodeMM10,
#[serde(rename = "MM11")]
CodeMM11,
#[serde(rename = "MM12")]
CodeMM12,
#[serde(rename = "QTR1")]
CodeQTR1,
#[serde(rename = "QTR2")]
CodeQTR2,
#[serde(rename = "QTR3")]
CodeQTR3,
#[serde(rename = "QTR4")]
CodeQTR4,
#[serde(rename = "HLF1")]
CodeHLF1,
#[serde(rename = "HLF2")]
CodeHLF2,
}
impl Validate for TaxRecordPeriod1Code {
fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
}
}
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
pub struct TransactionParties71 {
#[serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none")]
pub ultmt_dbtr: Option<Party40Choice1>,
#[serde(rename = "Dbtr")]
pub dbtr: Party40Choice2,
#[serde(rename = "InitgPty", skip_serializing_if = "Option::is_none")]
pub initg_pty: Option<Party40Choice1>,
#[serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none")]
pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none")]
pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none")]
pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none")]
pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none")]
pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none")]
pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none")]
pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification61>,
#[serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none")]
pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification63>,
#[serde(rename = "Cdtr")]
pub cdtr: Party40Choice3,
#[serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none")]
pub ultmt_cdtr: Option<Party40Choice1>,
}
impl Validate for TransactionParties71 {
fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
if let Some(ref val) = self.ultmt_dbtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "UltmtDbtr"), config, collector);
}
self.dbtr
.validate(&helpers::child_path(path, "Dbtr"), config, collector);
if let Some(ref val) = self.initg_pty
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "InitgPty"), config, collector);
}
if let Some(ref val) = self.dbtr_agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "DbtrAgt"), config, collector);
}
if let Some(ref val) = self.prvs_instg_agt1
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "PrvsInstgAgt1"),
config,
collector,
);
}
if let Some(ref val) = self.prvs_instg_agt2
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "PrvsInstgAgt2"),
config,
collector,
);
}
if let Some(ref val) = self.prvs_instg_agt3
&& config.validate_optional_fields
{
val.validate(
&helpers::child_path(path, "PrvsInstgAgt3"),
config,
collector,
);
}
if let Some(ref val) = self.intrmy_agt1
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "IntrmyAgt1"), config, collector);
}
if let Some(ref val) = self.intrmy_agt2
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "IntrmyAgt2"), config, collector);
}
if let Some(ref val) = self.intrmy_agt3
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "IntrmyAgt3"), config, collector);
}
if let Some(ref val) = self.cdtr_agt
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "CdtrAgt"), config, collector);
}
self.cdtr
.validate(&helpers::child_path(path, "Cdtr"), config, collector);
if let Some(ref val) = self.ultmt_cdtr
&& config.validate_optional_fields
{
val.validate(&helpers::child_path(path, "UltmtCdtr"), config, collector);
}
}
}