mx_message/document/
camt_106_001_02.rs

1// Plasmatic MX Message Parsing Library
2// https://github.com/GoPlasmatic/MXMessage
3//
4// Copyright (c) 2025 Plasmatic
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9//     http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// You may obtain a copy of this library at
18// https://github.com/GoPlasmatic/MXMessage
19use crate::parse_result::{ErrorCollector, ParserConfig};
20use crate::validation::{Validate, helpers};
21use serde::{Deserialize, Serialize};
22
23// AccountIdentification4Choice1: Unique identification of an account, as assigned by the account servicer, using an identification scheme.
24#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
25pub struct AccountIdentification4Choice1 {
26    #[serde(rename = "IBAN", skip_serializing_if = "Option::is_none")]
27    pub iban: Option<String>,
28    #[serde(rename = "Othr", skip_serializing_if = "Option::is_none")]
29    pub othr: Option<GenericAccountIdentification11>,
30}
31
32impl Validate for AccountIdentification4Choice1 {
33    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
34        if let Some(ref val) = self.iban {
35            helpers::validate_pattern(
36                val,
37                "IBAN",
38                "[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}",
39                &helpers::child_path(path, "IBAN"),
40                config,
41                collector,
42            );
43        }
44        if let Some(ref val) = self.othr
45            && config.validate_optional_fields
46        {
47            val.validate(&helpers::child_path(path, "Othr"), config, collector);
48        }
49    }
50}
51
52// AccountSchemeName1Choice1: Name of the identification scheme, in a free text form.
53#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
54pub struct AccountSchemeName1Choice1 {
55    #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
56    pub cd: Option<String>,
57    #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
58    pub prtry: Option<String>,
59}
60
61impl Validate for AccountSchemeName1Choice1 {
62    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
63        if let Some(ref val) = self.cd {
64            helpers::validate_length(
65                val,
66                "Cd",
67                Some(1),
68                Some(4),
69                &helpers::child_path(path, "Cd"),
70                config,
71                collector,
72            );
73        }
74        if let Some(ref val) = self.prtry {
75            helpers::validate_length(
76                val,
77                "Prtry",
78                Some(1),
79                Some(35),
80                &helpers::child_path(path, "Prtry"),
81                config,
82                collector,
83            );
84        }
85        if let Some(ref val) = self.prtry {
86            helpers::validate_pattern(
87                val,
88                "Prtry",
89                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
90                &helpers::child_path(path, "Prtry"),
91                config,
92                collector,
93            );
94        }
95    }
96}
97
98// BranchAndFinancialInstitutionIdentification81: Unique and unambiguous identification of a financial institution, as assigned under an internationally recognised or proprietary identification scheme.
99#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
100pub struct BranchAndFinancialInstitutionIdentification81 {
101    #[serde(rename = "FinInstnId")]
102    pub fin_instn_id: FinancialInstitutionIdentification231,
103}
104
105impl Validate for BranchAndFinancialInstitutionIdentification81 {
106    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
107        self.fin_instn_id
108            .validate(&helpers::child_path(path, "FinInstnId"), config, collector);
109    }
110}
111
112// CBPRAmount: CBPR_Amount
113#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
114pub struct CBPRAmount {
115    #[serde(rename = "@Ccy")]
116    pub ccy: String,
117    #[serde(rename = "$value")]
118    pub value: f64,
119}
120
121impl Validate for CBPRAmount {
122    fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {}
123}
124
125// CashAccount401: Specifies an alternate assumed name for the identification of the account.
126#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
127pub struct CashAccount401 {
128    #[serde(rename = "Id")]
129    pub id: AccountIdentification4Choice1,
130    #[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
131    pub tp: Option<CashAccountType2Choice1>,
132    #[serde(rename = "Ccy", skip_serializing_if = "Option::is_none")]
133    pub ccy: Option<String>,
134    #[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
135    pub nm: Option<String>,
136    #[serde(rename = "Prxy", skip_serializing_if = "Option::is_none")]
137    pub prxy: Option<ProxyAccountIdentification11>,
138}
139
140impl Validate for CashAccount401 {
141    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
142        self.id
143            .validate(&helpers::child_path(path, "Id"), config, collector);
144        if let Some(ref val) = self.tp
145            && config.validate_optional_fields
146        {
147            val.validate(&helpers::child_path(path, "Tp"), config, collector);
148        }
149        if let Some(ref val) = self.ccy {
150            helpers::validate_pattern(
151                val,
152                "Ccy",
153                "[A-Z]{3,3}",
154                &helpers::child_path(path, "Ccy"),
155                config,
156                collector,
157            );
158        }
159        if let Some(ref val) = self.nm {
160            helpers::validate_length(
161                val,
162                "Nm",
163                Some(1),
164                Some(70),
165                &helpers::child_path(path, "Nm"),
166                config,
167                collector,
168            );
169        }
170        if let Some(ref val) = self.nm {
171            helpers::validate_pattern(
172                val,
173                "Nm",
174                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
175                &helpers::child_path(path, "Nm"),
176                config,
177                collector,
178            );
179        }
180        if let Some(ref val) = self.prxy
181            && config.validate_optional_fields
182        {
183            val.validate(&helpers::child_path(path, "Prxy"), config, collector);
184        }
185    }
186}
187
188// CashAccountType2Choice1: Nature or use of the account in a proprietary form.
189#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
190pub struct CashAccountType2Choice1 {
191    #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
192    pub cd: Option<String>,
193    #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
194    pub prtry: Option<String>,
195}
196
197impl Validate for CashAccountType2Choice1 {
198    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
199        if let Some(ref val) = self.cd {
200            helpers::validate_length(
201                val,
202                "Cd",
203                Some(1),
204                Some(4),
205                &helpers::child_path(path, "Cd"),
206                config,
207                collector,
208            );
209        }
210        if let Some(ref val) = self.prtry {
211            helpers::validate_length(
212                val,
213                "Prtry",
214                Some(1),
215                Some(35),
216                &helpers::child_path(path, "Prtry"),
217                config,
218                collector,
219            );
220        }
221        if let Some(ref val) = self.prtry {
222            helpers::validate_pattern(
223                val,
224                "Prtry",
225                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
226                &helpers::child_path(path, "Prtry"),
227                config,
228                collector,
229            );
230        }
231    }
232}
233
234// ChargeType3Choice1: Charge type, in a coded form.
235#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
236pub struct ChargeType3Choice1 {
237    #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
238    pub cd: Option<String>,
239}
240
241impl Validate for ChargeType3Choice1 {
242    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
243        if let Some(ref val) = self.cd {
244            helpers::validate_length(
245                val,
246                "Cd",
247                Some(1),
248                Some(4),
249                &helpers::child_path(path, "Cd"),
250                config,
251                collector,
252            );
253        }
254    }
255}
256
257// Charges3Choice1: Charges broken down per payment transaction.
258#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
259pub struct Charges3Choice1 {
260    #[serde(rename = "PerTx", skip_serializing_if = "Option::is_none")]
261    pub per_tx: Option<ChargesPerTransaction31>,
262}
263
264impl Validate for Charges3Choice1 {
265    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
266        if let Some(ref val) = self.per_tx
267            && config.validate_optional_fields
268        {
269            val.validate(&helpers::child_path(path, "PerTx"), config, collector);
270        }
271    }
272}
273
274// ChargesBreakdown11: Specifies the type of charge.
275#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
276pub struct ChargesBreakdown11 {
277    #[serde(rename = "Amt")]
278    pub amt: CBPRAmount,
279    #[serde(rename = "CdtDbtInd")]
280    pub cdt_dbt_ind: CreditDebitCode1,
281    #[serde(rename = "Tp")]
282    pub tp: ChargeType3Choice1,
283}
284
285impl Validate for ChargesBreakdown11 {
286    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
287        self.amt
288            .validate(&helpers::child_path(path, "Amt"), config, collector);
289        self.cdt_dbt_ind
290            .validate(&helpers::child_path(path, "CdtDbtInd"), config, collector);
291        self.tp
292            .validate(&helpers::child_path(path, "Tp"), config, collector);
293    }
294}
295
296// ChargesPaymentRequestV02: Provides information on the charges to be paid by the charge bearer(s) related to the processing of the underlying transaction.
297#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
298pub struct ChargesPaymentRequestV02 {
299    #[serde(rename = "GrpHdr")]
300    pub grp_hdr: GroupHeader1151,
301    #[serde(rename = "Chrgs")]
302    pub chrgs: Charges3Choice1,
303}
304
305impl Validate for ChargesPaymentRequestV02 {
306    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
307        self.grp_hdr
308            .validate(&helpers::child_path(path, "GrpHdr"), config, collector);
309        self.chrgs
310            .validate(&helpers::child_path(path, "Chrgs"), config, collector);
311    }
312}
313
314// ChargesPerTransaction31: Itemised charges record per transaction.
315#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
316pub struct ChargesPerTransaction31 {
317    #[serde(rename = "ChrgsId")]
318    pub chrgs_id: String,
319    #[serde(rename = "Rcrd")]
320    pub rcrd: ChargesPerTransactionRecord31,
321}
322
323impl Validate for ChargesPerTransaction31 {
324    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
325        helpers::validate_length(
326            &self.chrgs_id,
327            "ChrgsId",
328            Some(1),
329            Some(16),
330            &helpers::child_path(path, "ChrgsId"),
331            config,
332            collector,
333        );
334        helpers::validate_pattern(
335            &self.chrgs_id,
336            "ChrgsId",
337            "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
338            &helpers::child_path(path, "ChrgsId"),
339            config,
340            collector,
341        );
342        self.rcrd
343            .validate(&helpers::child_path(path, "Rcrd"), config, collector);
344    }
345}
346
347// ChargesPerTransactionRecord31: Further information related to the processing of the payment adjustment instruction that may need to be acted upon by the next agent.
348#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
349pub struct ChargesPerTransactionRecord31 {
350    #[serde(rename = "UndrlygTx")]
351    pub undrlyg_tx: TransactionReferences71,
352    #[serde(rename = "TtlChrgsPerRcrd")]
353    pub ttl_chrgs_per_rcrd: TotalCharges81,
354    #[serde(rename = "ChrgsBrkdwn")]
355    pub chrgs_brkdwn: Vec<ChargesBreakdown11>,
356    #[serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none")]
357    pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification81>,
358    #[serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none")]
359    pub dbtr_agt_acct: Option<CashAccount401>,
360    #[serde(rename = "InstrForInstdAgt", skip_serializing_if = "Option::is_none")]
361    pub instr_for_instd_agt: Option<InstructionForInstructedAgent11>,
362}
363
364impl Validate for ChargesPerTransactionRecord31 {
365    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
366        self.undrlyg_tx
367            .validate(&helpers::child_path(path, "UndrlygTx"), config, collector);
368        self.ttl_chrgs_per_rcrd.validate(
369            &helpers::child_path(path, "TtlChrgsPerRcrd"),
370            config,
371            collector,
372        );
373        for item in &self.chrgs_brkdwn {
374            item.validate(&helpers::child_path(path, "ChrgsBrkdwn"), config, collector);
375        }
376        if let Some(ref val) = self.dbtr_agt
377            && config.validate_optional_fields
378        {
379            val.validate(&helpers::child_path(path, "DbtrAgt"), config, collector);
380        }
381        if let Some(ref val) = self.dbtr_agt_acct
382            && config.validate_optional_fields
383        {
384            val.validate(&helpers::child_path(path, "DbtrAgtAcct"), config, collector);
385        }
386        if let Some(ref val) = self.instr_for_instd_agt
387            && config.validate_optional_fields
388        {
389            val.validate(
390                &helpers::child_path(path, "InstrForInstdAgt"),
391                config,
392                collector,
393            );
394        }
395    }
396}
397
398// ClearingSystemIdentification2Choice1: Identification of a clearing system, in a coded form as published in an external list.
399#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
400pub struct ClearingSystemIdentification2Choice1 {
401    #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
402    pub cd: Option<String>,
403}
404
405impl Validate for ClearingSystemIdentification2Choice1 {
406    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
407        if let Some(ref val) = self.cd {
408            helpers::validate_length(
409                val,
410                "Cd",
411                Some(1),
412                Some(5),
413                &helpers::child_path(path, "Cd"),
414                config,
415                collector,
416            );
417        }
418    }
419}
420
421// ClearingSystemMemberIdentification21: Identification of a member of a clearing system.
422#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
423pub struct ClearingSystemMemberIdentification21 {
424    #[serde(rename = "ClrSysId")]
425    pub clr_sys_id: ClearingSystemIdentification2Choice1,
426    #[serde(rename = "MmbId")]
427    pub mmb_id: String,
428}
429
430impl Validate for ClearingSystemMemberIdentification21 {
431    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
432        self.clr_sys_id
433            .validate(&helpers::child_path(path, "ClrSysId"), config, collector);
434        helpers::validate_length(
435            &self.mmb_id,
436            "MmbId",
437            Some(1),
438            Some(28),
439            &helpers::child_path(path, "MmbId"),
440            config,
441            collector,
442        );
443        helpers::validate_pattern(
444            &self.mmb_id,
445            "MmbId",
446            "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
447            &helpers::child_path(path, "MmbId"),
448            config,
449            collector,
450        );
451    }
452}
453
454// CreditDebitCode__1: Operation is a decrease.
455#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
456pub enum CreditDebitCode1 {
457    #[default]
458    #[serde(rename = "DBIT")]
459    CodeDBIT,
460}
461
462impl Validate for CreditDebitCode1 {
463    fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
464        // Enum validation is typically empty
465    }
466}
467
468// FinancialInstitutionIdentification231: Information that locates and identifies a specific address, as defined by postal services.
469#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
470pub struct FinancialInstitutionIdentification231 {
471    #[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
472    pub bicfi: Option<String>,
473    #[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
474    pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
475    #[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
476    pub lei: Option<String>,
477    #[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
478    pub nm: Option<String>,
479    #[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
480    pub pstl_adr: Option<PostalAddress271>,
481}
482
483impl Validate for FinancialInstitutionIdentification231 {
484    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
485        if let Some(ref val) = self.bicfi {
486            helpers::validate_pattern(
487                val,
488                "BICFI",
489                "[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
490                &helpers::child_path(path, "BICFI"),
491                config,
492                collector,
493            );
494        }
495        if let Some(ref val) = self.clr_sys_mmb_id
496            && config.validate_optional_fields
497        {
498            val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
499        }
500        if let Some(ref val) = self.lei {
501            helpers::validate_pattern(
502                val,
503                "LEI",
504                "[A-Z0-9]{18,18}[0-9]{2,2}",
505                &helpers::child_path(path, "LEI"),
506                config,
507                collector,
508            );
509        }
510        if let Some(ref val) = self.nm {
511            helpers::validate_length(
512                val,
513                "Nm",
514                Some(1),
515                Some(140),
516                &helpers::child_path(path, "Nm"),
517                config,
518                collector,
519            );
520        }
521        if let Some(ref val) = self.nm {
522            helpers::validate_pattern(
523                val,
524                "Nm",
525                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
526                &helpers::child_path(path, "Nm"),
527                config,
528                collector,
529            );
530        }
531        if let Some(ref val) = self.pstl_adr
532            && config.validate_optional_fields
533        {
534            val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
535        }
536    }
537}
538
539// GenericAccountIdentification11: Entity that assigns the identification.
540#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
541pub struct GenericAccountIdentification11 {
542    #[serde(rename = "Id")]
543    pub id: String,
544    #[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
545    pub schme_nm: Option<AccountSchemeName1Choice1>,
546    #[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
547    pub issr: Option<String>,
548}
549
550impl Validate for GenericAccountIdentification11 {
551    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
552        helpers::validate_length(
553            &self.id,
554            "Id",
555            Some(1),
556            Some(34),
557            &helpers::child_path(path, "Id"),
558            config,
559            collector,
560        );
561        helpers::validate_pattern(
562            &self.id,
563            "Id",
564            "([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]*(/[0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ])?)*)",
565            &helpers::child_path(path, "Id"),
566            config,
567            collector,
568        );
569        if let Some(ref val) = self.schme_nm
570            && config.validate_optional_fields
571        {
572            val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
573        }
574        if let Some(ref val) = self.issr {
575            helpers::validate_length(
576                val,
577                "Issr",
578                Some(1),
579                Some(35),
580                &helpers::child_path(path, "Issr"),
581                config,
582                collector,
583            );
584        }
585        if let Some(ref val) = self.issr {
586            helpers::validate_pattern(
587                val,
588                "Issr",
589                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
590                &helpers::child_path(path, "Issr"),
591                config,
592                collector,
593            );
594        }
595    }
596}
597
598// GroupHeader1151: Account of the agent that services the charges account.
599#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
600pub struct GroupHeader1151 {
601    #[serde(rename = "MsgId")]
602    pub msg_id: String,
603    #[serde(rename = "CreDtTm")]
604    pub cre_dt_tm: String,
605    #[serde(rename = "ChrgsRqstr")]
606    pub chrgs_rqstr: BranchAndFinancialInstitutionIdentification81,
607    #[serde(rename = "ChrgsAcctAgt", skip_serializing_if = "Option::is_none")]
608    pub chrgs_acct_agt: Option<BranchAndFinancialInstitutionIdentification81>,
609    #[serde(rename = "ChrgsAcctAgtAcct", skip_serializing_if = "Option::is_none")]
610    pub chrgs_acct_agt_acct: Option<CashAccount401>,
611}
612
613impl Validate for GroupHeader1151 {
614    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
615        helpers::validate_length(
616            &self.msg_id,
617            "MsgId",
618            Some(1),
619            Some(35),
620            &helpers::child_path(path, "MsgId"),
621            config,
622            collector,
623        );
624        helpers::validate_pattern(
625            &self.msg_id,
626            "MsgId",
627            "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
628            &helpers::child_path(path, "MsgId"),
629            config,
630            collector,
631        );
632        helpers::validate_pattern(
633            &self.cre_dt_tm,
634            "CreDtTm",
635            ".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
636            &helpers::child_path(path, "CreDtTm"),
637            config,
638            collector,
639        );
640        self.chrgs_rqstr
641            .validate(&helpers::child_path(path, "ChrgsRqstr"), config, collector);
642        if let Some(ref val) = self.chrgs_acct_agt
643            && config.validate_optional_fields
644        {
645            val.validate(
646                &helpers::child_path(path, "ChrgsAcctAgt"),
647                config,
648                collector,
649            );
650        }
651        if let Some(ref val) = self.chrgs_acct_agt_acct
652            && config.validate_optional_fields
653        {
654            val.validate(
655                &helpers::child_path(path, "ChrgsAcctAgtAcct"),
656                config,
657                collector,
658            );
659        }
660    }
661}
662
663// InstructionForInstructedAgent11: Further information complementing the coded instruction or instruction to the instructed agent that is bilaterally agreed or specific to a user community.
664#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
665pub struct InstructionForInstructedAgent11 {
666    #[serde(rename = "Cd")]
667    pub cd: String,
668    #[serde(rename = "InstrInf", skip_serializing_if = "Option::is_none")]
669    pub instr_inf: Option<String>,
670}
671
672impl Validate for InstructionForInstructedAgent11 {
673    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
674        helpers::validate_length(
675            &self.cd,
676            "Cd",
677            Some(1),
678            Some(4),
679            &helpers::child_path(path, "Cd"),
680            config,
681            collector,
682        );
683        if let Some(ref val) = self.instr_inf {
684            helpers::validate_length(
685                val,
686                "InstrInf",
687                Some(1),
688                Some(140),
689                &helpers::child_path(path, "InstrInf"),
690                config,
691                collector,
692            );
693        }
694        if let Some(ref val) = self.instr_inf {
695            helpers::validate_pattern(
696                val,
697                "InstrInf",
698                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
699                &helpers::child_path(path, "InstrInf"),
700                config,
701                collector,
702            );
703        }
704    }
705}
706
707// PostalAddress271: Information that locates and identifies a specific address, as defined by postal services, presented in free format text.
708#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
709pub struct PostalAddress271 {
710    #[serde(rename = "Dept", skip_serializing_if = "Option::is_none")]
711    pub dept: Option<String>,
712    #[serde(rename = "SubDept", skip_serializing_if = "Option::is_none")]
713    pub sub_dept: Option<String>,
714    #[serde(rename = "StrtNm", skip_serializing_if = "Option::is_none")]
715    pub strt_nm: Option<String>,
716    #[serde(rename = "BldgNb", skip_serializing_if = "Option::is_none")]
717    pub bldg_nb: Option<String>,
718    #[serde(rename = "BldgNm", skip_serializing_if = "Option::is_none")]
719    pub bldg_nm: Option<String>,
720    #[serde(rename = "Flr", skip_serializing_if = "Option::is_none")]
721    pub flr: Option<String>,
722    #[serde(rename = "PstBx", skip_serializing_if = "Option::is_none")]
723    pub pst_bx: Option<String>,
724    #[serde(rename = "Room", skip_serializing_if = "Option::is_none")]
725    pub room: Option<String>,
726    #[serde(rename = "PstCd", skip_serializing_if = "Option::is_none")]
727    pub pst_cd: Option<String>,
728    #[serde(rename = "TwnNm", skip_serializing_if = "Option::is_none")]
729    pub twn_nm: Option<String>,
730    #[serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none")]
731    pub twn_lctn_nm: Option<String>,
732    #[serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none")]
733    pub dstrct_nm: Option<String>,
734    #[serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none")]
735    pub ctry_sub_dvsn: Option<String>,
736    #[serde(rename = "Ctry", skip_serializing_if = "Option::is_none")]
737    pub ctry: Option<String>,
738    #[serde(rename = "AdrLine", skip_serializing_if = "Option::is_none")]
739    pub adr_line: Option<Vec<String>>,
740}
741
742impl Validate for PostalAddress271 {
743    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
744        if let Some(ref val) = self.dept {
745            helpers::validate_length(
746                val,
747                "Dept",
748                Some(1),
749                Some(70),
750                &helpers::child_path(path, "Dept"),
751                config,
752                collector,
753            );
754        }
755        if let Some(ref val) = self.dept {
756            helpers::validate_pattern(
757                val,
758                "Dept",
759                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
760                &helpers::child_path(path, "Dept"),
761                config,
762                collector,
763            );
764        }
765        if let Some(ref val) = self.sub_dept {
766            helpers::validate_length(
767                val,
768                "SubDept",
769                Some(1),
770                Some(70),
771                &helpers::child_path(path, "SubDept"),
772                config,
773                collector,
774            );
775        }
776        if let Some(ref val) = self.sub_dept {
777            helpers::validate_pattern(
778                val,
779                "SubDept",
780                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
781                &helpers::child_path(path, "SubDept"),
782                config,
783                collector,
784            );
785        }
786        if let Some(ref val) = self.strt_nm {
787            helpers::validate_length(
788                val,
789                "StrtNm",
790                Some(1),
791                Some(70),
792                &helpers::child_path(path, "StrtNm"),
793                config,
794                collector,
795            );
796        }
797        if let Some(ref val) = self.strt_nm {
798            helpers::validate_pattern(
799                val,
800                "StrtNm",
801                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
802                &helpers::child_path(path, "StrtNm"),
803                config,
804                collector,
805            );
806        }
807        if let Some(ref val) = self.bldg_nb {
808            helpers::validate_length(
809                val,
810                "BldgNb",
811                Some(1),
812                Some(16),
813                &helpers::child_path(path, "BldgNb"),
814                config,
815                collector,
816            );
817        }
818        if let Some(ref val) = self.bldg_nb {
819            helpers::validate_pattern(
820                val,
821                "BldgNb",
822                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
823                &helpers::child_path(path, "BldgNb"),
824                config,
825                collector,
826            );
827        }
828        if let Some(ref val) = self.bldg_nm {
829            helpers::validate_length(
830                val,
831                "BldgNm",
832                Some(1),
833                Some(35),
834                &helpers::child_path(path, "BldgNm"),
835                config,
836                collector,
837            );
838        }
839        if let Some(ref val) = self.bldg_nm {
840            helpers::validate_pattern(
841                val,
842                "BldgNm",
843                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
844                &helpers::child_path(path, "BldgNm"),
845                config,
846                collector,
847            );
848        }
849        if let Some(ref val) = self.flr {
850            helpers::validate_length(
851                val,
852                "Flr",
853                Some(1),
854                Some(70),
855                &helpers::child_path(path, "Flr"),
856                config,
857                collector,
858            );
859        }
860        if let Some(ref val) = self.flr {
861            helpers::validate_pattern(
862                val,
863                "Flr",
864                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
865                &helpers::child_path(path, "Flr"),
866                config,
867                collector,
868            );
869        }
870        if let Some(ref val) = self.pst_bx {
871            helpers::validate_length(
872                val,
873                "PstBx",
874                Some(1),
875                Some(16),
876                &helpers::child_path(path, "PstBx"),
877                config,
878                collector,
879            );
880        }
881        if let Some(ref val) = self.pst_bx {
882            helpers::validate_pattern(
883                val,
884                "PstBx",
885                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
886                &helpers::child_path(path, "PstBx"),
887                config,
888                collector,
889            );
890        }
891        if let Some(ref val) = self.room {
892            helpers::validate_length(
893                val,
894                "Room",
895                Some(1),
896                Some(70),
897                &helpers::child_path(path, "Room"),
898                config,
899                collector,
900            );
901        }
902        if let Some(ref val) = self.room {
903            helpers::validate_pattern(
904                val,
905                "Room",
906                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
907                &helpers::child_path(path, "Room"),
908                config,
909                collector,
910            );
911        }
912        if let Some(ref val) = self.pst_cd {
913            helpers::validate_length(
914                val,
915                "PstCd",
916                Some(1),
917                Some(16),
918                &helpers::child_path(path, "PstCd"),
919                config,
920                collector,
921            );
922        }
923        if let Some(ref val) = self.pst_cd {
924            helpers::validate_pattern(
925                val,
926                "PstCd",
927                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
928                &helpers::child_path(path, "PstCd"),
929                config,
930                collector,
931            );
932        }
933        if let Some(ref val) = self.twn_nm {
934            helpers::validate_length(
935                val,
936                "TwnNm",
937                Some(1),
938                Some(35),
939                &helpers::child_path(path, "TwnNm"),
940                config,
941                collector,
942            );
943        }
944        if let Some(ref val) = self.twn_nm {
945            helpers::validate_pattern(
946                val,
947                "TwnNm",
948                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
949                &helpers::child_path(path, "TwnNm"),
950                config,
951                collector,
952            );
953        }
954        if let Some(ref val) = self.twn_lctn_nm {
955            helpers::validate_length(
956                val,
957                "TwnLctnNm",
958                Some(1),
959                Some(35),
960                &helpers::child_path(path, "TwnLctnNm"),
961                config,
962                collector,
963            );
964        }
965        if let Some(ref val) = self.twn_lctn_nm {
966            helpers::validate_pattern(
967                val,
968                "TwnLctnNm",
969                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
970                &helpers::child_path(path, "TwnLctnNm"),
971                config,
972                collector,
973            );
974        }
975        if let Some(ref val) = self.dstrct_nm {
976            helpers::validate_length(
977                val,
978                "DstrctNm",
979                Some(1),
980                Some(35),
981                &helpers::child_path(path, "DstrctNm"),
982                config,
983                collector,
984            );
985        }
986        if let Some(ref val) = self.dstrct_nm {
987            helpers::validate_pattern(
988                val,
989                "DstrctNm",
990                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
991                &helpers::child_path(path, "DstrctNm"),
992                config,
993                collector,
994            );
995        }
996        if let Some(ref val) = self.ctry_sub_dvsn {
997            helpers::validate_length(
998                val,
999                "CtrySubDvsn",
1000                Some(1),
1001                Some(35),
1002                &helpers::child_path(path, "CtrySubDvsn"),
1003                config,
1004                collector,
1005            );
1006        }
1007        if let Some(ref val) = self.ctry_sub_dvsn {
1008            helpers::validate_pattern(
1009                val,
1010                "CtrySubDvsn",
1011                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
1012                &helpers::child_path(path, "CtrySubDvsn"),
1013                config,
1014                collector,
1015            );
1016        }
1017        if let Some(ref val) = self.ctry {
1018            helpers::validate_pattern(
1019                val,
1020                "Ctry",
1021                "[A-Z]{2,2}",
1022                &helpers::child_path(path, "Ctry"),
1023                config,
1024                collector,
1025            );
1026        }
1027        if let Some(ref vec) = self.adr_line {
1028            for item in vec {
1029                helpers::validate_length(
1030                    item,
1031                    "AdrLine",
1032                    Some(1),
1033                    Some(70),
1034                    &helpers::child_path(path, "AdrLine"),
1035                    config,
1036                    collector,
1037                );
1038            }
1039        }
1040        if let Some(ref vec) = self.adr_line {
1041            for item in vec {
1042                helpers::validate_pattern(
1043                    item,
1044                    "AdrLine",
1045                    "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
1046                    &helpers::child_path(path, "AdrLine"),
1047                    config,
1048                    collector,
1049                );
1050            }
1051        }
1052    }
1053}
1054
1055// ProxyAccountIdentification11: Identification used to indicate the account identification under another specified name.
1056#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1057pub struct ProxyAccountIdentification11 {
1058    #[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
1059    pub tp: Option<ProxyAccountType1Choice1>,
1060    #[serde(rename = "Id")]
1061    pub id: String,
1062}
1063
1064impl Validate for ProxyAccountIdentification11 {
1065    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1066        if let Some(ref val) = self.tp
1067            && config.validate_optional_fields
1068        {
1069            val.validate(&helpers::child_path(path, "Tp"), config, collector);
1070        }
1071        helpers::validate_length(
1072            &self.id,
1073            "Id",
1074            Some(1),
1075            Some(320),
1076            &helpers::child_path(path, "Id"),
1077            config,
1078            collector,
1079        );
1080        helpers::validate_pattern(
1081            &self.id,
1082            "Id",
1083            "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
1084            &helpers::child_path(path, "Id"),
1085            config,
1086            collector,
1087        );
1088    }
1089}
1090
1091// ProxyAccountType1Choice1: Name of the identification scheme, in a free text form.
1092#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1093pub struct ProxyAccountType1Choice1 {
1094    #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
1095    pub cd: Option<String>,
1096    #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
1097    pub prtry: Option<String>,
1098}
1099
1100impl Validate for ProxyAccountType1Choice1 {
1101    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1102        if let Some(ref val) = self.cd {
1103            helpers::validate_length(
1104                val,
1105                "Cd",
1106                Some(1),
1107                Some(4),
1108                &helpers::child_path(path, "Cd"),
1109                config,
1110                collector,
1111            );
1112        }
1113        if let Some(ref val) = self.prtry {
1114            helpers::validate_length(
1115                val,
1116                "Prtry",
1117                Some(1),
1118                Some(35),
1119                &helpers::child_path(path, "Prtry"),
1120                config,
1121                collector,
1122            );
1123        }
1124        if let Some(ref val) = self.prtry {
1125            helpers::validate_pattern(
1126                val,
1127                "Prtry",
1128                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1129                &helpers::child_path(path, "Prtry"),
1130                config,
1131                collector,
1132            );
1133        }
1134    }
1135}
1136
1137// TotalCharges81: Indicates whether the total charges amount is a credit or a debit amount.
1138// Usage: A zero amount is considered to be a credit.
1139#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1140pub struct TotalCharges81 {
1141    #[serde(rename = "NbOfChrgsBrkdwnItms")]
1142    pub nb_of_chrgs_brkdwn_itms: String,
1143    #[serde(rename = "TtlChrgsAmt")]
1144    pub ttl_chrgs_amt: CBPRAmount,
1145    #[serde(rename = "CdtDbtInd")]
1146    pub cdt_dbt_ind: CreditDebitCode1,
1147}
1148
1149impl Validate for TotalCharges81 {
1150    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1151        helpers::validate_pattern(
1152            &self.nb_of_chrgs_brkdwn_itms,
1153            "NbOfChrgsBrkdwnItms",
1154            "[0-9]{1,15}",
1155            &helpers::child_path(path, "NbOfChrgsBrkdwnItms"),
1156            config,
1157            collector,
1158        );
1159        self.ttl_chrgs_amt
1160            .validate(&helpers::child_path(path, "TtlChrgsAmt"), config, collector);
1161        self.cdt_dbt_ind
1162            .validate(&helpers::child_path(path, "CdtDbtInd"), config, collector);
1163    }
1164}
1165
1166// TransactionReferences71: Identification of the securities transaction assigned by the processor of the instruction other than the securities account owner, the securities account servicer and the market infrastructure.
1167#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1168pub struct TransactionReferences71 {
1169    #[serde(rename = "MsgId", skip_serializing_if = "Option::is_none")]
1170    pub msg_id: Option<String>,
1171    #[serde(rename = "MsgNmId")]
1172    pub msg_nm_id: String,
1173    #[serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none")]
1174    pub acct_svcr_ref: Option<String>,
1175    #[serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none")]
1176    pub pmt_inf_id: Option<String>,
1177    #[serde(rename = "InstrId", skip_serializing_if = "Option::is_none")]
1178    pub instr_id: Option<String>,
1179    #[serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none")]
1180    pub end_to_end_id: Option<String>,
1181    #[serde(rename = "UETR", skip_serializing_if = "Option::is_none")]
1182    pub uetr: Option<String>,
1183    #[serde(rename = "TxId", skip_serializing_if = "Option::is_none")]
1184    pub tx_id: Option<String>,
1185    #[serde(rename = "MndtId", skip_serializing_if = "Option::is_none")]
1186    pub mndt_id: Option<String>,
1187    #[serde(rename = "ChqNb", skip_serializing_if = "Option::is_none")]
1188    pub chq_nb: Option<String>,
1189    #[serde(rename = "AcctOwnrTxId", skip_serializing_if = "Option::is_none")]
1190    pub acct_ownr_tx_id: Option<String>,
1191    #[serde(rename = "AcctSvcrTxId", skip_serializing_if = "Option::is_none")]
1192    pub acct_svcr_tx_id: Option<String>,
1193    #[serde(rename = "PrcgId", skip_serializing_if = "Option::is_none")]
1194    pub prcg_id: Option<String>,
1195}
1196
1197impl Validate for TransactionReferences71 {
1198    fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1199        if let Some(ref val) = self.msg_id {
1200            helpers::validate_length(
1201                val,
1202                "MsgId",
1203                Some(1),
1204                Some(35),
1205                &helpers::child_path(path, "MsgId"),
1206                config,
1207                collector,
1208            );
1209        }
1210        if let Some(ref val) = self.msg_id {
1211            helpers::validate_pattern(
1212                val,
1213                "MsgId",
1214                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1215                &helpers::child_path(path, "MsgId"),
1216                config,
1217                collector,
1218            );
1219        }
1220        helpers::validate_length(
1221            &self.msg_nm_id,
1222            "MsgNmId",
1223            Some(1),
1224            Some(35),
1225            &helpers::child_path(path, "MsgNmId"),
1226            config,
1227            collector,
1228        );
1229        helpers::validate_pattern(
1230            &self.msg_nm_id,
1231            "MsgNmId",
1232            "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1233            &helpers::child_path(path, "MsgNmId"),
1234            config,
1235            collector,
1236        );
1237        if let Some(ref val) = self.acct_svcr_ref {
1238            helpers::validate_length(
1239                val,
1240                "AcctSvcrRef",
1241                Some(1),
1242                Some(35),
1243                &helpers::child_path(path, "AcctSvcrRef"),
1244                config,
1245                collector,
1246            );
1247        }
1248        if let Some(ref val) = self.acct_svcr_ref {
1249            helpers::validate_pattern(
1250                val,
1251                "AcctSvcrRef",
1252                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1253                &helpers::child_path(path, "AcctSvcrRef"),
1254                config,
1255                collector,
1256            );
1257        }
1258        if let Some(ref val) = self.pmt_inf_id {
1259            helpers::validate_length(
1260                val,
1261                "PmtInfId",
1262                Some(1),
1263                Some(35),
1264                &helpers::child_path(path, "PmtInfId"),
1265                config,
1266                collector,
1267            );
1268        }
1269        if let Some(ref val) = self.pmt_inf_id {
1270            helpers::validate_pattern(
1271                val,
1272                "PmtInfId",
1273                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1274                &helpers::child_path(path, "PmtInfId"),
1275                config,
1276                collector,
1277            );
1278        }
1279        if let Some(ref val) = self.instr_id {
1280            helpers::validate_length(
1281                val,
1282                "InstrId",
1283                Some(1),
1284                Some(16),
1285                &helpers::child_path(path, "InstrId"),
1286                config,
1287                collector,
1288            );
1289        }
1290        if let Some(ref val) = self.instr_id {
1291            helpers::validate_pattern(
1292                val,
1293                "InstrId",
1294                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1295                &helpers::child_path(path, "InstrId"),
1296                config,
1297                collector,
1298            );
1299        }
1300        if let Some(ref val) = self.end_to_end_id {
1301            helpers::validate_length(
1302                val,
1303                "EndToEndId",
1304                Some(1),
1305                Some(35),
1306                &helpers::child_path(path, "EndToEndId"),
1307                config,
1308                collector,
1309            );
1310        }
1311        if let Some(ref val) = self.end_to_end_id {
1312            helpers::validate_pattern(
1313                val,
1314                "EndToEndId",
1315                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1316                &helpers::child_path(path, "EndToEndId"),
1317                config,
1318                collector,
1319            );
1320        }
1321        if let Some(ref val) = self.uetr {
1322            helpers::validate_pattern(
1323                val,
1324                "UETR",
1325                "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}",
1326                &helpers::child_path(path, "UETR"),
1327                config,
1328                collector,
1329            );
1330        }
1331        if let Some(ref val) = self.tx_id {
1332            helpers::validate_length(
1333                val,
1334                "TxId",
1335                Some(1),
1336                Some(35),
1337                &helpers::child_path(path, "TxId"),
1338                config,
1339                collector,
1340            );
1341        }
1342        if let Some(ref val) = self.tx_id {
1343            helpers::validate_pattern(
1344                val,
1345                "TxId",
1346                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1347                &helpers::child_path(path, "TxId"),
1348                config,
1349                collector,
1350            );
1351        }
1352        if let Some(ref val) = self.mndt_id {
1353            helpers::validate_length(
1354                val,
1355                "MndtId",
1356                Some(1),
1357                Some(35),
1358                &helpers::child_path(path, "MndtId"),
1359                config,
1360                collector,
1361            );
1362        }
1363        if let Some(ref val) = self.mndt_id {
1364            helpers::validate_pattern(
1365                val,
1366                "MndtId",
1367                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1368                &helpers::child_path(path, "MndtId"),
1369                config,
1370                collector,
1371            );
1372        }
1373        if let Some(ref val) = self.chq_nb {
1374            helpers::validate_length(
1375                val,
1376                "ChqNb",
1377                Some(1),
1378                Some(35),
1379                &helpers::child_path(path, "ChqNb"),
1380                config,
1381                collector,
1382            );
1383        }
1384        if let Some(ref val) = self.chq_nb {
1385            helpers::validate_pattern(
1386                val,
1387                "ChqNb",
1388                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1389                &helpers::child_path(path, "ChqNb"),
1390                config,
1391                collector,
1392            );
1393        }
1394        if let Some(ref val) = self.acct_ownr_tx_id {
1395            helpers::validate_length(
1396                val,
1397                "AcctOwnrTxId",
1398                Some(1),
1399                Some(35),
1400                &helpers::child_path(path, "AcctOwnrTxId"),
1401                config,
1402                collector,
1403            );
1404        }
1405        if let Some(ref val) = self.acct_ownr_tx_id {
1406            helpers::validate_pattern(
1407                val,
1408                "AcctOwnrTxId",
1409                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1410                &helpers::child_path(path, "AcctOwnrTxId"),
1411                config,
1412                collector,
1413            );
1414        }
1415        if let Some(ref val) = self.acct_svcr_tx_id {
1416            helpers::validate_length(
1417                val,
1418                "AcctSvcrTxId",
1419                Some(1),
1420                Some(35),
1421                &helpers::child_path(path, "AcctSvcrTxId"),
1422                config,
1423                collector,
1424            );
1425        }
1426        if let Some(ref val) = self.acct_svcr_tx_id {
1427            helpers::validate_pattern(
1428                val,
1429                "AcctSvcrTxId",
1430                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1431                &helpers::child_path(path, "AcctSvcrTxId"),
1432                config,
1433                collector,
1434            );
1435        }
1436        if let Some(ref val) = self.prcg_id {
1437            helpers::validate_length(
1438                val,
1439                "PrcgId",
1440                Some(1),
1441                Some(35),
1442                &helpers::child_path(path, "PrcgId"),
1443                config,
1444                collector,
1445            );
1446        }
1447        if let Some(ref val) = self.prcg_id {
1448            helpers::validate_pattern(
1449                val,
1450                "PrcgId",
1451                "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1452                &helpers::child_path(path, "PrcgId"),
1453                config,
1454                collector,
1455            );
1456        }
1457    }
1458}