1use crate::parse_result::{ErrorCollector, ParserConfig};
20use crate::validation::{Validate, helpers};
21use serde::{Deserialize, Serialize};
22
23#[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#[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#[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#[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#[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#[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#[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#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
259pub struct Charges4Choice1 {
260 #[serde(rename = "PerTx", skip_serializing_if = "Option::is_none")]
261 pub per_tx: Option<ChargesPerTransaction41>,
262}
263
264impl Validate for Charges4Choice1 {
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#[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#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
298pub struct ChargesPaymentNotificationV02 {
299 #[serde(rename = "GrpHdr")]
300 pub grp_hdr: GroupHeader1261,
301 #[serde(rename = "Chrgs")]
302 pub chrgs: Charges4Choice1,
303}
304
305impl Validate for ChargesPaymentNotificationV02 {
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#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
316pub struct ChargesPerTransaction41 {
317 #[serde(rename = "ChrgsId")]
318 pub chrgs_id: String,
319 #[serde(rename = "Rcrd")]
320 pub rcrd: Vec<ChargesPerTransactionRecord41>,
321}
322
323impl Validate for ChargesPerTransaction41 {
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 for item in &self.rcrd {
343 item.validate(&helpers::child_path(path, "Rcrd"), config, collector);
344 }
345 }
346}
347
348#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
350pub struct ChargesPerTransactionRecord41 {
351 #[serde(rename = "RcrdId", skip_serializing_if = "Option::is_none")]
352 pub rcrd_id: Option<String>,
353 #[serde(rename = "ChrgsRqstr")]
354 pub chrgs_rqstr: BranchAndFinancialInstitutionIdentification81,
355 #[serde(rename = "UndrlygTx")]
356 pub undrlyg_tx: TransactionReferences71,
357 #[serde(rename = "TtlChrgsPerRcrd")]
358 pub ttl_chrgs_per_rcrd: TotalCharges81,
359 #[serde(rename = "ChrgsBrkdwn")]
360 pub chrgs_brkdwn: Vec<ChargesBreakdown11>,
361 #[serde(rename = "ValDt")]
362 pub val_dt: DateAndDateTime2Choice1,
363 #[serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none")]
364 pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification81>,
365 #[serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none")]
366 pub dbtr_agt_acct: Option<CashAccount401>,
367}
368
369impl Validate for ChargesPerTransactionRecord41 {
370 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
371 if let Some(ref val) = self.rcrd_id {
372 helpers::validate_length(
373 val,
374 "RcrdId",
375 Some(1),
376 Some(35),
377 &helpers::child_path(path, "RcrdId"),
378 config,
379 collector,
380 );
381 }
382 if let Some(ref val) = self.rcrd_id {
383 helpers::validate_pattern(
384 val,
385 "RcrdId",
386 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
387 &helpers::child_path(path, "RcrdId"),
388 config,
389 collector,
390 );
391 }
392 self.chrgs_rqstr
393 .validate(&helpers::child_path(path, "ChrgsRqstr"), config, collector);
394 self.undrlyg_tx
395 .validate(&helpers::child_path(path, "UndrlygTx"), config, collector);
396 self.ttl_chrgs_per_rcrd.validate(
397 &helpers::child_path(path, "TtlChrgsPerRcrd"),
398 config,
399 collector,
400 );
401 for item in &self.chrgs_brkdwn {
402 item.validate(&helpers::child_path(path, "ChrgsBrkdwn"), config, collector);
403 }
404 self.val_dt
405 .validate(&helpers::child_path(path, "ValDt"), config, collector);
406 if let Some(ref val) = self.dbtr_agt
407 && config.validate_optional_fields
408 {
409 val.validate(&helpers::child_path(path, "DbtrAgt"), config, collector);
410 }
411 if let Some(ref val) = self.dbtr_agt_acct
412 && config.validate_optional_fields
413 {
414 val.validate(&helpers::child_path(path, "DbtrAgtAcct"), config, collector);
415 }
416 }
417}
418
419#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
421pub struct ClearingSystemIdentification2Choice1 {
422 #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
423 pub cd: Option<String>,
424}
425
426impl Validate for ClearingSystemIdentification2Choice1 {
427 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
428 if let Some(ref val) = self.cd {
429 helpers::validate_length(
430 val,
431 "Cd",
432 Some(1),
433 Some(5),
434 &helpers::child_path(path, "Cd"),
435 config,
436 collector,
437 );
438 }
439 }
440}
441
442#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
444pub struct ClearingSystemMemberIdentification21 {
445 #[serde(rename = "ClrSysId")]
446 pub clr_sys_id: ClearingSystemIdentification2Choice1,
447 #[serde(rename = "MmbId")]
448 pub mmb_id: String,
449}
450
451impl Validate for ClearingSystemMemberIdentification21 {
452 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
453 self.clr_sys_id
454 .validate(&helpers::child_path(path, "ClrSysId"), config, collector);
455 helpers::validate_length(
456 &self.mmb_id,
457 "MmbId",
458 Some(1),
459 Some(28),
460 &helpers::child_path(path, "MmbId"),
461 config,
462 collector,
463 );
464 helpers::validate_pattern(
465 &self.mmb_id,
466 "MmbId",
467 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
468 &helpers::child_path(path, "MmbId"),
469 config,
470 collector,
471 );
472 }
473}
474
475#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
477pub enum CreditDebitCode1 {
478 #[default]
479 #[serde(rename = "DBIT")]
480 CodeDBIT,
481}
482
483impl Validate for CreditDebitCode1 {
484 fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {
485 }
487}
488
489#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
491pub struct DateAndDateTime2Choice1 {
492 #[serde(rename = "Dt", skip_serializing_if = "Option::is_none")]
493 pub dt: Option<String>,
494}
495
496impl Validate for DateAndDateTime2Choice1 {
497 fn validate(&self, _path: &str, _config: &ParserConfig, _collector: &mut ErrorCollector) {}
498}
499
500#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
502pub struct FinancialInstitutionIdentification231 {
503 #[serde(rename = "BICFI", skip_serializing_if = "Option::is_none")]
504 pub bicfi: Option<String>,
505 #[serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none")]
506 pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification21>,
507 #[serde(rename = "LEI", skip_serializing_if = "Option::is_none")]
508 pub lei: Option<String>,
509 #[serde(rename = "Nm", skip_serializing_if = "Option::is_none")]
510 pub nm: Option<String>,
511 #[serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none")]
512 pub pstl_adr: Option<PostalAddress271>,
513}
514
515impl Validate for FinancialInstitutionIdentification231 {
516 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
517 if let Some(ref val) = self.bicfi {
518 helpers::validate_pattern(
519 val,
520 "BICFI",
521 "[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}",
522 &helpers::child_path(path, "BICFI"),
523 config,
524 collector,
525 );
526 }
527 if let Some(ref val) = self.clr_sys_mmb_id
528 && config.validate_optional_fields
529 {
530 val.validate(&helpers::child_path(path, "ClrSysMmbId"), config, collector);
531 }
532 if let Some(ref val) = self.lei {
533 helpers::validate_pattern(
534 val,
535 "LEI",
536 "[A-Z0-9]{18,18}[0-9]{2,2}",
537 &helpers::child_path(path, "LEI"),
538 config,
539 collector,
540 );
541 }
542 if let Some(ref val) = self.nm {
543 helpers::validate_length(
544 val,
545 "Nm",
546 Some(1),
547 Some(140),
548 &helpers::child_path(path, "Nm"),
549 config,
550 collector,
551 );
552 }
553 if let Some(ref val) = self.nm {
554 helpers::validate_pattern(
555 val,
556 "Nm",
557 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
558 &helpers::child_path(path, "Nm"),
559 config,
560 collector,
561 );
562 }
563 if let Some(ref val) = self.pstl_adr
564 && config.validate_optional_fields
565 {
566 val.validate(&helpers::child_path(path, "PstlAdr"), config, collector);
567 }
568 }
569}
570
571#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
573pub struct GenericAccountIdentification11 {
574 #[serde(rename = "Id")]
575 pub id: String,
576 #[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")]
577 pub schme_nm: Option<AccountSchemeName1Choice1>,
578 #[serde(rename = "Issr", skip_serializing_if = "Option::is_none")]
579 pub issr: Option<String>,
580}
581
582impl Validate for GenericAccountIdentification11 {
583 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
584 helpers::validate_length(
585 &self.id,
586 "Id",
587 Some(1),
588 Some(34),
589 &helpers::child_path(path, "Id"),
590 config,
591 collector,
592 );
593 helpers::validate_pattern(
594 &self.id,
595 "Id",
596 "([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]([0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ]*(/[0-9a-zA-Z\\-\\?:\\(\\)\\.,'\\+ ])?)*)",
597 &helpers::child_path(path, "Id"),
598 config,
599 collector,
600 );
601 if let Some(ref val) = self.schme_nm
602 && config.validate_optional_fields
603 {
604 val.validate(&helpers::child_path(path, "SchmeNm"), config, collector);
605 }
606 if let Some(ref val) = self.issr {
607 helpers::validate_length(
608 val,
609 "Issr",
610 Some(1),
611 Some(35),
612 &helpers::child_path(path, "Issr"),
613 config,
614 collector,
615 );
616 }
617 if let Some(ref val) = self.issr {
618 helpers::validate_pattern(
619 val,
620 "Issr",
621 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
622 &helpers::child_path(path, "Issr"),
623 config,
624 collector,
625 );
626 }
627 }
628}
629
630#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
632pub struct GroupHeader1261 {
633 #[serde(rename = "MsgId")]
634 pub msg_id: String,
635 #[serde(rename = "CreDtTm")]
636 pub cre_dt_tm: String,
637 #[serde(rename = "TtlChrgs")]
638 pub ttl_chrgs: TotalCharges71,
639 #[serde(rename = "ChrgsAcct")]
640 pub chrgs_acct: CashAccount401,
641 #[serde(rename = "ChrgsAcctOwnr", skip_serializing_if = "Option::is_none")]
642 pub chrgs_acct_ownr: Option<BranchAndFinancialInstitutionIdentification81>,
643}
644
645impl Validate for GroupHeader1261 {
646 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
647 helpers::validate_length(
648 &self.msg_id,
649 "MsgId",
650 Some(1),
651 Some(35),
652 &helpers::child_path(path, "MsgId"),
653 config,
654 collector,
655 );
656 helpers::validate_pattern(
657 &self.msg_id,
658 "MsgId",
659 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
660 &helpers::child_path(path, "MsgId"),
661 config,
662 collector,
663 );
664 helpers::validate_pattern(
665 &self.cre_dt_tm,
666 "CreDtTm",
667 ".*(\\+|-)((0[0-9])|(1[0-4])):[0-5][0-9]",
668 &helpers::child_path(path, "CreDtTm"),
669 config,
670 collector,
671 );
672 self.ttl_chrgs
673 .validate(&helpers::child_path(path, "TtlChrgs"), config, collector);
674 self.chrgs_acct
675 .validate(&helpers::child_path(path, "ChrgsAcct"), config, collector);
676 if let Some(ref val) = self.chrgs_acct_ownr
677 && config.validate_optional_fields
678 {
679 val.validate(
680 &helpers::child_path(path, "ChrgsAcctOwnr"),
681 config,
682 collector,
683 );
684 }
685 }
686}
687
688#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
690pub struct PostalAddress271 {
691 #[serde(rename = "Dept", skip_serializing_if = "Option::is_none")]
692 pub dept: Option<String>,
693 #[serde(rename = "SubDept", skip_serializing_if = "Option::is_none")]
694 pub sub_dept: Option<String>,
695 #[serde(rename = "StrtNm", skip_serializing_if = "Option::is_none")]
696 pub strt_nm: Option<String>,
697 #[serde(rename = "BldgNb", skip_serializing_if = "Option::is_none")]
698 pub bldg_nb: Option<String>,
699 #[serde(rename = "BldgNm", skip_serializing_if = "Option::is_none")]
700 pub bldg_nm: Option<String>,
701 #[serde(rename = "Flr", skip_serializing_if = "Option::is_none")]
702 pub flr: Option<String>,
703 #[serde(rename = "PstBx", skip_serializing_if = "Option::is_none")]
704 pub pst_bx: Option<String>,
705 #[serde(rename = "Room", skip_serializing_if = "Option::is_none")]
706 pub room: Option<String>,
707 #[serde(rename = "PstCd", skip_serializing_if = "Option::is_none")]
708 pub pst_cd: Option<String>,
709 #[serde(rename = "TwnNm", skip_serializing_if = "Option::is_none")]
710 pub twn_nm: Option<String>,
711 #[serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none")]
712 pub twn_lctn_nm: Option<String>,
713 #[serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none")]
714 pub dstrct_nm: Option<String>,
715 #[serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none")]
716 pub ctry_sub_dvsn: Option<String>,
717 #[serde(rename = "Ctry", skip_serializing_if = "Option::is_none")]
718 pub ctry: Option<String>,
719 #[serde(rename = "AdrLine", skip_serializing_if = "Option::is_none")]
720 pub adr_line: Option<Vec<String>>,
721}
722
723impl Validate for PostalAddress271 {
724 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
725 if let Some(ref val) = self.dept {
726 helpers::validate_length(
727 val,
728 "Dept",
729 Some(1),
730 Some(70),
731 &helpers::child_path(path, "Dept"),
732 config,
733 collector,
734 );
735 }
736 if let Some(ref val) = self.dept {
737 helpers::validate_pattern(
738 val,
739 "Dept",
740 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
741 &helpers::child_path(path, "Dept"),
742 config,
743 collector,
744 );
745 }
746 if let Some(ref val) = self.sub_dept {
747 helpers::validate_length(
748 val,
749 "SubDept",
750 Some(1),
751 Some(70),
752 &helpers::child_path(path, "SubDept"),
753 config,
754 collector,
755 );
756 }
757 if let Some(ref val) = self.sub_dept {
758 helpers::validate_pattern(
759 val,
760 "SubDept",
761 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
762 &helpers::child_path(path, "SubDept"),
763 config,
764 collector,
765 );
766 }
767 if let Some(ref val) = self.strt_nm {
768 helpers::validate_length(
769 val,
770 "StrtNm",
771 Some(1),
772 Some(70),
773 &helpers::child_path(path, "StrtNm"),
774 config,
775 collector,
776 );
777 }
778 if let Some(ref val) = self.strt_nm {
779 helpers::validate_pattern(
780 val,
781 "StrtNm",
782 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
783 &helpers::child_path(path, "StrtNm"),
784 config,
785 collector,
786 );
787 }
788 if let Some(ref val) = self.bldg_nb {
789 helpers::validate_length(
790 val,
791 "BldgNb",
792 Some(1),
793 Some(16),
794 &helpers::child_path(path, "BldgNb"),
795 config,
796 collector,
797 );
798 }
799 if let Some(ref val) = self.bldg_nb {
800 helpers::validate_pattern(
801 val,
802 "BldgNb",
803 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
804 &helpers::child_path(path, "BldgNb"),
805 config,
806 collector,
807 );
808 }
809 if let Some(ref val) = self.bldg_nm {
810 helpers::validate_length(
811 val,
812 "BldgNm",
813 Some(1),
814 Some(35),
815 &helpers::child_path(path, "BldgNm"),
816 config,
817 collector,
818 );
819 }
820 if let Some(ref val) = self.bldg_nm {
821 helpers::validate_pattern(
822 val,
823 "BldgNm",
824 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
825 &helpers::child_path(path, "BldgNm"),
826 config,
827 collector,
828 );
829 }
830 if let Some(ref val) = self.flr {
831 helpers::validate_length(
832 val,
833 "Flr",
834 Some(1),
835 Some(70),
836 &helpers::child_path(path, "Flr"),
837 config,
838 collector,
839 );
840 }
841 if let Some(ref val) = self.flr {
842 helpers::validate_pattern(
843 val,
844 "Flr",
845 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
846 &helpers::child_path(path, "Flr"),
847 config,
848 collector,
849 );
850 }
851 if let Some(ref val) = self.pst_bx {
852 helpers::validate_length(
853 val,
854 "PstBx",
855 Some(1),
856 Some(16),
857 &helpers::child_path(path, "PstBx"),
858 config,
859 collector,
860 );
861 }
862 if let Some(ref val) = self.pst_bx {
863 helpers::validate_pattern(
864 val,
865 "PstBx",
866 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
867 &helpers::child_path(path, "PstBx"),
868 config,
869 collector,
870 );
871 }
872 if let Some(ref val) = self.room {
873 helpers::validate_length(
874 val,
875 "Room",
876 Some(1),
877 Some(70),
878 &helpers::child_path(path, "Room"),
879 config,
880 collector,
881 );
882 }
883 if let Some(ref val) = self.room {
884 helpers::validate_pattern(
885 val,
886 "Room",
887 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
888 &helpers::child_path(path, "Room"),
889 config,
890 collector,
891 );
892 }
893 if let Some(ref val) = self.pst_cd {
894 helpers::validate_length(
895 val,
896 "PstCd",
897 Some(1),
898 Some(16),
899 &helpers::child_path(path, "PstCd"),
900 config,
901 collector,
902 );
903 }
904 if let Some(ref val) = self.pst_cd {
905 helpers::validate_pattern(
906 val,
907 "PstCd",
908 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
909 &helpers::child_path(path, "PstCd"),
910 config,
911 collector,
912 );
913 }
914 if let Some(ref val) = self.twn_nm {
915 helpers::validate_length(
916 val,
917 "TwnNm",
918 Some(1),
919 Some(35),
920 &helpers::child_path(path, "TwnNm"),
921 config,
922 collector,
923 );
924 }
925 if let Some(ref val) = self.twn_nm {
926 helpers::validate_pattern(
927 val,
928 "TwnNm",
929 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
930 &helpers::child_path(path, "TwnNm"),
931 config,
932 collector,
933 );
934 }
935 if let Some(ref val) = self.twn_lctn_nm {
936 helpers::validate_length(
937 val,
938 "TwnLctnNm",
939 Some(1),
940 Some(35),
941 &helpers::child_path(path, "TwnLctnNm"),
942 config,
943 collector,
944 );
945 }
946 if let Some(ref val) = self.twn_lctn_nm {
947 helpers::validate_pattern(
948 val,
949 "TwnLctnNm",
950 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
951 &helpers::child_path(path, "TwnLctnNm"),
952 config,
953 collector,
954 );
955 }
956 if let Some(ref val) = self.dstrct_nm {
957 helpers::validate_length(
958 val,
959 "DstrctNm",
960 Some(1),
961 Some(35),
962 &helpers::child_path(path, "DstrctNm"),
963 config,
964 collector,
965 );
966 }
967 if let Some(ref val) = self.dstrct_nm {
968 helpers::validate_pattern(
969 val,
970 "DstrctNm",
971 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
972 &helpers::child_path(path, "DstrctNm"),
973 config,
974 collector,
975 );
976 }
977 if let Some(ref val) = self.ctry_sub_dvsn {
978 helpers::validate_length(
979 val,
980 "CtrySubDvsn",
981 Some(1),
982 Some(35),
983 &helpers::child_path(path, "CtrySubDvsn"),
984 config,
985 collector,
986 );
987 }
988 if let Some(ref val) = self.ctry_sub_dvsn {
989 helpers::validate_pattern(
990 val,
991 "CtrySubDvsn",
992 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
993 &helpers::child_path(path, "CtrySubDvsn"),
994 config,
995 collector,
996 );
997 }
998 if let Some(ref val) = self.ctry {
999 helpers::validate_pattern(
1000 val,
1001 "Ctry",
1002 "[A-Z]{2,2}",
1003 &helpers::child_path(path, "Ctry"),
1004 config,
1005 collector,
1006 );
1007 }
1008 if let Some(ref vec) = self.adr_line {
1009 for item in vec {
1010 helpers::validate_length(
1011 item,
1012 "AdrLine",
1013 Some(1),
1014 Some(70),
1015 &helpers::child_path(path, "AdrLine"),
1016 config,
1017 collector,
1018 );
1019 }
1020 }
1021 if let Some(ref vec) = self.adr_line {
1022 for item in vec {
1023 helpers::validate_pattern(
1024 item,
1025 "AdrLine",
1026 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
1027 &helpers::child_path(path, "AdrLine"),
1028 config,
1029 collector,
1030 );
1031 }
1032 }
1033 }
1034}
1035
1036#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1038pub struct ProxyAccountIdentification11 {
1039 #[serde(rename = "Tp", skip_serializing_if = "Option::is_none")]
1040 pub tp: Option<ProxyAccountType1Choice1>,
1041 #[serde(rename = "Id")]
1042 pub id: String,
1043}
1044
1045impl Validate for ProxyAccountIdentification11 {
1046 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1047 if let Some(ref val) = self.tp
1048 && config.validate_optional_fields
1049 {
1050 val.validate(&helpers::child_path(path, "Tp"), config, collector);
1051 }
1052 helpers::validate_length(
1053 &self.id,
1054 "Id",
1055 Some(1),
1056 Some(320),
1057 &helpers::child_path(path, "Id"),
1058 config,
1059 collector,
1060 );
1061 helpers::validate_pattern(
1062 &self.id,
1063 "Id",
1064 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !#$%&\\*=^_`\\{\\|\\}~\";<>@\\[\\\\\\]]+",
1065 &helpers::child_path(path, "Id"),
1066 config,
1067 collector,
1068 );
1069 }
1070}
1071
1072#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1074pub struct ProxyAccountType1Choice1 {
1075 #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")]
1076 pub cd: Option<String>,
1077 #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")]
1078 pub prtry: Option<String>,
1079}
1080
1081impl Validate for ProxyAccountType1Choice1 {
1082 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1083 if let Some(ref val) = self.cd {
1084 helpers::validate_length(
1085 val,
1086 "Cd",
1087 Some(1),
1088 Some(4),
1089 &helpers::child_path(path, "Cd"),
1090 config,
1091 collector,
1092 );
1093 }
1094 if let Some(ref val) = self.prtry {
1095 helpers::validate_length(
1096 val,
1097 "Prtry",
1098 Some(1),
1099 Some(35),
1100 &helpers::child_path(path, "Prtry"),
1101 config,
1102 collector,
1103 );
1104 }
1105 if let Some(ref val) = self.prtry {
1106 helpers::validate_pattern(
1107 val,
1108 "Prtry",
1109 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1110 &helpers::child_path(path, "Prtry"),
1111 config,
1112 collector,
1113 );
1114 }
1115 }
1116}
1117
1118#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1121pub struct TotalCharges71 {
1122 #[serde(rename = "NbOfChrgsRcrds")]
1123 pub nb_of_chrgs_rcrds: String,
1124 #[serde(rename = "TtlChrgsAmt")]
1125 pub ttl_chrgs_amt: CBPRAmount,
1126 #[serde(rename = "CdtDbtInd")]
1127 pub cdt_dbt_ind: CreditDebitCode1,
1128}
1129
1130impl Validate for TotalCharges71 {
1131 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1132 helpers::validate_pattern(
1133 &self.nb_of_chrgs_rcrds,
1134 "NbOfChrgsRcrds",
1135 "[0-9]{1,15}",
1136 &helpers::child_path(path, "NbOfChrgsRcrds"),
1137 config,
1138 collector,
1139 );
1140 self.ttl_chrgs_amt
1141 .validate(&helpers::child_path(path, "TtlChrgsAmt"), config, collector);
1142 self.cdt_dbt_ind
1143 .validate(&helpers::child_path(path, "CdtDbtInd"), config, collector);
1144 }
1145}
1146
1147#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1150pub struct TotalCharges81 {
1151 #[serde(rename = "NbOfChrgsBrkdwnItms")]
1152 pub nb_of_chrgs_brkdwn_itms: String,
1153 #[serde(rename = "TtlChrgsAmt")]
1154 pub ttl_chrgs_amt: CBPRAmount,
1155 #[serde(rename = "CdtDbtInd")]
1156 pub cdt_dbt_ind: CreditDebitCode1,
1157}
1158
1159impl Validate for TotalCharges81 {
1160 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1161 helpers::validate_pattern(
1162 &self.nb_of_chrgs_brkdwn_itms,
1163 "NbOfChrgsBrkdwnItms",
1164 "[0-9]{1,15}",
1165 &helpers::child_path(path, "NbOfChrgsBrkdwnItms"),
1166 config,
1167 collector,
1168 );
1169 self.ttl_chrgs_amt
1170 .validate(&helpers::child_path(path, "TtlChrgsAmt"), config, collector);
1171 self.cdt_dbt_ind
1172 .validate(&helpers::child_path(path, "CdtDbtInd"), config, collector);
1173 }
1174}
1175
1176#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq)]
1178pub struct TransactionReferences71 {
1179 #[serde(rename = "MsgId", skip_serializing_if = "Option::is_none")]
1180 pub msg_id: Option<String>,
1181 #[serde(rename = "MsgNmId", skip_serializing_if = "Option::is_none")]
1182 pub msg_nm_id: Option<String>,
1183 #[serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none")]
1184 pub acct_svcr_ref: Option<String>,
1185 #[serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none")]
1186 pub pmt_inf_id: Option<String>,
1187 #[serde(rename = "InstrId", skip_serializing_if = "Option::is_none")]
1188 pub instr_id: Option<String>,
1189 #[serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none")]
1190 pub end_to_end_id: Option<String>,
1191 #[serde(rename = "UETR", skip_serializing_if = "Option::is_none")]
1192 pub uetr: Option<String>,
1193 #[serde(rename = "TxId", skip_serializing_if = "Option::is_none")]
1194 pub tx_id: Option<String>,
1195 #[serde(rename = "MndtId", skip_serializing_if = "Option::is_none")]
1196 pub mndt_id: Option<String>,
1197 #[serde(rename = "ChqNb", skip_serializing_if = "Option::is_none")]
1198 pub chq_nb: Option<String>,
1199 #[serde(rename = "AcctOwnrTxId", skip_serializing_if = "Option::is_none")]
1200 pub acct_ownr_tx_id: Option<String>,
1201 #[serde(rename = "AcctSvcrTxId", skip_serializing_if = "Option::is_none")]
1202 pub acct_svcr_tx_id: Option<String>,
1203 #[serde(rename = "PrcgId", skip_serializing_if = "Option::is_none")]
1204 pub prcg_id: Option<String>,
1205}
1206
1207impl Validate for TransactionReferences71 {
1208 fn validate(&self, path: &str, config: &ParserConfig, collector: &mut ErrorCollector) {
1209 if let Some(ref val) = self.msg_id {
1210 helpers::validate_length(
1211 val,
1212 "MsgId",
1213 Some(1),
1214 Some(35),
1215 &helpers::child_path(path, "MsgId"),
1216 config,
1217 collector,
1218 );
1219 }
1220 if let Some(ref val) = self.msg_id {
1221 helpers::validate_pattern(
1222 val,
1223 "MsgId",
1224 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1225 &helpers::child_path(path, "MsgId"),
1226 config,
1227 collector,
1228 );
1229 }
1230 if let Some(ref val) = self.msg_nm_id {
1231 helpers::validate_length(
1232 val,
1233 "MsgNmId",
1234 Some(1),
1235 Some(35),
1236 &helpers::child_path(path, "MsgNmId"),
1237 config,
1238 collector,
1239 );
1240 }
1241 if let Some(ref val) = self.msg_nm_id {
1242 helpers::validate_pattern(
1243 val,
1244 "MsgNmId",
1245 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1246 &helpers::child_path(path, "MsgNmId"),
1247 config,
1248 collector,
1249 );
1250 }
1251 if let Some(ref val) = self.acct_svcr_ref {
1252 helpers::validate_length(
1253 val,
1254 "AcctSvcrRef",
1255 Some(1),
1256 Some(35),
1257 &helpers::child_path(path, "AcctSvcrRef"),
1258 config,
1259 collector,
1260 );
1261 }
1262 if let Some(ref val) = self.acct_svcr_ref {
1263 helpers::validate_pattern(
1264 val,
1265 "AcctSvcrRef",
1266 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1267 &helpers::child_path(path, "AcctSvcrRef"),
1268 config,
1269 collector,
1270 );
1271 }
1272 if let Some(ref val) = self.pmt_inf_id {
1273 helpers::validate_length(
1274 val,
1275 "PmtInfId",
1276 Some(1),
1277 Some(35),
1278 &helpers::child_path(path, "PmtInfId"),
1279 config,
1280 collector,
1281 );
1282 }
1283 if let Some(ref val) = self.pmt_inf_id {
1284 helpers::validate_pattern(
1285 val,
1286 "PmtInfId",
1287 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1288 &helpers::child_path(path, "PmtInfId"),
1289 config,
1290 collector,
1291 );
1292 }
1293 if let Some(ref val) = self.instr_id {
1294 helpers::validate_length(
1295 val,
1296 "InstrId",
1297 Some(1),
1298 Some(16),
1299 &helpers::child_path(path, "InstrId"),
1300 config,
1301 collector,
1302 );
1303 }
1304 if let Some(ref val) = self.instr_id {
1305 helpers::validate_pattern(
1306 val,
1307 "InstrId",
1308 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1309 &helpers::child_path(path, "InstrId"),
1310 config,
1311 collector,
1312 );
1313 }
1314 if let Some(ref val) = self.end_to_end_id {
1315 helpers::validate_length(
1316 val,
1317 "EndToEndId",
1318 Some(1),
1319 Some(35),
1320 &helpers::child_path(path, "EndToEndId"),
1321 config,
1322 collector,
1323 );
1324 }
1325 if let Some(ref val) = self.end_to_end_id {
1326 helpers::validate_pattern(
1327 val,
1328 "EndToEndId",
1329 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1330 &helpers::child_path(path, "EndToEndId"),
1331 config,
1332 collector,
1333 );
1334 }
1335 if let Some(ref val) = self.uetr {
1336 helpers::validate_pattern(
1337 val,
1338 "UETR",
1339 "[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}",
1340 &helpers::child_path(path, "UETR"),
1341 config,
1342 collector,
1343 );
1344 }
1345 if let Some(ref val) = self.tx_id {
1346 helpers::validate_length(
1347 val,
1348 "TxId",
1349 Some(1),
1350 Some(35),
1351 &helpers::child_path(path, "TxId"),
1352 config,
1353 collector,
1354 );
1355 }
1356 if let Some(ref val) = self.tx_id {
1357 helpers::validate_pattern(
1358 val,
1359 "TxId",
1360 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1361 &helpers::child_path(path, "TxId"),
1362 config,
1363 collector,
1364 );
1365 }
1366 if let Some(ref val) = self.mndt_id {
1367 helpers::validate_length(
1368 val,
1369 "MndtId",
1370 Some(1),
1371 Some(35),
1372 &helpers::child_path(path, "MndtId"),
1373 config,
1374 collector,
1375 );
1376 }
1377 if let Some(ref val) = self.mndt_id {
1378 helpers::validate_pattern(
1379 val,
1380 "MndtId",
1381 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1382 &helpers::child_path(path, "MndtId"),
1383 config,
1384 collector,
1385 );
1386 }
1387 if let Some(ref val) = self.chq_nb {
1388 helpers::validate_length(
1389 val,
1390 "ChqNb",
1391 Some(1),
1392 Some(35),
1393 &helpers::child_path(path, "ChqNb"),
1394 config,
1395 collector,
1396 );
1397 }
1398 if let Some(ref val) = self.chq_nb {
1399 helpers::validate_pattern(
1400 val,
1401 "ChqNb",
1402 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1403 &helpers::child_path(path, "ChqNb"),
1404 config,
1405 collector,
1406 );
1407 }
1408 if let Some(ref val) = self.acct_ownr_tx_id {
1409 helpers::validate_length(
1410 val,
1411 "AcctOwnrTxId",
1412 Some(1),
1413 Some(35),
1414 &helpers::child_path(path, "AcctOwnrTxId"),
1415 config,
1416 collector,
1417 );
1418 }
1419 if let Some(ref val) = self.acct_ownr_tx_id {
1420 helpers::validate_pattern(
1421 val,
1422 "AcctOwnrTxId",
1423 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1424 &helpers::child_path(path, "AcctOwnrTxId"),
1425 config,
1426 collector,
1427 );
1428 }
1429 if let Some(ref val) = self.acct_svcr_tx_id {
1430 helpers::validate_length(
1431 val,
1432 "AcctSvcrTxId",
1433 Some(1),
1434 Some(35),
1435 &helpers::child_path(path, "AcctSvcrTxId"),
1436 config,
1437 collector,
1438 );
1439 }
1440 if let Some(ref val) = self.acct_svcr_tx_id {
1441 helpers::validate_pattern(
1442 val,
1443 "AcctSvcrTxId",
1444 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1445 &helpers::child_path(path, "AcctSvcrTxId"),
1446 config,
1447 collector,
1448 );
1449 }
1450 if let Some(ref val) = self.prcg_id {
1451 helpers::validate_length(
1452 val,
1453 "PrcgId",
1454 Some(1),
1455 Some(35),
1456 &helpers::child_path(path, "PrcgId"),
1457 config,
1458 collector,
1459 );
1460 }
1461 if let Some(ref val) = self.prcg_id {
1462 helpers::validate_pattern(
1463 val,
1464 "PrcgId",
1465 "[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ ]+",
1466 &helpers::child_path(path, "PrcgId"),
1467 config,
1468 collector,
1469 );
1470 }
1471 }
1472}