open_payments_fednow/
common.rs

1// Open Payment Message Parsing Library
2// https://github.com/Open-Payments/messages
3//
4// This library is designed to parse message formats based on the ISO 20022 standards,
5// including but not limited to FedNow messages. It supports various financial message types,
6// such as customer credit transfers, payment status reports, administrative notifications, 
7// and other ISO 20022 messages, using Serde for efficient serialization and deserialization.
8//
9// Copyright (c) 2024 Open Payments by Harishankar Narayanan
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14//     http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21//
22// You may obtain a copy of this library at
23// https://github.com/Open-Payments/messages
24
25#![allow(unused_imports)]
26use regex::Regex;
27
28#[cfg(feature = "derive_serde")]
29use serde::{Deserialize, Serialize};
30use open_payments_common::ValidationError;
31use crate::document::Document;
32use crate::fednow_extra::key_exchange::*;
33
34
35// AccountDebitCreditNotification ...
36#[cfg_attr(feature = "derive_debug", derive(Debug))]
37#[cfg_attr(feature = "derive_default", derive(Default))]
38#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
39#[cfg_attr(feature = "derive_clone", derive(Clone))]
40#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
41pub struct AccountDebitCreditNotification {
42	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
43	pub bah_app_hdr: BusinessApplicationHeaderV02,
44	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
45	pub c54_document: Document,
46}
47
48impl AccountDebitCreditNotification {
49	pub fn validate(&self) -> Result<(), ValidationError> {
50		self.bah_app_hdr.validate()?;
51		self.c54_document.validate()?;
52		Ok(())
53	}
54}
55
56
57// FedNowAccountActivityDetailsReport ...
58#[cfg_attr(feature = "derive_debug", derive(Debug))]
59#[cfg_attr(feature = "derive_default", derive(Default))]
60#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
61#[cfg_attr(feature = "derive_clone", derive(Clone))]
62#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
63pub struct FedNowAccountActivityDetailsReport {
64	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
65	pub bah_app_hdr: BusinessApplicationHeaderV02,
66	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
67	pub c52_document: Document,
68}
69
70impl FedNowAccountActivityDetailsReport {
71	pub fn validate(&self) -> Result<(), ValidationError> {
72		self.bah_app_hdr.validate()?;
73		self.c52_document.validate()?;
74		Ok(())
75	}
76}
77
78
79// FedNowAccountActivityTotalsReport ...
80#[cfg_attr(feature = "derive_debug", derive(Debug))]
81#[cfg_attr(feature = "derive_default", derive(Default))]
82#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
83#[cfg_attr(feature = "derive_clone", derive(Clone))]
84#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
85pub struct FedNowAccountActivityTotalsReport {
86	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
87	pub bah_app_hdr: BusinessApplicationHeaderV02,
88	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
89	pub c52_document: Document,
90}
91
92impl FedNowAccountActivityTotalsReport {
93	pub fn validate(&self) -> Result<(), ValidationError> {
94		self.bah_app_hdr.validate()?;
95		self.c52_document.validate()?;
96		Ok(())
97	}
98}
99
100
101// FedNowAccountBalanceReport ...
102#[cfg_attr(feature = "derive_debug", derive(Debug))]
103#[cfg_attr(feature = "derive_default", derive(Default))]
104#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
105#[cfg_attr(feature = "derive_clone", derive(Clone))]
106#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
107pub struct FedNowAccountBalanceReport {
108	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
109	pub bah_app_hdr: BusinessApplicationHeaderV02,
110	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
111	pub c52_document: Document,
112}
113
114impl FedNowAccountBalanceReport {
115	pub fn validate(&self) -> Result<(), ValidationError> {
116		self.bah_app_hdr.validate()?;
117		self.c52_document.validate()?;
118		Ok(())
119	}
120}
121
122
123// FedNowAccountReportingRequest ...
124#[cfg_attr(feature = "derive_debug", derive(Debug))]
125#[cfg_attr(feature = "derive_default", derive(Default))]
126#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
127#[cfg_attr(feature = "derive_clone", derive(Clone))]
128#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
129pub struct FedNowAccountReportingRequest {
130	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
131	pub bah_app_hdr: BusinessApplicationHeaderV02,
132	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
133	pub c60_document: Document,
134}
135
136impl FedNowAccountReportingRequest {
137	pub fn validate(&self) -> Result<(), ValidationError> {
138		self.bah_app_hdr.validate()?;
139		self.c60_document.validate()?;
140		Ok(())
141	}
142}
143
144
145// FedNowAdditionalPaymentInformation ...
146#[cfg_attr(feature = "derive_debug", derive(Debug))]
147#[cfg_attr(feature = "derive_default", derive(Default))]
148#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
149#[cfg_attr(feature = "derive_clone", derive(Clone))]
150#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
151pub struct FedNowAdditionalPaymentInformation {
152	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
153	pub bah_app_hdr: BusinessApplicationHeaderV02,
154	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
155	pub c28_document: Document,
156}
157
158impl FedNowAdditionalPaymentInformation {
159	pub fn validate(&self) -> Result<(), ValidationError> {
160		self.bah_app_hdr.validate()?;
161		self.c28_document.validate()?;
162		Ok(())
163	}
164}
165
166
167// FedNowBroadcast ...
168#[cfg_attr(feature = "derive_debug", derive(Debug))]
169#[cfg_attr(feature = "derive_default", derive(Default))]
170#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
171#[cfg_attr(feature = "derive_clone", derive(Clone))]
172#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
173pub struct FedNowBroadcast {
174	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
175	pub bah_app_hdr: BusinessApplicationHeaderV02,
176	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
177	pub a4_document: Document,
178}
179
180impl FedNowBroadcast {
181	pub fn validate(&self) -> Result<(), ValidationError> {
182		self.bah_app_hdr.validate()?;
183		self.a4_document.validate()?;
184		Ok(())
185	}
186}
187
188
189// FedNowCustomerCreditTransfer ...
190#[cfg_attr(feature = "derive_debug", derive(Debug))]
191#[cfg_attr(feature = "derive_default", derive(Default))]
192#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
193#[cfg_attr(feature = "derive_clone", derive(Clone))]
194#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
195pub struct FedNowCustomerCreditTransfer {
196	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
197	pub bah_app_hdr: BusinessApplicationHeaderV02,
198	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
199	pub p8_document: Document,
200}
201
202impl FedNowCustomerCreditTransfer {
203	pub fn validate(&self) -> Result<(), ValidationError> {
204		self.bah_app_hdr.validate()?;
205		self.p8_document.validate()?;
206		Ok(())
207	}
208}
209
210
211// FedNowIncomingMessage ...
212#[cfg_attr(feature = "derive_debug", derive(Debug))]
213#[cfg_attr(feature = "derive_default", derive(Default))]
214#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
215#[cfg_attr(feature = "derive_clone", derive(Clone))]
216#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
217pub struct FedNowIncomingMessage {
218	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowMessageReject", skip_serializing_if = "Option::is_none") )]
219	pub fed_now_message_reject: Option<FedNowMessageReject>,
220	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowParticipantBroadcast", skip_serializing_if = "Option::is_none") )]
221	pub fed_now_participant_broadcast: Option<FedNowParticipantBroadcast>,
222	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRetrievalRequest", skip_serializing_if = "Option::is_none") )]
223	pub fed_now_retrieval_request: Option<FedNowRetrievalRequest>,
224	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReceiptAcknowledgement", skip_serializing_if = "Option::is_none") )]
225	pub fed_now_receipt_acknowledgement: Option<FedNowReceiptAcknowledgement>,
226	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentStatus", skip_serializing_if = "Option::is_none") )]
227	pub fed_now_payment_status: Option<FedNowPaymentStatus>,
228	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentReturn", skip_serializing_if = "Option::is_none") )]
229	pub fed_now_payment_return: Option<FedNowPaymentReturn>,
230	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowCustomerCreditTransfer", skip_serializing_if = "Option::is_none") )]
231	pub fed_now_customer_credit_transfer: Option<FedNowCustomerCreditTransfer>,
232	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInstitutionCreditTransfer", skip_serializing_if = "Option::is_none") )]
233	pub fed_now_institution_credit_transfer: Option<FedNowInstitutionCreditTransfer>,
234	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentStatusRequest", skip_serializing_if = "Option::is_none") )]
235	pub fed_now_payment_status_request: Option<FedNowPaymentStatusRequest>,
236	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPayment", skip_serializing_if = "Option::is_none") )]
237	pub fed_now_request_for_payment: Option<FedNowRequestForPayment>,
238	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentResponse", skip_serializing_if = "Option::is_none") )]
239	pub fed_now_request_for_payment_response: Option<FedNowRequestForPaymentResponse>,
240	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInformationRequest", skip_serializing_if = "Option::is_none") )]
241	pub fed_now_information_request: Option<FedNowInformationRequest>,
242	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAdditionalPaymentInformation", skip_serializing_if = "Option::is_none") )]
243	pub fed_now_additional_payment_information: Option<FedNowAdditionalPaymentInformation>,
244	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInformationRequestResponse", skip_serializing_if = "Option::is_none") )]
245	pub fed_now_information_request_response: Option<FedNowInformationRequestResponse>,
246	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentCancellationRequestResponse", skip_serializing_if = "Option::is_none") )]
247	pub fed_now_request_for_payment_cancellation_request_response: Option<FedNowRequestForPaymentCancellationRequestResponse>,
248	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReturnRequestResponse", skip_serializing_if = "Option::is_none") )]
249	pub fed_now_return_request_response: Option<FedNowReturnRequestResponse>,
250	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentCancellationRequest", skip_serializing_if = "Option::is_none") )]
251	pub fed_now_request_for_payment_cancellation_request: Option<FedNowRequestForPaymentCancellationRequest>,
252	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReturnRequest", skip_serializing_if = "Option::is_none") )]
253	pub fed_now_return_request: Option<FedNowReturnRequest>,
254	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAccountReportingRequest", skip_serializing_if = "Option::is_none") )]
255	pub fed_now_account_reporting_request: Option<FedNowAccountReportingRequest>,
256	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowIncomingMessageSignatureManagement", skip_serializing_if = "Option::is_none") )]
257	pub fed_now_incoming_message_signature_management: Option<FedNowIncomingMessageSignatureManagement>,
258}
259
260impl FedNowIncomingMessage {
261	pub fn validate(&self) -> Result<(), ValidationError> {
262		if let Some(ref val) = self.fed_now_message_reject { val.validate()? }
263		if let Some(ref val) = self.fed_now_participant_broadcast { val.validate()? }
264		if let Some(ref val) = self.fed_now_retrieval_request { val.validate()? }
265		if let Some(ref val) = self.fed_now_receipt_acknowledgement { val.validate()? }
266		if let Some(ref val) = self.fed_now_payment_status { val.validate()? }
267		if let Some(ref val) = self.fed_now_payment_return { val.validate()? }
268		if let Some(ref val) = self.fed_now_customer_credit_transfer { val.validate()? }
269		if let Some(ref val) = self.fed_now_institution_credit_transfer { val.validate()? }
270		if let Some(ref val) = self.fed_now_payment_status_request { val.validate()? }
271		if let Some(ref val) = self.fed_now_request_for_payment { val.validate()? }
272		if let Some(ref val) = self.fed_now_request_for_payment_response { val.validate()? }
273		if let Some(ref val) = self.fed_now_information_request { val.validate()? }
274		if let Some(ref val) = self.fed_now_additional_payment_information { val.validate()? }
275		if let Some(ref val) = self.fed_now_information_request_response { val.validate()? }
276		if let Some(ref val) = self.fed_now_request_for_payment_cancellation_request_response { val.validate()? }
277		if let Some(ref val) = self.fed_now_return_request_response { val.validate()? }
278		if let Some(ref val) = self.fed_now_request_for_payment_cancellation_request { val.validate()? }
279		if let Some(ref val) = self.fed_now_return_request { val.validate()? }
280		if let Some(ref val) = self.fed_now_account_reporting_request { val.validate()? }
281		if let Some(ref val) = self.fed_now_incoming_message_signature_management { val.validate()? }
282		Ok(())
283	}
284}
285
286
287// FedNowIncomingMessageSignatureManagement ...
288#[cfg_attr(feature = "derive_debug", derive(Debug))]
289#[cfg_attr(feature = "derive_default", derive(Default))]
290#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
291#[cfg_attr(feature = "derive_clone", derive(Clone))]
292#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
293pub struct FedNowIncomingMessageSignatureManagement {
294	#[cfg_attr( feature = "derive_serde", serde(rename = "SenderId") )]
295	pub sender_id: String,
296	#[cfg_attr( feature = "derive_serde", serde(rename = "GetAllFedNowActivePublicKeys", skip_serializing_if = "Option::is_none") )]
297	pub ke_get_all_fed_now_active_public_keys: Option<GetAllFedNowActivePublicKeys>,
298	#[cfg_attr( feature = "derive_serde", serde(rename = "GetAllCustomerPublicKeys", skip_serializing_if = "Option::is_none") )]
299	pub ke_get_all_customer_public_keys: Option<GetAllCustomerPublicKeys>,
300	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowMessageSignatureKeyExchange", skip_serializing_if = "Option::is_none") )]
301	pub ke_fed_now_message_signature_key_exchange: Option<FedNowMessageSignatureKeyExchange>,
302}
303
304impl FedNowIncomingMessageSignatureManagement {
305	pub fn validate(&self) -> Result<(), ValidationError> {
306		if let Some(ref val) = self.ke_get_all_fed_now_active_public_keys { val.validate()? }
307		if let Some(ref val) = self.ke_get_all_customer_public_keys { val.validate()? }
308		if let Some(ref val) = self.ke_fed_now_message_signature_key_exchange { val.validate()? }
309		Ok(())
310	}
311}
312
313
314// FedNowInformationRequest ...
315#[cfg_attr(feature = "derive_debug", derive(Debug))]
316#[cfg_attr(feature = "derive_default", derive(Default))]
317#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
318#[cfg_attr(feature = "derive_clone", derive(Clone))]
319#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
320pub struct FedNowInformationRequest {
321	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
322	pub bah_app_hdr: BusinessApplicationHeaderV02,
323	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
324	pub c26_document: Document,
325}
326
327impl FedNowInformationRequest {
328	pub fn validate(&self) -> Result<(), ValidationError> {
329		self.bah_app_hdr.validate()?;
330		self.c26_document.validate()?;
331		Ok(())
332	}
333}
334
335
336// FedNowInformationRequestResponse ...
337#[cfg_attr(feature = "derive_debug", derive(Debug))]
338#[cfg_attr(feature = "derive_default", derive(Default))]
339#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
340#[cfg_attr(feature = "derive_clone", derive(Clone))]
341#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
342pub struct FedNowInformationRequestResponse {
343	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
344	pub bah_app_hdr: BusinessApplicationHeaderV02,
345	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
346	pub c29_document: Document,
347}
348
349impl FedNowInformationRequestResponse {
350	pub fn validate(&self) -> Result<(), ValidationError> {
351		self.bah_app_hdr.validate()?;
352		self.c29_document.validate()?;
353		Ok(())
354	}
355}
356
357
358// FedNowInstitutionCreditTransfer ...
359#[cfg_attr(feature = "derive_debug", derive(Debug))]
360#[cfg_attr(feature = "derive_default", derive(Default))]
361#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
362#[cfg_attr(feature = "derive_clone", derive(Clone))]
363#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
364pub struct FedNowInstitutionCreditTransfer {
365	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
366	pub bah_app_hdr: BusinessApplicationHeaderV02,
367	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
368	pub p9_document: Document,
369}
370
371impl FedNowInstitutionCreditTransfer {
372	pub fn validate(&self) -> Result<(), ValidationError> {
373		self.bah_app_hdr.validate()?;
374		self.p9_document.validate()?;
375		Ok(())
376	}
377}
378
379
380// FedNowMessageReject ...
381#[cfg_attr(feature = "derive_debug", derive(Debug))]
382#[cfg_attr(feature = "derive_default", derive(Default))]
383#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
384#[cfg_attr(feature = "derive_clone", derive(Clone))]
385#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
386pub struct FedNowMessageReject {
387	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
388	pub bah_app_hdr: BusinessApplicationHeaderV02,
389	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
390	pub a2_document: Document,
391}
392
393impl FedNowMessageReject {
394	pub fn validate(&self) -> Result<(), ValidationError> {
395		self.bah_app_hdr.validate()?;
396		self.a2_document.validate()?;
397		Ok(())
398	}
399}
400
401
402// FedNowOutgoingMessage ...
403#[cfg_attr(feature = "derive_debug", derive(Debug))]
404#[cfg_attr(feature = "derive_default", derive(Default))]
405#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
406#[cfg_attr(feature = "derive_clone", derive(Clone))]
407#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
408pub struct FedNowOutgoingMessage {
409	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowMessageReject", skip_serializing_if = "Option::is_none") )]
410	pub fed_now_message_reject: Option<FedNowMessageReject>,
411	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowBroadcast", skip_serializing_if = "Option::is_none") )]
412	pub fed_now_broadcast: Option<FedNowBroadcast>,
413	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReceiptAcknowledgement", skip_serializing_if = "Option::is_none") )]
414	pub fed_now_receipt_acknowledgement: Option<FedNowReceiptAcknowledgement>,
415	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowSystemResponse", skip_serializing_if = "Option::is_none") )]
416	pub fed_now_system_response: Option<FedNowSystemResponse>,
417	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowParticipantFile", skip_serializing_if = "Option::is_none") )]
418	pub fed_now_participant_file: Option<FedNowParticipantFile>,
419	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentStatus", skip_serializing_if = "Option::is_none") )]
420	pub fed_now_payment_status: Option<FedNowPaymentStatus>,
421	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentReturn", skip_serializing_if = "Option::is_none") )]
422	pub fed_now_payment_return: Option<FedNowPaymentReturn>,
423	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowCustomerCreditTransfer", skip_serializing_if = "Option::is_none") )]
424	pub fed_now_customer_credit_transfer: Option<FedNowCustomerCreditTransfer>,
425	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInstitutionCreditTransfer", skip_serializing_if = "Option::is_none") )]
426	pub fed_now_institution_credit_transfer: Option<FedNowInstitutionCreditTransfer>,
427	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPaymentStatusRequest", skip_serializing_if = "Option::is_none") )]
428	pub fed_now_payment_status_request: Option<FedNowPaymentStatusRequest>,
429	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPayment", skip_serializing_if = "Option::is_none") )]
430	pub fed_now_request_for_payment: Option<FedNowRequestForPayment>,
431	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentResponse", skip_serializing_if = "Option::is_none") )]
432	pub fed_now_request_for_payment_response: Option<FedNowRequestForPaymentResponse>,
433	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInformationRequest", skip_serializing_if = "Option::is_none") )]
434	pub fed_now_information_request: Option<FedNowInformationRequest>,
435	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAdditionalPaymentInformation", skip_serializing_if = "Option::is_none") )]
436	pub fed_now_additional_payment_information: Option<FedNowAdditionalPaymentInformation>,
437	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReturnRequestResponse", skip_serializing_if = "Option::is_none") )]
438	pub fed_now_return_request_response: Option<FedNowReturnRequestResponse>,
439	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowInformationRequestResponse", skip_serializing_if = "Option::is_none") )]
440	pub fed_now_information_request_response: Option<FedNowInformationRequestResponse>,
441	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAccountActivityDetailsReport", skip_serializing_if = "Option::is_none") )]
442	pub fed_now_account_activity_details_report: Option<FedNowAccountActivityDetailsReport>,
443	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAccountActivityTotalsReport", skip_serializing_if = "Option::is_none") )]
444	pub fed_now_account_activity_totals_report: Option<FedNowAccountActivityTotalsReport>,
445	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowAccountBalanceReport", skip_serializing_if = "Option::is_none") )]
446	pub fed_now_account_balance_report: Option<FedNowAccountBalanceReport>,
447	#[cfg_attr( feature = "derive_serde", serde(rename = "AccountDebitCreditNotification", skip_serializing_if = "Option::is_none") )]
448	pub account_debit_credit_notification: Option<AccountDebitCreditNotification>,
449	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentCancellationRequest", skip_serializing_if = "Option::is_none") )]
450	pub fed_now_request_for_payment_cancellation_request: Option<FedNowRequestForPaymentCancellationRequest>,
451	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowRequestForPaymentCancellationRequestResponse", skip_serializing_if = "Option::is_none") )]
452	pub fed_now_request_for_payment_cancellation_request_response: Option<FedNowRequestForPaymentCancellationRequestResponse>,
453	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowReturnRequest", skip_serializing_if = "Option::is_none") )]
454	pub fed_now_return_request: Option<FedNowReturnRequest>,
455	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowOutgoingMessageSignatureManagement", skip_serializing_if = "Option::is_none") )]
456	pub fed_now_outgoing_message_signature_management: Option<FedNowOutgoingMessageSignatureManagement>,
457}
458
459impl FedNowOutgoingMessage {
460	pub fn validate(&self) -> Result<(), ValidationError> {
461		if let Some(ref val) = self.fed_now_message_reject { val.validate()? }
462		if let Some(ref val) = self.fed_now_broadcast { val.validate()? }
463		if let Some(ref val) = self.fed_now_receipt_acknowledgement { val.validate()? }
464		if let Some(ref val) = self.fed_now_system_response { val.validate()? }
465		if let Some(ref val) = self.fed_now_participant_file { val.validate()? }
466		if let Some(ref val) = self.fed_now_payment_status { val.validate()? }
467		if let Some(ref val) = self.fed_now_payment_return { val.validate()? }
468		if let Some(ref val) = self.fed_now_customer_credit_transfer { val.validate()? }
469		if let Some(ref val) = self.fed_now_institution_credit_transfer { val.validate()? }
470		if let Some(ref val) = self.fed_now_payment_status_request { val.validate()? }
471		if let Some(ref val) = self.fed_now_request_for_payment { val.validate()? }
472		if let Some(ref val) = self.fed_now_request_for_payment_response { val.validate()? }
473		if let Some(ref val) = self.fed_now_information_request { val.validate()? }
474		if let Some(ref val) = self.fed_now_additional_payment_information { val.validate()? }
475		if let Some(ref val) = self.fed_now_return_request_response { val.validate()? }
476		if let Some(ref val) = self.fed_now_information_request_response { val.validate()? }
477		if let Some(ref val) = self.fed_now_account_activity_details_report { val.validate()? }
478		if let Some(ref val) = self.fed_now_account_activity_totals_report { val.validate()? }
479		if let Some(ref val) = self.fed_now_account_balance_report { val.validate()? }
480		if let Some(ref val) = self.account_debit_credit_notification { val.validate()? }
481		if let Some(ref val) = self.fed_now_request_for_payment_cancellation_request { val.validate()? }
482		if let Some(ref val) = self.fed_now_request_for_payment_cancellation_request_response { val.validate()? }
483		if let Some(ref val) = self.fed_now_return_request { val.validate()? }
484		if let Some(ref val) = self.fed_now_outgoing_message_signature_management { val.validate()? }
485		Ok(())
486	}
487}
488
489
490// FedNowOutgoingMessageSignatureManagement ...
491#[cfg_attr(feature = "derive_debug", derive(Debug))]
492#[cfg_attr(feature = "derive_default", derive(Default))]
493#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
494#[cfg_attr(feature = "derive_clone", derive(Clone))]
495#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
496pub struct FedNowOutgoingMessageSignatureManagement {
497	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowPublicKeyResponses", skip_serializing_if = "Option::is_none") )]
498	pub ke_fed_now_public_key_responses: Option<FedNowPublicKeyResponses>,
499	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowCustomerMessageSignatureKeyOperationResponse", skip_serializing_if = "Option::is_none") )]
500	pub ke_fed_now_customer_message_signature_key_operation_response: Option<FedNowCustomerMessageSignatureKeyOperationResponse>,
501}
502
503impl FedNowOutgoingMessageSignatureManagement {
504	pub fn validate(&self) -> Result<(), ValidationError> {
505		if let Some(ref val) = self.ke_fed_now_public_key_responses { val.validate()? }
506		if let Some(ref val) = self.ke_fed_now_customer_message_signature_key_operation_response { val.validate()? }
507		Ok(())
508	}
509}
510
511
512// FedNowParticipantBroadcast ...
513#[cfg_attr(feature = "derive_debug", derive(Debug))]
514#[cfg_attr(feature = "derive_default", derive(Default))]
515#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
516#[cfg_attr(feature = "derive_clone", derive(Clone))]
517#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
518pub struct FedNowParticipantBroadcast {
519	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
520	pub bah_app_hdr: BusinessApplicationHeaderV02,
521	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
522	pub a4_document: Document,
523}
524
525impl FedNowParticipantBroadcast {
526	pub fn validate(&self) -> Result<(), ValidationError> {
527		self.bah_app_hdr.validate()?;
528		self.a4_document.validate()?;
529		Ok(())
530	}
531}
532
533
534// FedNowParticipantFile ...
535#[cfg_attr(feature = "derive_debug", derive(Debug))]
536#[cfg_attr(feature = "derive_default", derive(Default))]
537#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
538#[cfg_attr(feature = "derive_clone", derive(Clone))]
539#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
540pub struct FedNowParticipantFile {
541	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
542	pub bah_app_hdr: BusinessApplicationHeaderV02,
543	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
544	pub a998_document: Document,
545}
546
547impl FedNowParticipantFile {
548	pub fn validate(&self) -> Result<(), ValidationError> {
549		self.bah_app_hdr.validate()?;
550		self.a998_document.validate()?;
551		Ok(())
552	}
553}
554
555
556// FedNowPaymentReturn ...
557#[cfg_attr(feature = "derive_debug", derive(Debug))]
558#[cfg_attr(feature = "derive_default", derive(Default))]
559#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
560#[cfg_attr(feature = "derive_clone", derive(Clone))]
561#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
562pub struct FedNowPaymentReturn {
563	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
564	pub bah_app_hdr: BusinessApplicationHeaderV02,
565	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
566	pub p4_document: Document,
567}
568
569impl FedNowPaymentReturn {
570	pub fn validate(&self) -> Result<(), ValidationError> {
571		self.bah_app_hdr.validate()?;
572		self.p4_document.validate()?;
573		Ok(())
574	}
575}
576
577
578// FedNowPaymentStatus ...
579#[cfg_attr(feature = "derive_debug", derive(Debug))]
580#[cfg_attr(feature = "derive_default", derive(Default))]
581#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
582#[cfg_attr(feature = "derive_clone", derive(Clone))]
583#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
584pub struct FedNowPaymentStatus {
585	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
586	pub bah_app_hdr: BusinessApplicationHeaderV02,
587	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
588	pub p2_document: Document,
589}
590
591impl FedNowPaymentStatus {
592	pub fn validate(&self) -> Result<(), ValidationError> {
593		self.bah_app_hdr.validate()?;
594		self.p2_document.validate()?;
595		Ok(())
596	}
597}
598
599
600// FedNowPaymentStatusRequest ...
601#[cfg_attr(feature = "derive_debug", derive(Debug))]
602#[cfg_attr(feature = "derive_default", derive(Default))]
603#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
604#[cfg_attr(feature = "derive_clone", derive(Clone))]
605#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
606pub struct FedNowPaymentStatusRequest {
607	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
608	pub bah_app_hdr: BusinessApplicationHeaderV02,
609	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
610	pub p28_document: Document,
611}
612
613impl FedNowPaymentStatusRequest {
614	pub fn validate(&self) -> Result<(), ValidationError> {
615		self.bah_app_hdr.validate()?;
616		self.p28_document.validate()?;
617		Ok(())
618	}
619}
620
621
622// FedNowReceiptAcknowledgement ...
623#[cfg_attr(feature = "derive_debug", derive(Debug))]
624#[cfg_attr(feature = "derive_default", derive(Default))]
625#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
626#[cfg_attr(feature = "derive_clone", derive(Clone))]
627#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
628pub struct FedNowReceiptAcknowledgement {
629	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
630	pub bah_app_hdr: BusinessApplicationHeaderV02,
631	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
632	pub a7_document: Document,
633}
634
635impl FedNowReceiptAcknowledgement {
636	pub fn validate(&self) -> Result<(), ValidationError> {
637		self.bah_app_hdr.validate()?;
638		self.a7_document.validate()?;
639		Ok(())
640	}
641}
642
643
644// FedNowRequestForPayment ...
645#[cfg_attr(feature = "derive_debug", derive(Debug))]
646#[cfg_attr(feature = "derive_default", derive(Default))]
647#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
648#[cfg_attr(feature = "derive_clone", derive(Clone))]
649#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
650pub struct FedNowRequestForPayment {
651	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
652	pub bah_app_hdr: BusinessApplicationHeaderV02,
653	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
654	pub pain13_document: Document,
655}
656
657impl FedNowRequestForPayment {
658	pub fn validate(&self) -> Result<(), ValidationError> {
659		self.bah_app_hdr.validate()?;
660		self.pain13_document.validate()?;
661		Ok(())
662	}
663}
664
665
666// FedNowRequestForPaymentCancellationRequest ...
667#[cfg_attr(feature = "derive_debug", derive(Debug))]
668#[cfg_attr(feature = "derive_default", derive(Default))]
669#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
670#[cfg_attr(feature = "derive_clone", derive(Clone))]
671#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
672pub struct FedNowRequestForPaymentCancellationRequest {
673	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
674	pub bah_app_hdr: BusinessApplicationHeaderV02,
675	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
676	pub c55_document: Document,
677}
678
679impl FedNowRequestForPaymentCancellationRequest {
680	pub fn validate(&self) -> Result<(), ValidationError> {
681		self.bah_app_hdr.validate()?;
682		self.c55_document.validate()?;
683		Ok(())
684	}
685}
686
687
688// FedNowRequestForPaymentCancellationRequestResponse ...
689#[cfg_attr(feature = "derive_debug", derive(Debug))]
690#[cfg_attr(feature = "derive_default", derive(Default))]
691#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
692#[cfg_attr(feature = "derive_clone", derive(Clone))]
693#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
694pub struct FedNowRequestForPaymentCancellationRequestResponse {
695	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
696	pub bah_app_hdr: BusinessApplicationHeaderV02,
697	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
698	pub c29_document: Document,
699}
700
701impl FedNowRequestForPaymentCancellationRequestResponse {
702	pub fn validate(&self) -> Result<(), ValidationError> {
703		self.bah_app_hdr.validate()?;
704		self.c29_document.validate()?;
705		Ok(())
706	}
707}
708
709
710// FedNowRequestForPaymentResponse ...
711#[cfg_attr(feature = "derive_debug", derive(Debug))]
712#[cfg_attr(feature = "derive_default", derive(Default))]
713#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
714#[cfg_attr(feature = "derive_clone", derive(Clone))]
715#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
716pub struct FedNowRequestForPaymentResponse {
717	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
718	pub bah_app_hdr: BusinessApplicationHeaderV02,
719	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
720	pub pain14_document: Document,
721}
722
723impl FedNowRequestForPaymentResponse {
724	pub fn validate(&self) -> Result<(), ValidationError> {
725		self.bah_app_hdr.validate()?;
726		self.pain14_document.validate()?;
727		Ok(())
728	}
729}
730
731
732// FedNowRetrievalRequest ...
733#[cfg_attr(feature = "derive_debug", derive(Debug))]
734#[cfg_attr(feature = "derive_default", derive(Default))]
735#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
736#[cfg_attr(feature = "derive_clone", derive(Clone))]
737#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
738pub struct FedNowRetrievalRequest {
739	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
740	pub bah_app_hdr: BusinessApplicationHeaderV02,
741	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
742	pub a6_document: Document,
743}
744
745impl FedNowRetrievalRequest {
746	pub fn validate(&self) -> Result<(), ValidationError> {
747		self.bah_app_hdr.validate()?;
748		self.a6_document.validate()?;
749		Ok(())
750	}
751}
752
753
754// FedNowReturnRequest ...
755#[cfg_attr(feature = "derive_debug", derive(Debug))]
756#[cfg_attr(feature = "derive_default", derive(Default))]
757#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
758#[cfg_attr(feature = "derive_clone", derive(Clone))]
759#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
760pub struct FedNowReturnRequest {
761	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
762	pub bah_app_hdr: BusinessApplicationHeaderV02,
763	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
764	pub c56_document: Document,
765}
766
767impl FedNowReturnRequest {
768	pub fn validate(&self) -> Result<(), ValidationError> {
769		self.bah_app_hdr.validate()?;
770		self.c56_document.validate()?;
771		Ok(())
772	}
773}
774
775
776// FedNowReturnRequestResponse ...
777#[cfg_attr(feature = "derive_debug", derive(Debug))]
778#[cfg_attr(feature = "derive_default", derive(Default))]
779#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "derive_clone", derive(Clone))]
781#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
782pub struct FedNowReturnRequestResponse {
783	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
784	pub bah_app_hdr: BusinessApplicationHeaderV02,
785	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
786	pub c29_document: Document,
787}
788
789impl FedNowReturnRequestResponse {
790	pub fn validate(&self) -> Result<(), ValidationError> {
791		self.bah_app_hdr.validate()?;
792		self.c29_document.validate()?;
793		Ok(())
794	}
795}
796
797
798// FedNowSystemResponse ...
799#[cfg_attr(feature = "derive_debug", derive(Debug))]
800#[cfg_attr(feature = "derive_default", derive(Default))]
801#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
802#[cfg_attr(feature = "derive_clone", derive(Clone))]
803#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
804pub struct FedNowSystemResponse {
805	#[cfg_attr( feature = "derive_serde", serde(rename = "AppHdr") )]
806	pub bah_app_hdr: BusinessApplicationHeaderV02,
807	#[cfg_attr( feature = "derive_serde", serde(rename = "Document") )]
808	pub a11_document: Document,
809}
810
811impl FedNowSystemResponse {
812	pub fn validate(&self) -> Result<(), ValidationError> {
813		self.bah_app_hdr.validate()?;
814		self.a11_document.validate()?;
815		Ok(())
816	}
817}
818
819
820// FedNowTechnicalHeader ...
821#[cfg_attr(feature = "derive_debug", derive(Debug))]
822#[cfg_attr(feature = "derive_default", derive(Default))]
823#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
824#[cfg_attr(feature = "derive_clone", derive(Clone))]
825#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
826pub struct FedNowTechnicalHeader {
827}
828
829impl FedNowTechnicalHeader {
830	pub fn validate(&self) -> Result<(), ValidationError> {
831		Ok(())
832	}
833}
834
835
836// AccountIdentification4Choice ...
837#[cfg_attr(feature = "derive_debug", derive(Debug))]
838#[cfg_attr(feature = "derive_default", derive(Default))]
839#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
840#[cfg_attr(feature = "derive_clone", derive(Clone))]
841#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
842pub struct AccountIdentification4Choice {
843	#[cfg_attr( feature = "derive_serde", serde(rename = "IBAN", skip_serializing_if = "Option::is_none") )]
844	pub iban: Option<String>,
845	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
846	pub othr: Option<GenericAccountIdentification1>,
847}
848
849impl AccountIdentification4Choice {
850	pub fn validate(&self) -> Result<(), ValidationError> {
851		if let Some(ref val) = self.iban {
852			let pattern = Regex::new("[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}").unwrap();
853			if !pattern.is_match(val) {
854				return Err(ValidationError::new(1005, "iban does not match the required pattern".to_string()));
855			}
856		}
857		if let Some(ref val) = self.othr { val.validate()? }
858		Ok(())
859	}
860}
861
862
863// AccountInterest4 ...
864#[cfg_attr(feature = "derive_debug", derive(Debug))]
865#[cfg_attr(feature = "derive_default", derive(Default))]
866#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
867#[cfg_attr(feature = "derive_clone", derive(Clone))]
868#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
869pub struct AccountInterest4 {
870	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
871	pub tp: Option<InterestType1Choice>,
872	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
873	pub rate: Option<Vec<Rate4>>,
874	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt", skip_serializing_if = "Option::is_none") )]
875	pub fr_to_dt: Option<DateTimePeriod1>,
876	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
877	pub rsn: Option<String>,
878	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
879	pub tax: Option<TaxCharges2>,
880}
881
882impl AccountInterest4 {
883	pub fn validate(&self) -> Result<(), ValidationError> {
884		if let Some(ref val) = self.tp { val.validate()? }
885		if let Some(ref vec) = self.rate { for item in vec { item.validate()? } }
886		if let Some(ref val) = self.fr_to_dt { val.validate()? }
887		if let Some(ref val) = self.rsn {
888			if val.chars().count() < 1 {
889				return Err(ValidationError::new(1001, "rsn is shorter than the minimum length of 1".to_string()));
890			}
891			if val.chars().count() > 35 {
892				return Err(ValidationError::new(1002, "rsn exceeds the maximum length of 35".to_string()));
893			}
894		}
895		if let Some(ref val) = self.tax { val.validate()? }
896		Ok(())
897	}
898}
899
900
901// AccountNotification17 ...
902#[cfg_attr(feature = "derive_debug", derive(Debug))]
903#[cfg_attr(feature = "derive_default", derive(Default))]
904#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
905#[cfg_attr(feature = "derive_clone", derive(Clone))]
906#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
907pub struct AccountNotification17 {
908	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
909	pub id: String,
910	#[cfg_attr( feature = "derive_serde", serde(rename = "NtfctnPgntn", skip_serializing_if = "Option::is_none") )]
911	pub ntfctn_pgntn: Option<Pagination1>,
912	#[cfg_attr( feature = "derive_serde", serde(rename = "ElctrncSeqNb", skip_serializing_if = "Option::is_none") )]
913	pub elctrnc_seq_nb: Option<f64>,
914	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgSeq", skip_serializing_if = "Option::is_none") )]
915	pub rptg_seq: Option<SequenceRange1Choice>,
916	#[cfg_attr( feature = "derive_serde", serde(rename = "LglSeqNb", skip_serializing_if = "Option::is_none") )]
917	pub lgl_seq_nb: Option<f64>,
918	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
919	pub cre_dt_tm: Option<String>,
920	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt", skip_serializing_if = "Option::is_none") )]
921	pub fr_to_dt: Option<DateTimePeriod1>,
922	#[cfg_attr( feature = "derive_serde", serde(rename = "CpyDplctInd", skip_serializing_if = "Option::is_none") )]
923	pub cpy_dplct_ind: Option<CopyDuplicate1Code>,
924	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgSrc", skip_serializing_if = "Option::is_none") )]
925	pub rptg_src: Option<ReportingSource1Choice>,
926	#[cfg_attr( feature = "derive_serde", serde(rename = "Acct") )]
927	pub acct: CashAccount39,
928	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdAcct", skip_serializing_if = "Option::is_none") )]
929	pub rltd_acct: Option<CashAccount38>,
930	#[cfg_attr( feature = "derive_serde", serde(rename = "Intrst", skip_serializing_if = "Option::is_none") )]
931	pub intrst: Option<Vec<AccountInterest4>>,
932	#[cfg_attr( feature = "derive_serde", serde(rename = "TxsSummry", skip_serializing_if = "Option::is_none") )]
933	pub txs_summry: Option<TotalTransactions6>,
934	#[cfg_attr( feature = "derive_serde", serde(rename = "Ntry", skip_serializing_if = "Option::is_none") )]
935	pub ntry: Option<Vec<ReportEntry10>>,
936	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlNtfctnInf", skip_serializing_if = "Option::is_none") )]
937	pub addtl_ntfctn_inf: Option<String>,
938}
939
940impl AccountNotification17 {
941	pub fn validate(&self) -> Result<(), ValidationError> {
942		if self.id.chars().count() < 1 {
943			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
944		}
945		if self.id.chars().count() > 35 {
946			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
947		}
948		if let Some(ref val) = self.ntfctn_pgntn { val.validate()? }
949		if let Some(ref val) = self.rptg_seq { val.validate()? }
950		if let Some(ref val) = self.fr_to_dt { val.validate()? }
951		if let Some(ref val) = self.cpy_dplct_ind { val.validate()? }
952		if let Some(ref val) = self.rptg_src { val.validate()? }
953		self.acct.validate()?;
954		if let Some(ref val) = self.rltd_acct { val.validate()? }
955		if let Some(ref vec) = self.intrst { for item in vec { item.validate()? } }
956		if let Some(ref val) = self.txs_summry { val.validate()? }
957		if let Some(ref vec) = self.ntry { for item in vec { item.validate()? } }
958		if let Some(ref val) = self.addtl_ntfctn_inf {
959			if val.chars().count() < 1 {
960				return Err(ValidationError::new(1001, "addtl_ntfctn_inf is shorter than the minimum length of 1".to_string()));
961			}
962			if val.chars().count() > 500 {
963				return Err(ValidationError::new(1002, "addtl_ntfctn_inf exceeds the maximum length of 500".to_string()));
964			}
965		}
966		Ok(())
967	}
968}
969
970
971// AccountReport25 ...
972#[cfg_attr(feature = "derive_debug", derive(Debug))]
973#[cfg_attr(feature = "derive_default", derive(Default))]
974#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
975#[cfg_attr(feature = "derive_clone", derive(Clone))]
976#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
977pub struct AccountReport25 {
978	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
979	pub id: String,
980	#[cfg_attr( feature = "derive_serde", serde(rename = "RptPgntn", skip_serializing_if = "Option::is_none") )]
981	pub rpt_pgntn: Option<Pagination1>,
982	#[cfg_attr( feature = "derive_serde", serde(rename = "ElctrncSeqNb", skip_serializing_if = "Option::is_none") )]
983	pub elctrnc_seq_nb: Option<f64>,
984	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgSeq", skip_serializing_if = "Option::is_none") )]
985	pub rptg_seq: Option<SequenceRange1Choice>,
986	#[cfg_attr( feature = "derive_serde", serde(rename = "LglSeqNb", skip_serializing_if = "Option::is_none") )]
987	pub lgl_seq_nb: Option<f64>,
988	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
989	pub cre_dt_tm: Option<String>,
990	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt", skip_serializing_if = "Option::is_none") )]
991	pub fr_to_dt: Option<DateTimePeriod1>,
992	#[cfg_attr( feature = "derive_serde", serde(rename = "CpyDplctInd", skip_serializing_if = "Option::is_none") )]
993	pub cpy_dplct_ind: Option<CopyDuplicate1Code>,
994	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgSrc", skip_serializing_if = "Option::is_none") )]
995	pub rptg_src: Option<ReportingSource1Choice>,
996	#[cfg_attr( feature = "derive_serde", serde(rename = "Acct") )]
997	pub acct: CashAccount39,
998	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdAcct", skip_serializing_if = "Option::is_none") )]
999	pub rltd_acct: Option<CashAccount38>,
1000	#[cfg_attr( feature = "derive_serde", serde(rename = "Intrst", skip_serializing_if = "Option::is_none") )]
1001	pub intrst: Option<Vec<AccountInterest4>>,
1002	#[cfg_attr( feature = "derive_serde", serde(rename = "Bal", skip_serializing_if = "Option::is_none") )]
1003	pub bal: Option<Vec<CashBalance8>>,
1004	#[cfg_attr( feature = "derive_serde", serde(rename = "TxsSummry", skip_serializing_if = "Option::is_none") )]
1005	pub txs_summry: Option<TotalTransactions6>,
1006	#[cfg_attr( feature = "derive_serde", serde(rename = "Ntry", skip_serializing_if = "Option::is_none") )]
1007	pub ntry: Option<Vec<ReportEntry10>>,
1008	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlRptInf", skip_serializing_if = "Option::is_none") )]
1009	pub addtl_rpt_inf: Option<String>,
1010}
1011
1012impl AccountReport25 {
1013	pub fn validate(&self) -> Result<(), ValidationError> {
1014		if self.id.chars().count() < 1 {
1015			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
1016		}
1017		if self.id.chars().count() > 35 {
1018			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
1019		}
1020		if let Some(ref val) = self.rpt_pgntn { val.validate()? }
1021		if let Some(ref val) = self.rptg_seq { val.validate()? }
1022		if let Some(ref val) = self.fr_to_dt { val.validate()? }
1023		if let Some(ref val) = self.cpy_dplct_ind { val.validate()? }
1024		if let Some(ref val) = self.rptg_src { val.validate()? }
1025		self.acct.validate()?;
1026		if let Some(ref val) = self.rltd_acct { val.validate()? }
1027		if let Some(ref vec) = self.intrst { for item in vec { item.validate()? } }
1028		if let Some(ref vec) = self.bal { for item in vec { item.validate()? } }
1029		if let Some(ref val) = self.txs_summry { val.validate()? }
1030		if let Some(ref vec) = self.ntry { for item in vec { item.validate()? } }
1031		if let Some(ref val) = self.addtl_rpt_inf {
1032			if val.chars().count() < 1 {
1033				return Err(ValidationError::new(1001, "addtl_rpt_inf is shorter than the minimum length of 1".to_string()));
1034			}
1035			if val.chars().count() > 500 {
1036				return Err(ValidationError::new(1002, "addtl_rpt_inf exceeds the maximum length of 500".to_string()));
1037			}
1038		}
1039		Ok(())
1040	}
1041}
1042
1043
1044// AccountSchemeName1Choice ...
1045#[cfg_attr(feature = "derive_debug", derive(Debug))]
1046#[cfg_attr(feature = "derive_default", derive(Default))]
1047#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1048#[cfg_attr(feature = "derive_clone", derive(Clone))]
1049#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1050pub struct AccountSchemeName1Choice {
1051	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
1052	pub cd: Option<String>,
1053	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1054	pub prtry: Option<String>,
1055}
1056
1057impl AccountSchemeName1Choice {
1058	pub fn validate(&self) -> Result<(), ValidationError> {
1059		if let Some(ref val) = self.cd {
1060			if val.chars().count() < 1 {
1061				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
1062			}
1063			if val.chars().count() > 4 {
1064				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
1065			}
1066		}
1067		if let Some(ref val) = self.prtry {
1068			if val.chars().count() < 1 {
1069				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
1070			}
1071			if val.chars().count() > 35 {
1072				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
1073			}
1074		}
1075		Ok(())
1076	}
1077}
1078
1079
1080// ActiveCurrencyAndAmount ...
1081#[cfg_attr(feature = "derive_debug", derive(Debug))]
1082#[cfg_attr(feature = "derive_default", derive(Default))]
1083#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1084#[cfg_attr(feature = "derive_clone", derive(Clone))]
1085#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1086pub struct ActiveCurrencyAndAmount {
1087	#[cfg_attr( feature = "derive_serde", serde(rename = "@Ccy") )]
1088	pub ccy: String,
1089	#[cfg_attr( feature = "derive_serde", serde(rename = "$value") )]
1090	pub value: f64,
1091}
1092
1093impl ActiveCurrencyAndAmount {
1094	pub fn validate(&self) -> Result<(), ValidationError> {
1095		Ok(())
1096	}
1097}
1098
1099
1100// ActiveOrHistoricCurrencyAnd13DecimalAmount ...
1101#[cfg_attr(feature = "derive_debug", derive(Debug))]
1102#[cfg_attr(feature = "derive_default", derive(Default))]
1103#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1104#[cfg_attr(feature = "derive_clone", derive(Clone))]
1105#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1106pub struct ActiveOrHistoricCurrencyAnd13DecimalAmount {
1107	#[cfg_attr( feature = "derive_serde", serde(rename = "@Ccy") )]
1108	pub ccy: String,
1109	#[cfg_attr( feature = "derive_serde", serde(rename = "$value") )]
1110	pub value: f64,
1111}
1112
1113impl ActiveOrHistoricCurrencyAnd13DecimalAmount {
1114	pub fn validate(&self) -> Result<(), ValidationError> {
1115		Ok(())
1116	}
1117}
1118
1119
1120// ActiveOrHistoricCurrencyAndAmount ...
1121#[cfg_attr(feature = "derive_debug", derive(Debug))]
1122#[cfg_attr(feature = "derive_default", derive(Default))]
1123#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1124#[cfg_attr(feature = "derive_clone", derive(Clone))]
1125#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1126pub struct ActiveOrHistoricCurrencyAndAmount {
1127	#[cfg_attr( feature = "derive_serde", serde(rename = "@Ccy") )]
1128	pub ccy: String,
1129	#[cfg_attr( feature = "derive_serde", serde(rename = "$value") )]
1130	pub value: f64,
1131}
1132
1133impl ActiveOrHistoricCurrencyAndAmount {
1134	pub fn validate(&self) -> Result<(), ValidationError> {
1135		Ok(())
1136	}
1137}
1138
1139
1140// ActiveOrHistoricCurrencyAndAmountRange2 ...
1141#[cfg_attr(feature = "derive_debug", derive(Debug))]
1142#[cfg_attr(feature = "derive_default", derive(Default))]
1143#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1144#[cfg_attr(feature = "derive_clone", derive(Clone))]
1145#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1146pub struct ActiveOrHistoricCurrencyAndAmountRange2 {
1147	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
1148	pub amt: ImpliedCurrencyAmountRange1Choice,
1149	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none") )]
1150	pub cdt_dbt_ind: Option<CreditDebitCode>,
1151	#[cfg_attr( feature = "derive_serde", serde(rename = "Ccy") )]
1152	pub ccy: String,
1153}
1154
1155impl ActiveOrHistoricCurrencyAndAmountRange2 {
1156	pub fn validate(&self) -> Result<(), ValidationError> {
1157		self.amt.validate()?;
1158		if let Some(ref val) = self.cdt_dbt_ind { val.validate()? }
1159		let pattern = Regex::new("[A-Z]{3,3}").unwrap();
1160		if !pattern.is_match(&self.ccy) {
1161			return Err(ValidationError::new(1005, "ccy does not match the required pattern".to_string()));
1162		}
1163		Ok(())
1164	}
1165}
1166
1167
1168// AddressType2Code ...
1169#[cfg_attr(feature = "derive_debug", derive(Debug))]
1170#[cfg_attr(feature = "derive_default", derive(Default))]
1171#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1172#[cfg_attr(feature = "derive_clone", derive(Clone))]
1173#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1174pub enum AddressType2Code {
1175	#[cfg_attr(feature = "derive_default", default)]
1176	#[cfg_attr( feature = "derive_serde", serde(rename = "ADDR") )]
1177	CodeADDR,
1178	#[cfg_attr( feature = "derive_serde", serde(rename = "PBOX") )]
1179	CodePBOX,
1180	#[cfg_attr( feature = "derive_serde", serde(rename = "HOME") )]
1181	CodeHOME,
1182	#[cfg_attr( feature = "derive_serde", serde(rename = "BIZZ") )]
1183	CodeBIZZ,
1184	#[cfg_attr( feature = "derive_serde", serde(rename = "MLTO") )]
1185	CodeMLTO,
1186	#[cfg_attr( feature = "derive_serde", serde(rename = "DLVY") )]
1187	CodeDLVY,
1188}
1189
1190impl AddressType2Code {
1191	pub fn validate(&self) -> Result<(), ValidationError> {
1192		Ok(())
1193	}
1194}
1195
1196
1197// AddressType3Choice ...
1198#[cfg_attr(feature = "derive_debug", derive(Debug))]
1199#[cfg_attr(feature = "derive_default", derive(Default))]
1200#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1201#[cfg_attr(feature = "derive_clone", derive(Clone))]
1202#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1203pub struct AddressType3Choice {
1204	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
1205	pub cd: Option<AddressType2Code>,
1206	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1207	pub prtry: Option<GenericIdentification30>,
1208}
1209
1210impl AddressType3Choice {
1211	pub fn validate(&self) -> Result<(), ValidationError> {
1212		if let Some(ref val) = self.cd { val.validate()? }
1213		if let Some(ref val) = self.prtry { val.validate()? }
1214		Ok(())
1215	}
1216}
1217
1218
1219// AmendmentInformationDetails13 ...
1220#[cfg_attr(feature = "derive_debug", derive(Debug))]
1221#[cfg_attr(feature = "derive_default", derive(Default))]
1222#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1223#[cfg_attr(feature = "derive_clone", derive(Clone))]
1224#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1225pub struct AmendmentInformationDetails13 {
1226	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMndtId", skip_serializing_if = "Option::is_none") )]
1227	pub orgnl_mndt_id: Option<String>,
1228	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCdtrSchmeId", skip_serializing_if = "Option::is_none") )]
1229	pub orgnl_cdtr_schme_id: Option<PartyIdentification135>,
1230	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCdtrAgt", skip_serializing_if = "Option::is_none") )]
1231	pub orgnl_cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
1232	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
1233	pub orgnl_cdtr_agt_acct: Option<CashAccount38>,
1234	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlDbtr", skip_serializing_if = "Option::is_none") )]
1235	pub orgnl_dbtr: Option<PartyIdentification135>,
1236	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlDbtrAcct", skip_serializing_if = "Option::is_none") )]
1237	pub orgnl_dbtr_acct: Option<CashAccount38>,
1238	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlDbtrAgt", skip_serializing_if = "Option::is_none") )]
1239	pub orgnl_dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
1240	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlDbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
1241	pub orgnl_dbtr_agt_acct: Option<CashAccount38>,
1242	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlFnlColltnDt", skip_serializing_if = "Option::is_none") )]
1243	pub orgnl_fnl_colltn_dt: Option<String>,
1244	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlFrqcy", skip_serializing_if = "Option::is_none") )]
1245	pub orgnl_frqcy: Option<Frequency36Choice>,
1246	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlRsn", skip_serializing_if = "Option::is_none") )]
1247	pub orgnl_rsn: Option<MandateSetupReason1Choice>,
1248	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTrckgDays", skip_serializing_if = "Option::is_none") )]
1249	pub orgnl_trckg_days: Option<String>,
1250}
1251
1252impl AmendmentInformationDetails13 {
1253	pub fn validate(&self) -> Result<(), ValidationError> {
1254		if let Some(ref val) = self.orgnl_mndt_id {
1255			if val.chars().count() < 1 {
1256				return Err(ValidationError::new(1001, "orgnl_mndt_id is shorter than the minimum length of 1".to_string()));
1257			}
1258			if val.chars().count() > 35 {
1259				return Err(ValidationError::new(1002, "orgnl_mndt_id exceeds the maximum length of 35".to_string()));
1260			}
1261		}
1262		if let Some(ref val) = self.orgnl_cdtr_schme_id { val.validate()? }
1263		if let Some(ref val) = self.orgnl_cdtr_agt { val.validate()? }
1264		if let Some(ref val) = self.orgnl_cdtr_agt_acct { val.validate()? }
1265		if let Some(ref val) = self.orgnl_dbtr { val.validate()? }
1266		if let Some(ref val) = self.orgnl_dbtr_acct { val.validate()? }
1267		if let Some(ref val) = self.orgnl_dbtr_agt { val.validate()? }
1268		if let Some(ref val) = self.orgnl_dbtr_agt_acct { val.validate()? }
1269		if let Some(ref val) = self.orgnl_frqcy { val.validate()? }
1270		if let Some(ref val) = self.orgnl_rsn { val.validate()? }
1271		if let Some(ref val) = self.orgnl_trckg_days {
1272			let pattern = Regex::new("[0-9]{2}").unwrap();
1273			if !pattern.is_match(val) {
1274				return Err(ValidationError::new(1005, "orgnl_trckg_days does not match the required pattern".to_string()));
1275			}
1276		}
1277		Ok(())
1278	}
1279}
1280
1281
1282// AmountAndCurrencyExchange3 ...
1283#[cfg_attr(feature = "derive_debug", derive(Debug))]
1284#[cfg_attr(feature = "derive_default", derive(Default))]
1285#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1286#[cfg_attr(feature = "derive_clone", derive(Clone))]
1287#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1288pub struct AmountAndCurrencyExchange3 {
1289	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none") )]
1290	pub instd_amt: Option<AmountAndCurrencyExchangeDetails3>,
1291	#[cfg_attr( feature = "derive_serde", serde(rename = "TxAmt", skip_serializing_if = "Option::is_none") )]
1292	pub tx_amt: Option<AmountAndCurrencyExchangeDetails3>,
1293	#[cfg_attr( feature = "derive_serde", serde(rename = "CntrValAmt", skip_serializing_if = "Option::is_none") )]
1294	pub cntr_val_amt: Option<AmountAndCurrencyExchangeDetails3>,
1295	#[cfg_attr( feature = "derive_serde", serde(rename = "AnncdPstngAmt", skip_serializing_if = "Option::is_none") )]
1296	pub anncd_pstng_amt: Option<AmountAndCurrencyExchangeDetails3>,
1297	#[cfg_attr( feature = "derive_serde", serde(rename = "PrtryAmt", skip_serializing_if = "Option::is_none") )]
1298	pub prtry_amt: Option<Vec<AmountAndCurrencyExchangeDetails4>>,
1299}
1300
1301impl AmountAndCurrencyExchange3 {
1302	pub fn validate(&self) -> Result<(), ValidationError> {
1303		if let Some(ref val) = self.instd_amt { val.validate()? }
1304		if let Some(ref val) = self.tx_amt { val.validate()? }
1305		if let Some(ref val) = self.cntr_val_amt { val.validate()? }
1306		if let Some(ref val) = self.anncd_pstng_amt { val.validate()? }
1307		if let Some(ref vec) = self.prtry_amt { for item in vec { item.validate()? } }
1308		Ok(())
1309	}
1310}
1311
1312
1313// AmountAndCurrencyExchangeDetails3 ...
1314#[cfg_attr(feature = "derive_debug", derive(Debug))]
1315#[cfg_attr(feature = "derive_default", derive(Default))]
1316#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1317#[cfg_attr(feature = "derive_clone", derive(Clone))]
1318#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1319pub struct AmountAndCurrencyExchangeDetails3 {
1320	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
1321	pub amt: ActiveOrHistoricCurrencyAndAmount,
1322	#[cfg_attr( feature = "derive_serde", serde(rename = "CcyXchg", skip_serializing_if = "Option::is_none") )]
1323	pub ccy_xchg: Option<CurrencyExchange5>,
1324}
1325
1326impl AmountAndCurrencyExchangeDetails3 {
1327	pub fn validate(&self) -> Result<(), ValidationError> {
1328		self.amt.validate()?;
1329		if let Some(ref val) = self.ccy_xchg { val.validate()? }
1330		Ok(())
1331	}
1332}
1333
1334
1335// AmountAndCurrencyExchangeDetails4 ...
1336#[cfg_attr(feature = "derive_debug", derive(Debug))]
1337#[cfg_attr(feature = "derive_default", derive(Default))]
1338#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1339#[cfg_attr(feature = "derive_clone", derive(Clone))]
1340#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1341pub struct AmountAndCurrencyExchangeDetails4 {
1342	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
1343	pub tp: String,
1344	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
1345	pub amt: ActiveOrHistoricCurrencyAndAmount,
1346	#[cfg_attr( feature = "derive_serde", serde(rename = "CcyXchg", skip_serializing_if = "Option::is_none") )]
1347	pub ccy_xchg: Option<CurrencyExchange5>,
1348}
1349
1350impl AmountAndCurrencyExchangeDetails4 {
1351	pub fn validate(&self) -> Result<(), ValidationError> {
1352		if self.tp.chars().count() < 1 {
1353			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
1354		}
1355		if self.tp.chars().count() > 35 {
1356			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
1357		}
1358		self.amt.validate()?;
1359		if let Some(ref val) = self.ccy_xchg { val.validate()? }
1360		Ok(())
1361	}
1362}
1363
1364
1365// AmountAndDirection35 ...
1366#[cfg_attr(feature = "derive_debug", derive(Debug))]
1367#[cfg_attr(feature = "derive_default", derive(Default))]
1368#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1369#[cfg_attr(feature = "derive_clone", derive(Clone))]
1370#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1371pub struct AmountAndDirection35 {
1372	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
1373	pub amt: f64,
1374	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
1375	pub cdt_dbt_ind: CreditDebitCode,
1376}
1377
1378impl AmountAndDirection35 {
1379	pub fn validate(&self) -> Result<(), ValidationError> {
1380		if self.amt < 0.000000 {
1381			return Err(ValidationError::new(1003, "amt is less than the minimum value of 0.000000".to_string()));
1382		}
1383		self.cdt_dbt_ind.validate()?;
1384		Ok(())
1385	}
1386}
1387
1388
1389// AmountOrRate1Choice ...
1390#[cfg_attr(feature = "derive_debug", derive(Debug))]
1391#[cfg_attr(feature = "derive_default", derive(Default))]
1392#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1393#[cfg_attr(feature = "derive_clone", derive(Clone))]
1394#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1395pub struct AmountOrRate1Choice {
1396	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
1397	pub amt: Option<ActiveCurrencyAndAmount>,
1398	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
1399	pub rate: Option<f64>,
1400}
1401
1402impl AmountOrRate1Choice {
1403	pub fn validate(&self) -> Result<(), ValidationError> {
1404		if let Some(ref val) = self.amt { val.validate()? }
1405		Ok(())
1406	}
1407}
1408
1409
1410// AmountRangeBoundary1 ...
1411#[cfg_attr(feature = "derive_debug", derive(Debug))]
1412#[cfg_attr(feature = "derive_default", derive(Default))]
1413#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1414#[cfg_attr(feature = "derive_clone", derive(Clone))]
1415#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1416pub struct AmountRangeBoundary1 {
1417	#[cfg_attr( feature = "derive_serde", serde(rename = "BdryAmt") )]
1418	pub bdry_amt: f64,
1419	#[cfg_attr( feature = "derive_serde", serde(rename = "Incl") )]
1420	pub incl: bool,
1421}
1422
1423impl AmountRangeBoundary1 {
1424	pub fn validate(&self) -> Result<(), ValidationError> {
1425		if self.bdry_amt < 0.000000 {
1426			return Err(ValidationError::new(1003, "bdry_amt is less than the minimum value of 0.000000".to_string()));
1427		}
1428		Ok(())
1429	}
1430}
1431
1432
1433// AmountType4Choice ...
1434#[cfg_attr(feature = "derive_debug", derive(Debug))]
1435#[cfg_attr(feature = "derive_default", derive(Default))]
1436#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1437#[cfg_attr(feature = "derive_clone", derive(Clone))]
1438#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1439pub struct AmountType4Choice {
1440	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none") )]
1441	pub instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
1442	#[cfg_attr( feature = "derive_serde", serde(rename = "EqvtAmt", skip_serializing_if = "Option::is_none") )]
1443	pub eqvt_amt: Option<EquivalentAmount2>,
1444}
1445
1446impl AmountType4Choice {
1447	pub fn validate(&self) -> Result<(), ValidationError> {
1448		if let Some(ref val) = self.instd_amt { val.validate()? }
1449		if let Some(ref val) = self.eqvt_amt { val.validate()? }
1450		Ok(())
1451	}
1452}
1453
1454
1455// AttendanceContext1Code ...
1456#[cfg_attr(feature = "derive_debug", derive(Debug))]
1457#[cfg_attr(feature = "derive_default", derive(Default))]
1458#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1459#[cfg_attr(feature = "derive_clone", derive(Clone))]
1460#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1461pub enum AttendanceContext1Code {
1462	#[cfg_attr(feature = "derive_default", default)]
1463	#[cfg_attr( feature = "derive_serde", serde(rename = "ATTD") )]
1464	CodeATTD,
1465	#[cfg_attr( feature = "derive_serde", serde(rename = "SATT") )]
1466	CodeSATT,
1467	#[cfg_attr( feature = "derive_serde", serde(rename = "UATT") )]
1468	CodeUATT,
1469}
1470
1471impl AttendanceContext1Code {
1472	pub fn validate(&self) -> Result<(), ValidationError> {
1473		Ok(())
1474	}
1475}
1476
1477
1478// AuthenticationEntity1Code ...
1479#[cfg_attr(feature = "derive_debug", derive(Debug))]
1480#[cfg_attr(feature = "derive_default", derive(Default))]
1481#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1482#[cfg_attr(feature = "derive_clone", derive(Clone))]
1483#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1484pub enum AuthenticationEntity1Code {
1485	#[cfg_attr(feature = "derive_default", default)]
1486	#[cfg_attr( feature = "derive_serde", serde(rename = "ICCD") )]
1487	CodeICCD,
1488	#[cfg_attr( feature = "derive_serde", serde(rename = "AGNT") )]
1489	CodeAGNT,
1490	#[cfg_attr( feature = "derive_serde", serde(rename = "MERC") )]
1491	CodeMERC,
1492}
1493
1494impl AuthenticationEntity1Code {
1495	pub fn validate(&self) -> Result<(), ValidationError> {
1496		Ok(())
1497	}
1498}
1499
1500
1501// AuthenticationMethod1Code ...
1502#[cfg_attr(feature = "derive_debug", derive(Debug))]
1503#[cfg_attr(feature = "derive_default", derive(Default))]
1504#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1505#[cfg_attr(feature = "derive_clone", derive(Clone))]
1506#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1507pub enum AuthenticationMethod1Code {
1508	#[cfg_attr(feature = "derive_default", default)]
1509	#[cfg_attr( feature = "derive_serde", serde(rename = "UKNW") )]
1510	CodeUKNW,
1511	#[cfg_attr( feature = "derive_serde", serde(rename = "BYPS") )]
1512	CodeBYPS,
1513	#[cfg_attr( feature = "derive_serde", serde(rename = "NPIN") )]
1514	CodeNPIN,
1515	#[cfg_attr( feature = "derive_serde", serde(rename = "FPIN") )]
1516	CodeFPIN,
1517	#[cfg_attr( feature = "derive_serde", serde(rename = "CPSG") )]
1518	CodeCPSG,
1519	#[cfg_attr( feature = "derive_serde", serde(rename = "PPSG") )]
1520	CodePPSG,
1521	#[cfg_attr( feature = "derive_serde", serde(rename = "MANU") )]
1522	CodeMANU,
1523	#[cfg_attr( feature = "derive_serde", serde(rename = "MERC") )]
1524	CodeMERC,
1525	#[cfg_attr( feature = "derive_serde", serde(rename = "SCRT") )]
1526	CodeSCRT,
1527	#[cfg_attr( feature = "derive_serde", serde(rename = "SNCT") )]
1528	CodeSNCT,
1529	#[cfg_attr( feature = "derive_serde", serde(rename = "SCNL") )]
1530	CodeSCNL,
1531}
1532
1533impl AuthenticationMethod1Code {
1534	pub fn validate(&self) -> Result<(), ValidationError> {
1535		Ok(())
1536	}
1537}
1538
1539
1540// Authorisation1Choice ...
1541#[cfg_attr(feature = "derive_debug", derive(Debug))]
1542#[cfg_attr(feature = "derive_default", derive(Default))]
1543#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1544#[cfg_attr(feature = "derive_clone", derive(Clone))]
1545#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1546pub struct Authorisation1Choice {
1547	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
1548	pub cd: Option<Authorisation1Code>,
1549	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1550	pub prtry: Option<String>,
1551}
1552
1553impl Authorisation1Choice {
1554	pub fn validate(&self) -> Result<(), ValidationError> {
1555		if let Some(ref val) = self.cd { val.validate()? }
1556		if let Some(ref val) = self.prtry {
1557			if val.chars().count() < 1 {
1558				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
1559			}
1560			if val.chars().count() > 128 {
1561				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 128".to_string()));
1562			}
1563		}
1564		Ok(())
1565	}
1566}
1567
1568
1569// Authorisation1Code ...
1570#[cfg_attr(feature = "derive_debug", derive(Debug))]
1571#[cfg_attr(feature = "derive_default", derive(Default))]
1572#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1573#[cfg_attr(feature = "derive_clone", derive(Clone))]
1574#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1575pub enum Authorisation1Code {
1576	#[cfg_attr(feature = "derive_default", default)]
1577	#[cfg_attr( feature = "derive_serde", serde(rename = "AUTH") )]
1578	CodeAUTH,
1579	#[cfg_attr( feature = "derive_serde", serde(rename = "FDET") )]
1580	CodeFDET,
1581	#[cfg_attr( feature = "derive_serde", serde(rename = "FSUM") )]
1582	CodeFSUM,
1583	#[cfg_attr( feature = "derive_serde", serde(rename = "ILEV") )]
1584	CodeILEV,
1585}
1586
1587impl Authorisation1Code {
1588	pub fn validate(&self) -> Result<(), ValidationError> {
1589		Ok(())
1590	}
1591}
1592
1593
1594// BalanceSubType1Choice ...
1595#[cfg_attr(feature = "derive_debug", derive(Debug))]
1596#[cfg_attr(feature = "derive_default", derive(Default))]
1597#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1598#[cfg_attr(feature = "derive_clone", derive(Clone))]
1599#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1600pub struct BalanceSubType1Choice {
1601	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
1602	pub cd: Option<String>,
1603	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1604	pub prtry: Option<String>,
1605}
1606
1607impl BalanceSubType1Choice {
1608	pub fn validate(&self) -> Result<(), ValidationError> {
1609		if let Some(ref val) = self.cd {
1610			if val.chars().count() < 1 {
1611				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
1612			}
1613			if val.chars().count() > 4 {
1614				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
1615			}
1616		}
1617		if let Some(ref val) = self.prtry {
1618			if val.chars().count() < 1 {
1619				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
1620			}
1621			if val.chars().count() > 35 {
1622				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
1623			}
1624		}
1625		Ok(())
1626	}
1627}
1628
1629
1630// BalanceType10Choice ...
1631#[cfg_attr(feature = "derive_debug", derive(Debug))]
1632#[cfg_attr(feature = "derive_default", derive(Default))]
1633#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1634#[cfg_attr(feature = "derive_clone", derive(Clone))]
1635#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1636pub struct BalanceType10Choice {
1637	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
1638	pub cd: Option<String>,
1639	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1640	pub prtry: Option<String>,
1641}
1642
1643impl BalanceType10Choice {
1644	pub fn validate(&self) -> Result<(), ValidationError> {
1645		if let Some(ref val) = self.cd {
1646			if val.chars().count() < 1 {
1647				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
1648			}
1649			if val.chars().count() > 4 {
1650				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
1651			}
1652		}
1653		if let Some(ref val) = self.prtry {
1654			if val.chars().count() < 1 {
1655				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
1656			}
1657			if val.chars().count() > 35 {
1658				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
1659			}
1660		}
1661		Ok(())
1662	}
1663}
1664
1665
1666// BalanceType13 ...
1667#[cfg_attr(feature = "derive_debug", derive(Debug))]
1668#[cfg_attr(feature = "derive_default", derive(Default))]
1669#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1670#[cfg_attr(feature = "derive_clone", derive(Clone))]
1671#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1672pub struct BalanceType13 {
1673	#[cfg_attr( feature = "derive_serde", serde(rename = "CdOrPrtry") )]
1674	pub cd_or_prtry: BalanceType10Choice,
1675	#[cfg_attr( feature = "derive_serde", serde(rename = "SubTp", skip_serializing_if = "Option::is_none") )]
1676	pub sub_tp: Option<BalanceSubType1Choice>,
1677}
1678
1679impl BalanceType13 {
1680	pub fn validate(&self) -> Result<(), ValidationError> {
1681		self.cd_or_prtry.validate()?;
1682		if let Some(ref val) = self.sub_tp { val.validate()? }
1683		Ok(())
1684	}
1685}
1686
1687
1688// BankTransactionCodeStructure4 ...
1689#[cfg_attr(feature = "derive_debug", derive(Debug))]
1690#[cfg_attr(feature = "derive_default", derive(Default))]
1691#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1692#[cfg_attr(feature = "derive_clone", derive(Clone))]
1693#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1694pub struct BankTransactionCodeStructure4 {
1695	#[cfg_attr( feature = "derive_serde", serde(rename = "Domn", skip_serializing_if = "Option::is_none") )]
1696	pub domn: Option<BankTransactionCodeStructure5>,
1697	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
1698	pub prtry: Option<ProprietaryBankTransactionCodeStructure1>,
1699}
1700
1701impl BankTransactionCodeStructure4 {
1702	pub fn validate(&self) -> Result<(), ValidationError> {
1703		if let Some(ref val) = self.domn { val.validate()? }
1704		if let Some(ref val) = self.prtry { val.validate()? }
1705		Ok(())
1706	}
1707}
1708
1709
1710// BankTransactionCodeStructure5 ...
1711#[cfg_attr(feature = "derive_debug", derive(Debug))]
1712#[cfg_attr(feature = "derive_default", derive(Default))]
1713#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1714#[cfg_attr(feature = "derive_clone", derive(Clone))]
1715#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1716pub struct BankTransactionCodeStructure5 {
1717	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd") )]
1718	pub cd: String,
1719	#[cfg_attr( feature = "derive_serde", serde(rename = "Fmly") )]
1720	pub fmly: BankTransactionCodeStructure6,
1721}
1722
1723impl BankTransactionCodeStructure5 {
1724	pub fn validate(&self) -> Result<(), ValidationError> {
1725		if self.cd.chars().count() < 1 {
1726			return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
1727		}
1728		if self.cd.chars().count() > 4 {
1729			return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
1730		}
1731		self.fmly.validate()?;
1732		Ok(())
1733	}
1734}
1735
1736
1737// BankTransactionCodeStructure6 ...
1738#[cfg_attr(feature = "derive_debug", derive(Debug))]
1739#[cfg_attr(feature = "derive_default", derive(Default))]
1740#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1741#[cfg_attr(feature = "derive_clone", derive(Clone))]
1742#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1743pub struct BankTransactionCodeStructure6 {
1744	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd") )]
1745	pub cd: String,
1746	#[cfg_attr( feature = "derive_serde", serde(rename = "SubFmlyCd") )]
1747	pub sub_fmly_cd: String,
1748}
1749
1750impl BankTransactionCodeStructure6 {
1751	pub fn validate(&self) -> Result<(), ValidationError> {
1752		if self.cd.chars().count() < 1 {
1753			return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
1754		}
1755		if self.cd.chars().count() > 4 {
1756			return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
1757		}
1758		if self.sub_fmly_cd.chars().count() < 1 {
1759			return Err(ValidationError::new(1001, "sub_fmly_cd is shorter than the minimum length of 1".to_string()));
1760		}
1761		if self.sub_fmly_cd.chars().count() > 4 {
1762			return Err(ValidationError::new(1002, "sub_fmly_cd exceeds the maximum length of 4".to_string()));
1763		}
1764		Ok(())
1765	}
1766}
1767
1768
1769// BatchInformation2 ...
1770#[cfg_attr(feature = "derive_debug", derive(Debug))]
1771#[cfg_attr(feature = "derive_default", derive(Default))]
1772#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1773#[cfg_attr(feature = "derive_clone", derive(Clone))]
1774#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1775pub struct BatchInformation2 {
1776	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId", skip_serializing_if = "Option::is_none") )]
1777	pub msg_id: Option<String>,
1778	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none") )]
1779	pub pmt_inf_id: Option<String>,
1780	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs", skip_serializing_if = "Option::is_none") )]
1781	pub nb_of_txs: Option<String>,
1782	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlAmt", skip_serializing_if = "Option::is_none") )]
1783	pub ttl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
1784	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none") )]
1785	pub cdt_dbt_ind: Option<CreditDebitCode>,
1786}
1787
1788impl BatchInformation2 {
1789	pub fn validate(&self) -> Result<(), ValidationError> {
1790		if let Some(ref val) = self.msg_id {
1791			if val.chars().count() < 1 {
1792				return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
1793			}
1794			if val.chars().count() > 35 {
1795				return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
1796			}
1797		}
1798		if let Some(ref val) = self.pmt_inf_id {
1799			if val.chars().count() < 1 {
1800				return Err(ValidationError::new(1001, "pmt_inf_id is shorter than the minimum length of 1".to_string()));
1801			}
1802			if val.chars().count() > 35 {
1803				return Err(ValidationError::new(1002, "pmt_inf_id exceeds the maximum length of 35".to_string()));
1804			}
1805		}
1806		if let Some(ref val) = self.nb_of_txs {
1807			let pattern = Regex::new("[0-9]{1,15}").unwrap();
1808			if !pattern.is_match(val) {
1809				return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
1810			}
1811		}
1812		if let Some(ref val) = self.ttl_amt { val.validate()? }
1813		if let Some(ref val) = self.cdt_dbt_ind { val.validate()? }
1814		Ok(())
1815	}
1816}
1817
1818
1819// BranchAndFinancialInstitutionIdentification6 ...
1820#[cfg_attr(feature = "derive_debug", derive(Debug))]
1821#[cfg_attr(feature = "derive_default", derive(Default))]
1822#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1823#[cfg_attr(feature = "derive_clone", derive(Clone))]
1824#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1825pub struct BranchAndFinancialInstitutionIdentification6 {
1826	#[cfg_attr( feature = "derive_serde", serde(rename = "FinInstnId") )]
1827	pub fin_instn_id: FinancialInstitutionIdentification18,
1828	#[cfg_attr( feature = "derive_serde", serde(rename = "BrnchId", skip_serializing_if = "Option::is_none") )]
1829	pub brnch_id: Option<BranchData3>,
1830}
1831
1832impl BranchAndFinancialInstitutionIdentification6 {
1833	pub fn validate(&self) -> Result<(), ValidationError> {
1834		self.fin_instn_id.validate()?;
1835		if let Some(ref val) = self.brnch_id { val.validate()? }
1836		Ok(())
1837	}
1838}
1839
1840
1841// BranchData3 ...
1842#[cfg_attr(feature = "derive_debug", derive(Debug))]
1843#[cfg_attr(feature = "derive_default", derive(Default))]
1844#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1845#[cfg_attr(feature = "derive_clone", derive(Clone))]
1846#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1847pub struct BranchData3 {
1848	#[cfg_attr( feature = "derive_serde", serde(rename = "Id", skip_serializing_if = "Option::is_none") )]
1849	pub id: Option<String>,
1850	#[cfg_attr( feature = "derive_serde", serde(rename = "LEI", skip_serializing_if = "Option::is_none") )]
1851	pub lei: Option<String>,
1852	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
1853	pub nm: Option<String>,
1854	#[cfg_attr( feature = "derive_serde", serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none") )]
1855	pub pstl_adr: Option<PostalAddress24>,
1856}
1857
1858impl BranchData3 {
1859	pub fn validate(&self) -> Result<(), ValidationError> {
1860		if let Some(ref val) = self.id {
1861			if val.chars().count() < 1 {
1862				return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
1863			}
1864			if val.chars().count() > 35 {
1865				return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
1866			}
1867		}
1868		if let Some(ref val) = self.lei {
1869			let pattern = Regex::new("[A-Z0-9]{18,18}[0-9]{2,2}").unwrap();
1870			if !pattern.is_match(val) {
1871				return Err(ValidationError::new(1005, "lei does not match the required pattern".to_string()));
1872			}
1873		}
1874		if let Some(ref val) = self.nm {
1875			if val.chars().count() < 1 {
1876				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
1877			}
1878			if val.chars().count() > 140 {
1879				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
1880			}
1881		}
1882		if let Some(ref val) = self.pstl_adr { val.validate()? }
1883		Ok(())
1884	}
1885}
1886
1887
1888// BusinessApplicationHeader5 ...
1889#[cfg_attr(feature = "derive_debug", derive(Debug))]
1890#[cfg_attr(feature = "derive_default", derive(Default))]
1891#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1892#[cfg_attr(feature = "derive_clone", derive(Clone))]
1893#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1894pub struct BusinessApplicationHeader5 {
1895	#[cfg_attr( feature = "derive_serde", serde(rename = "CharSet", skip_serializing_if = "Option::is_none") )]
1896	pub char_set: Option<String>,
1897	#[cfg_attr( feature = "derive_serde", serde(rename = "Fr") )]
1898	pub fr: Party44Choice,
1899	#[cfg_attr( feature = "derive_serde", serde(rename = "To") )]
1900	pub to: Party44Choice,
1901	#[cfg_attr( feature = "derive_serde", serde(rename = "BizMsgIdr") )]
1902	pub biz_msg_idr: String,
1903	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgDefIdr") )]
1904	pub msg_def_idr: String,
1905	#[cfg_attr( feature = "derive_serde", serde(rename = "BizSvc", skip_serializing_if = "Option::is_none") )]
1906	pub biz_svc: Option<String>,
1907	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDt") )]
1908	pub cre_dt: String,
1909	#[cfg_attr( feature = "derive_serde", serde(rename = "CpyDplct", skip_serializing_if = "Option::is_none") )]
1910	pub cpy_dplct: Option<CopyDuplicate1Code>,
1911	#[cfg_attr( feature = "derive_serde", serde(rename = "PssblDplct", skip_serializing_if = "Option::is_none") )]
1912	pub pssbl_dplct: Option<bool>,
1913	#[cfg_attr( feature = "derive_serde", serde(rename = "Prty", skip_serializing_if = "Option::is_none") )]
1914	pub prty: Option<String>,
1915	#[cfg_attr( feature = "derive_serde", serde(rename = "Sgntr", skip_serializing_if = "Option::is_none") )]
1916	pub sgntr: Option<SignatureEnvelope>,
1917}
1918
1919impl BusinessApplicationHeader5 {
1920	pub fn validate(&self) -> Result<(), ValidationError> {
1921		self.fr.validate()?;
1922		self.to.validate()?;
1923		if self.biz_msg_idr.chars().count() < 1 {
1924			return Err(ValidationError::new(1001, "biz_msg_idr is shorter than the minimum length of 1".to_string()));
1925		}
1926		if self.biz_msg_idr.chars().count() > 35 {
1927			return Err(ValidationError::new(1002, "biz_msg_idr exceeds the maximum length of 35".to_string()));
1928		}
1929		if self.msg_def_idr.chars().count() < 1 {
1930			return Err(ValidationError::new(1001, "msg_def_idr is shorter than the minimum length of 1".to_string()));
1931		}
1932		if self.msg_def_idr.chars().count() > 35 {
1933			return Err(ValidationError::new(1002, "msg_def_idr exceeds the maximum length of 35".to_string()));
1934		}
1935		if let Some(ref val) = self.biz_svc {
1936			if val.chars().count() < 1 {
1937				return Err(ValidationError::new(1001, "biz_svc is shorter than the minimum length of 1".to_string()));
1938			}
1939			if val.chars().count() > 35 {
1940				return Err(ValidationError::new(1002, "biz_svc exceeds the maximum length of 35".to_string()));
1941			}
1942		}
1943		if let Some(ref val) = self.cpy_dplct { val.validate()? }
1944		if let Some(ref val) = self.sgntr { val.validate()? }
1945		Ok(())
1946	}
1947}
1948
1949
1950// BusinessApplicationHeaderV02 ...
1951#[cfg_attr(feature = "derive_debug", derive(Debug))]
1952#[cfg_attr(feature = "derive_default", derive(Default))]
1953#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
1954#[cfg_attr(feature = "derive_clone", derive(Clone))]
1955#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
1956pub struct BusinessApplicationHeaderV02 {
1957	#[cfg_attr( feature = "derive_serde", serde(rename = "CharSet", skip_serializing_if = "Option::is_none") )]
1958	pub char_set: Option<String>,
1959	#[cfg_attr( feature = "derive_serde", serde(rename = "Fr") )]
1960	pub fr: Party44Choice,
1961	#[cfg_attr( feature = "derive_serde", serde(rename = "To") )]
1962	pub to: Party44Choice,
1963	#[cfg_attr( feature = "derive_serde", serde(rename = "BizMsgIdr") )]
1964	pub biz_msg_idr: String,
1965	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgDefIdr") )]
1966	pub msg_def_idr: String,
1967	#[cfg_attr( feature = "derive_serde", serde(rename = "BizSvc", skip_serializing_if = "Option::is_none") )]
1968	pub biz_svc: Option<String>,
1969	#[cfg_attr( feature = "derive_serde", serde(rename = "MktPrctc", skip_serializing_if = "Option::is_none") )]
1970	pub mkt_prctc: Option<ImplementationSpecification1>,
1971	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDt") )]
1972	pub cre_dt: String,
1973	#[cfg_attr( feature = "derive_serde", serde(rename = "BizPrcgDt", skip_serializing_if = "Option::is_none") )]
1974	pub biz_prcg_dt: Option<String>,
1975	#[cfg_attr( feature = "derive_serde", serde(rename = "CpyDplct", skip_serializing_if = "Option::is_none") )]
1976	pub cpy_dplct: Option<CopyDuplicate1Code>,
1977	#[cfg_attr( feature = "derive_serde", serde(rename = "PssblDplct", skip_serializing_if = "Option::is_none") )]
1978	pub pssbl_dplct: Option<bool>,
1979	#[cfg_attr( feature = "derive_serde", serde(rename = "Prty", skip_serializing_if = "Option::is_none") )]
1980	pub prty: Option<String>,
1981	#[cfg_attr( feature = "derive_serde", serde(rename = "Sgntr", skip_serializing_if = "Option::is_none") )]
1982	pub sgntr: Option<SignatureEnvelope>,
1983	#[cfg_attr( feature = "derive_serde", serde(rename = "Rltd", skip_serializing_if = "Option::is_none") )]
1984	pub rltd: Option<Vec<BusinessApplicationHeader5>>,
1985}
1986
1987impl BusinessApplicationHeaderV02 {
1988	pub fn validate(&self) -> Result<(), ValidationError> {
1989		self.fr.validate()?;
1990		self.to.validate()?;
1991		if self.biz_msg_idr.chars().count() < 1 {
1992			return Err(ValidationError::new(1001, "biz_msg_idr is shorter than the minimum length of 1".to_string()));
1993		}
1994		if self.biz_msg_idr.chars().count() > 35 {
1995			return Err(ValidationError::new(1002, "biz_msg_idr exceeds the maximum length of 35".to_string()));
1996		}
1997		if self.msg_def_idr.chars().count() < 1 {
1998			return Err(ValidationError::new(1001, "msg_def_idr is shorter than the minimum length of 1".to_string()));
1999		}
2000		if self.msg_def_idr.chars().count() > 35 {
2001			return Err(ValidationError::new(1002, "msg_def_idr exceeds the maximum length of 35".to_string()));
2002		}
2003		if let Some(ref val) = self.biz_svc {
2004			if val.chars().count() < 1 {
2005				return Err(ValidationError::new(1001, "biz_svc is shorter than the minimum length of 1".to_string()));
2006			}
2007			if val.chars().count() > 35 {
2008				return Err(ValidationError::new(1002, "biz_svc exceeds the maximum length of 35".to_string()));
2009			}
2010		}
2011		if let Some(ref val) = self.mkt_prctc { val.validate()? }
2012		if let Some(ref val) = self.cpy_dplct { val.validate()? }
2013		if let Some(ref val) = self.sgntr { val.validate()? }
2014		if let Some(ref vec) = self.rltd { for item in vec { item.validate()? } }
2015		Ok(())
2016	}
2017}
2018
2019
2020// CSCManagement1Code ...
2021#[cfg_attr(feature = "derive_debug", derive(Debug))]
2022#[cfg_attr(feature = "derive_default", derive(Default))]
2023#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2024#[cfg_attr(feature = "derive_clone", derive(Clone))]
2025#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2026pub enum CSCManagement1Code {
2027	#[cfg_attr(feature = "derive_default", default)]
2028	#[cfg_attr( feature = "derive_serde", serde(rename = "PRST") )]
2029	CodePRST,
2030	#[cfg_attr( feature = "derive_serde", serde(rename = "BYPS") )]
2031	CodeBYPS,
2032	#[cfg_attr( feature = "derive_serde", serde(rename = "UNRD") )]
2033	CodeUNRD,
2034	#[cfg_attr( feature = "derive_serde", serde(rename = "NCSC") )]
2035	CodeNCSC,
2036}
2037
2038impl CSCManagement1Code {
2039	pub fn validate(&self) -> Result<(), ValidationError> {
2040		Ok(())
2041	}
2042}
2043
2044
2045// CancellationIndividualStatus1Code ...
2046#[cfg_attr(feature = "derive_debug", derive(Debug))]
2047#[cfg_attr(feature = "derive_default", derive(Default))]
2048#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2049#[cfg_attr(feature = "derive_clone", derive(Clone))]
2050#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2051pub enum CancellationIndividualStatus1Code {
2052	#[cfg_attr(feature = "derive_default", default)]
2053	#[cfg_attr( feature = "derive_serde", serde(rename = "RJCR") )]
2054	CodeRJCR,
2055	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCR") )]
2056	CodeACCR,
2057	#[cfg_attr( feature = "derive_serde", serde(rename = "PDCR") )]
2058	CodePDCR,
2059}
2060
2061impl CancellationIndividualStatus1Code {
2062	pub fn validate(&self) -> Result<(), ValidationError> {
2063		Ok(())
2064	}
2065}
2066
2067
2068// CancellationReason33Choice ...
2069#[cfg_attr(feature = "derive_debug", derive(Debug))]
2070#[cfg_attr(feature = "derive_default", derive(Default))]
2071#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2072#[cfg_attr(feature = "derive_clone", derive(Clone))]
2073#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2074pub struct CancellationReason33Choice {
2075	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
2076	pub cd: Option<String>,
2077	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
2078	pub prtry: Option<String>,
2079}
2080
2081impl CancellationReason33Choice {
2082	pub fn validate(&self) -> Result<(), ValidationError> {
2083		if let Some(ref val) = self.cd {
2084			if val.chars().count() < 1 {
2085				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
2086			}
2087			if val.chars().count() > 4 {
2088				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
2089			}
2090		}
2091		if let Some(ref val) = self.prtry {
2092			if val.chars().count() < 1 {
2093				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
2094			}
2095			if val.chars().count() > 35 {
2096				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
2097			}
2098		}
2099		Ok(())
2100	}
2101}
2102
2103
2104// CancellationStatusReason3Choice ...
2105#[cfg_attr(feature = "derive_debug", derive(Debug))]
2106#[cfg_attr(feature = "derive_default", derive(Default))]
2107#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2108#[cfg_attr(feature = "derive_clone", derive(Clone))]
2109#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2110pub struct CancellationStatusReason3Choice {
2111	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
2112	pub cd: Option<String>,
2113	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
2114	pub prtry: Option<String>,
2115}
2116
2117impl CancellationStatusReason3Choice {
2118	pub fn validate(&self) -> Result<(), ValidationError> {
2119		if let Some(ref val) = self.cd {
2120			if val.chars().count() < 1 {
2121				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
2122			}
2123			if val.chars().count() > 4 {
2124				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
2125			}
2126		}
2127		if let Some(ref val) = self.prtry {
2128			if val.chars().count() < 1 {
2129				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
2130			}
2131			if val.chars().count() > 35 {
2132				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
2133			}
2134		}
2135		Ok(())
2136	}
2137}
2138
2139
2140// CancellationStatusReason4 ...
2141#[cfg_attr(feature = "derive_debug", derive(Debug))]
2142#[cfg_attr(feature = "derive_default", derive(Default))]
2143#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2144#[cfg_attr(feature = "derive_clone", derive(Clone))]
2145#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2146pub struct CancellationStatusReason4 {
2147	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
2148	pub orgtr: Option<PartyIdentification135>,
2149	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
2150	pub rsn: Option<CancellationStatusReason3Choice>,
2151	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
2152	pub addtl_inf: Option<Vec<String>>,
2153}
2154
2155impl CancellationStatusReason4 {
2156	pub fn validate(&self) -> Result<(), ValidationError> {
2157		if let Some(ref val) = self.orgtr { val.validate()? }
2158		if let Some(ref val) = self.rsn { val.validate()? }
2159		if let Some(ref vec) = self.addtl_inf {
2160			for item in vec {
2161				if item.chars().count() < 1 {
2162					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
2163				}
2164				if item.chars().count() > 105 {
2165					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
2166				}
2167			}
2168		}
2169		Ok(())
2170	}
2171}
2172
2173
2174// CardAggregated2 ...
2175#[cfg_attr(feature = "derive_debug", derive(Debug))]
2176#[cfg_attr(feature = "derive_default", derive(Default))]
2177#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2178#[cfg_attr(feature = "derive_clone", derive(Clone))]
2179#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2180pub struct CardAggregated2 {
2181	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlSvc", skip_serializing_if = "Option::is_none") )]
2182	pub addtl_svc: Option<CardPaymentServiceType2Code>,
2183	#[cfg_attr( feature = "derive_serde", serde(rename = "TxCtgy", skip_serializing_if = "Option::is_none") )]
2184	pub tx_ctgy: Option<String>,
2185	#[cfg_attr( feature = "derive_serde", serde(rename = "SaleRcncltnId", skip_serializing_if = "Option::is_none") )]
2186	pub sale_rcncltn_id: Option<String>,
2187	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqNbRg", skip_serializing_if = "Option::is_none") )]
2188	pub seq_nb_rg: Option<CardSequenceNumberRange1>,
2189	#[cfg_attr( feature = "derive_serde", serde(rename = "TxDtRg", skip_serializing_if = "Option::is_none") )]
2190	pub tx_dt_rg: Option<DateOrDateTimePeriod1Choice>,
2191}
2192
2193impl CardAggregated2 {
2194	pub fn validate(&self) -> Result<(), ValidationError> {
2195		if let Some(ref val) = self.addtl_svc { val.validate()? }
2196		if let Some(ref val) = self.tx_ctgy {
2197			if val.chars().count() < 1 {
2198				return Err(ValidationError::new(1001, "tx_ctgy is shorter than the minimum length of 1".to_string()));
2199			}
2200			if val.chars().count() > 4 {
2201				return Err(ValidationError::new(1002, "tx_ctgy exceeds the maximum length of 4".to_string()));
2202			}
2203		}
2204		if let Some(ref val) = self.sale_rcncltn_id {
2205			if val.chars().count() < 1 {
2206				return Err(ValidationError::new(1001, "sale_rcncltn_id is shorter than the minimum length of 1".to_string()));
2207			}
2208			if val.chars().count() > 35 {
2209				return Err(ValidationError::new(1002, "sale_rcncltn_id exceeds the maximum length of 35".to_string()));
2210			}
2211		}
2212		if let Some(ref val) = self.seq_nb_rg { val.validate()? }
2213		if let Some(ref val) = self.tx_dt_rg { val.validate()? }
2214		Ok(())
2215	}
2216}
2217
2218
2219// CardDataReading1Code ...
2220#[cfg_attr(feature = "derive_debug", derive(Debug))]
2221#[cfg_attr(feature = "derive_default", derive(Default))]
2222#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2223#[cfg_attr(feature = "derive_clone", derive(Clone))]
2224#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2225pub enum CardDataReading1Code {
2226	#[cfg_attr(feature = "derive_default", default)]
2227	#[cfg_attr( feature = "derive_serde", serde(rename = "TAGC") )]
2228	CodeTAGC,
2229	#[cfg_attr( feature = "derive_serde", serde(rename = "PHYS") )]
2230	CodePHYS,
2231	#[cfg_attr( feature = "derive_serde", serde(rename = "BRCD") )]
2232	CodeBRCD,
2233	#[cfg_attr( feature = "derive_serde", serde(rename = "MGST") )]
2234	CodeMGST,
2235	#[cfg_attr( feature = "derive_serde", serde(rename = "CICC") )]
2236	CodeCICC,
2237	#[cfg_attr( feature = "derive_serde", serde(rename = "DFLE") )]
2238	CodeDFLE,
2239	#[cfg_attr( feature = "derive_serde", serde(rename = "CTLS") )]
2240	CodeCTLS,
2241	#[cfg_attr( feature = "derive_serde", serde(rename = "ECTL") )]
2242	CodeECTL,
2243}
2244
2245impl CardDataReading1Code {
2246	pub fn validate(&self) -> Result<(), ValidationError> {
2247		Ok(())
2248	}
2249}
2250
2251
2252// CardEntry4 ...
2253#[cfg_attr(feature = "derive_debug", derive(Debug))]
2254#[cfg_attr(feature = "derive_default", derive(Default))]
2255#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2256#[cfg_attr(feature = "derive_clone", derive(Clone))]
2257#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2258pub struct CardEntry4 {
2259	#[cfg_attr( feature = "derive_serde", serde(rename = "Card", skip_serializing_if = "Option::is_none") )]
2260	pub card: Option<PaymentCard4>,
2261	#[cfg_attr( feature = "derive_serde", serde(rename = "POI", skip_serializing_if = "Option::is_none") )]
2262	pub poi: Option<PointOfInteraction1>,
2263	#[cfg_attr( feature = "derive_serde", serde(rename = "AggtdNtry", skip_serializing_if = "Option::is_none") )]
2264	pub aggtd_ntry: Option<CardAggregated2>,
2265	#[cfg_attr( feature = "derive_serde", serde(rename = "PrePdAcct", skip_serializing_if = "Option::is_none") )]
2266	pub pre_pd_acct: Option<CashAccount38>,
2267}
2268
2269impl CardEntry4 {
2270	pub fn validate(&self) -> Result<(), ValidationError> {
2271		if let Some(ref val) = self.card { val.validate()? }
2272		if let Some(ref val) = self.poi { val.validate()? }
2273		if let Some(ref val) = self.aggtd_ntry { val.validate()? }
2274		if let Some(ref val) = self.pre_pd_acct { val.validate()? }
2275		Ok(())
2276	}
2277}
2278
2279
2280// CardIndividualTransaction2 ...
2281#[cfg_attr(feature = "derive_debug", derive(Debug))]
2282#[cfg_attr(feature = "derive_default", derive(Default))]
2283#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2284#[cfg_attr(feature = "derive_clone", derive(Clone))]
2285#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2286pub struct CardIndividualTransaction2 {
2287	#[cfg_attr( feature = "derive_serde", serde(rename = "ICCRltdData", skip_serializing_if = "Option::is_none") )]
2288	pub icc_rltd_data: Option<String>,
2289	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCntxt", skip_serializing_if = "Option::is_none") )]
2290	pub pmt_cntxt: Option<PaymentContext3>,
2291	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlSvc", skip_serializing_if = "Option::is_none") )]
2292	pub addtl_svc: Option<CardPaymentServiceType2Code>,
2293	#[cfg_attr( feature = "derive_serde", serde(rename = "TxCtgy", skip_serializing_if = "Option::is_none") )]
2294	pub tx_ctgy: Option<String>,
2295	#[cfg_attr( feature = "derive_serde", serde(rename = "SaleRcncltnId", skip_serializing_if = "Option::is_none") )]
2296	pub sale_rcncltn_id: Option<String>,
2297	#[cfg_attr( feature = "derive_serde", serde(rename = "SaleRefNb", skip_serializing_if = "Option::is_none") )]
2298	pub sale_ref_nb: Option<String>,
2299	#[cfg_attr( feature = "derive_serde", serde(rename = "RePresntmntRsn", skip_serializing_if = "Option::is_none") )]
2300	pub re_presntmnt_rsn: Option<String>,
2301	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqNb", skip_serializing_if = "Option::is_none") )]
2302	pub seq_nb: Option<String>,
2303	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
2304	pub tx_id: Option<TransactionIdentifier1>,
2305	#[cfg_attr( feature = "derive_serde", serde(rename = "Pdct", skip_serializing_if = "Option::is_none") )]
2306	pub pdct: Option<Product2>,
2307	#[cfg_attr( feature = "derive_serde", serde(rename = "VldtnDt", skip_serializing_if = "Option::is_none") )]
2308	pub vldtn_dt: Option<String>,
2309	#[cfg_attr( feature = "derive_serde", serde(rename = "VldtnSeqNb", skip_serializing_if = "Option::is_none") )]
2310	pub vldtn_seq_nb: Option<String>,
2311}
2312
2313impl CardIndividualTransaction2 {
2314	pub fn validate(&self) -> Result<(), ValidationError> {
2315		if let Some(ref val) = self.icc_rltd_data {
2316			if val.chars().count() < 1 {
2317				return Err(ValidationError::new(1001, "icc_rltd_data is shorter than the minimum length of 1".to_string()));
2318			}
2319			if val.chars().count() > 1025 {
2320				return Err(ValidationError::new(1002, "icc_rltd_data exceeds the maximum length of 1025".to_string()));
2321			}
2322		}
2323		if let Some(ref val) = self.pmt_cntxt { val.validate()? }
2324		if let Some(ref val) = self.addtl_svc { val.validate()? }
2325		if let Some(ref val) = self.tx_ctgy {
2326			if val.chars().count() < 1 {
2327				return Err(ValidationError::new(1001, "tx_ctgy is shorter than the minimum length of 1".to_string()));
2328			}
2329			if val.chars().count() > 4 {
2330				return Err(ValidationError::new(1002, "tx_ctgy exceeds the maximum length of 4".to_string()));
2331			}
2332		}
2333		if let Some(ref val) = self.sale_rcncltn_id {
2334			if val.chars().count() < 1 {
2335				return Err(ValidationError::new(1001, "sale_rcncltn_id is shorter than the minimum length of 1".to_string()));
2336			}
2337			if val.chars().count() > 35 {
2338				return Err(ValidationError::new(1002, "sale_rcncltn_id exceeds the maximum length of 35".to_string()));
2339			}
2340		}
2341		if let Some(ref val) = self.sale_ref_nb {
2342			if val.chars().count() < 1 {
2343				return Err(ValidationError::new(1001, "sale_ref_nb is shorter than the minimum length of 1".to_string()));
2344			}
2345			if val.chars().count() > 35 {
2346				return Err(ValidationError::new(1002, "sale_ref_nb exceeds the maximum length of 35".to_string()));
2347			}
2348		}
2349		if let Some(ref val) = self.re_presntmnt_rsn {
2350			if val.chars().count() < 1 {
2351				return Err(ValidationError::new(1001, "re_presntmnt_rsn is shorter than the minimum length of 1".to_string()));
2352			}
2353			if val.chars().count() > 4 {
2354				return Err(ValidationError::new(1002, "re_presntmnt_rsn exceeds the maximum length of 4".to_string()));
2355			}
2356		}
2357		if let Some(ref val) = self.seq_nb {
2358			if val.chars().count() < 1 {
2359				return Err(ValidationError::new(1001, "seq_nb is shorter than the minimum length of 1".to_string()));
2360			}
2361			if val.chars().count() > 35 {
2362				return Err(ValidationError::new(1002, "seq_nb exceeds the maximum length of 35".to_string()));
2363			}
2364		}
2365		if let Some(ref val) = self.tx_id { val.validate()? }
2366		if let Some(ref val) = self.pdct { val.validate()? }
2367		if let Some(ref val) = self.vldtn_seq_nb {
2368			if val.chars().count() < 1 {
2369				return Err(ValidationError::new(1001, "vldtn_seq_nb is shorter than the minimum length of 1".to_string()));
2370			}
2371			if val.chars().count() > 35 {
2372				return Err(ValidationError::new(1002, "vldtn_seq_nb exceeds the maximum length of 35".to_string()));
2373			}
2374		}
2375		Ok(())
2376	}
2377}
2378
2379
2380// CardPaymentServiceType2Code ...
2381#[cfg_attr(feature = "derive_debug", derive(Debug))]
2382#[cfg_attr(feature = "derive_default", derive(Default))]
2383#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2384#[cfg_attr(feature = "derive_clone", derive(Clone))]
2385#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2386pub enum CardPaymentServiceType2Code {
2387	#[cfg_attr(feature = "derive_default", default)]
2388	#[cfg_attr( feature = "derive_serde", serde(rename = "AGGR") )]
2389	CodeAGGR,
2390	#[cfg_attr( feature = "derive_serde", serde(rename = "DCCV") )]
2391	CodeDCCV,
2392	#[cfg_attr( feature = "derive_serde", serde(rename = "GRTT") )]
2393	CodeGRTT,
2394	#[cfg_attr( feature = "derive_serde", serde(rename = "INSP") )]
2395	CodeINSP,
2396	#[cfg_attr( feature = "derive_serde", serde(rename = "LOYT") )]
2397	CodeLOYT,
2398	#[cfg_attr( feature = "derive_serde", serde(rename = "NRES") )]
2399	CodeNRES,
2400	#[cfg_attr( feature = "derive_serde", serde(rename = "PUCO") )]
2401	CodePUCO,
2402	#[cfg_attr( feature = "derive_serde", serde(rename = "RECP") )]
2403	CodeRECP,
2404	#[cfg_attr( feature = "derive_serde", serde(rename = "SOAF") )]
2405	CodeSOAF,
2406	#[cfg_attr( feature = "derive_serde", serde(rename = "UNAF") )]
2407	CodeUNAF,
2408	#[cfg_attr( feature = "derive_serde", serde(rename = "VCAU") )]
2409	CodeVCAU,
2410}
2411
2412impl CardPaymentServiceType2Code {
2413	pub fn validate(&self) -> Result<(), ValidationError> {
2414		Ok(())
2415	}
2416}
2417
2418
2419// CardSecurityInformation1 ...
2420#[cfg_attr(feature = "derive_debug", derive(Debug))]
2421#[cfg_attr(feature = "derive_default", derive(Default))]
2422#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2423#[cfg_attr(feature = "derive_clone", derive(Clone))]
2424#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2425pub struct CardSecurityInformation1 {
2426	#[cfg_attr( feature = "derive_serde", serde(rename = "CSCMgmt") )]
2427	pub csc_mgmt: CSCManagement1Code,
2428	#[cfg_attr( feature = "derive_serde", serde(rename = "CSCVal", skip_serializing_if = "Option::is_none") )]
2429	pub csc_val: Option<String>,
2430}
2431
2432impl CardSecurityInformation1 {
2433	pub fn validate(&self) -> Result<(), ValidationError> {
2434		self.csc_mgmt.validate()?;
2435		if let Some(ref val) = self.csc_val {
2436			let pattern = Regex::new("[0-9]{3,4}").unwrap();
2437			if !pattern.is_match(val) {
2438				return Err(ValidationError::new(1005, "csc_val does not match the required pattern".to_string()));
2439			}
2440		}
2441		Ok(())
2442	}
2443}
2444
2445
2446// CardSequenceNumberRange1 ...
2447#[cfg_attr(feature = "derive_debug", derive(Debug))]
2448#[cfg_attr(feature = "derive_default", derive(Default))]
2449#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2450#[cfg_attr(feature = "derive_clone", derive(Clone))]
2451#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2452pub struct CardSequenceNumberRange1 {
2453	#[cfg_attr( feature = "derive_serde", serde(rename = "FrstTx", skip_serializing_if = "Option::is_none") )]
2454	pub frst_tx: Option<String>,
2455	#[cfg_attr( feature = "derive_serde", serde(rename = "LastTx", skip_serializing_if = "Option::is_none") )]
2456	pub last_tx: Option<String>,
2457}
2458
2459impl CardSequenceNumberRange1 {
2460	pub fn validate(&self) -> Result<(), ValidationError> {
2461		if let Some(ref val) = self.frst_tx {
2462			if val.chars().count() < 1 {
2463				return Err(ValidationError::new(1001, "frst_tx is shorter than the minimum length of 1".to_string()));
2464			}
2465			if val.chars().count() > 35 {
2466				return Err(ValidationError::new(1002, "frst_tx exceeds the maximum length of 35".to_string()));
2467			}
2468		}
2469		if let Some(ref val) = self.last_tx {
2470			if val.chars().count() < 1 {
2471				return Err(ValidationError::new(1001, "last_tx is shorter than the minimum length of 1".to_string()));
2472			}
2473			if val.chars().count() > 35 {
2474				return Err(ValidationError::new(1002, "last_tx exceeds the maximum length of 35".to_string()));
2475			}
2476		}
2477		Ok(())
2478	}
2479}
2480
2481
2482// CardTransaction17 ...
2483#[cfg_attr(feature = "derive_debug", derive(Debug))]
2484#[cfg_attr(feature = "derive_default", derive(Default))]
2485#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2486#[cfg_attr(feature = "derive_clone", derive(Clone))]
2487#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2488pub struct CardTransaction17 {
2489	#[cfg_attr( feature = "derive_serde", serde(rename = "Card", skip_serializing_if = "Option::is_none") )]
2490	pub card: Option<PaymentCard4>,
2491	#[cfg_attr( feature = "derive_serde", serde(rename = "POI", skip_serializing_if = "Option::is_none") )]
2492	pub poi: Option<PointOfInteraction1>,
2493	#[cfg_attr( feature = "derive_serde", serde(rename = "Tx", skip_serializing_if = "Option::is_none") )]
2494	pub tx: Option<CardTransaction3Choice>,
2495	#[cfg_attr( feature = "derive_serde", serde(rename = "PrePdAcct", skip_serializing_if = "Option::is_none") )]
2496	pub pre_pd_acct: Option<CashAccount38>,
2497}
2498
2499impl CardTransaction17 {
2500	pub fn validate(&self) -> Result<(), ValidationError> {
2501		if let Some(ref val) = self.card { val.validate()? }
2502		if let Some(ref val) = self.poi { val.validate()? }
2503		if let Some(ref val) = self.tx { val.validate()? }
2504		if let Some(ref val) = self.pre_pd_acct { val.validate()? }
2505		Ok(())
2506	}
2507}
2508
2509
2510// CardTransaction3Choice ...
2511#[cfg_attr(feature = "derive_debug", derive(Debug))]
2512#[cfg_attr(feature = "derive_default", derive(Default))]
2513#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2514#[cfg_attr(feature = "derive_clone", derive(Clone))]
2515#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2516pub struct CardTransaction3Choice {
2517	#[cfg_attr( feature = "derive_serde", serde(rename = "Aggtd", skip_serializing_if = "Option::is_none") )]
2518	pub aggtd: Option<CardAggregated2>,
2519	#[cfg_attr( feature = "derive_serde", serde(rename = "Indv", skip_serializing_if = "Option::is_none") )]
2520	pub indv: Option<CardIndividualTransaction2>,
2521}
2522
2523impl CardTransaction3Choice {
2524	pub fn validate(&self) -> Result<(), ValidationError> {
2525		if let Some(ref val) = self.aggtd { val.validate()? }
2526		if let Some(ref val) = self.indv { val.validate()? }
2527		Ok(())
2528	}
2529}
2530
2531
2532// CardholderAuthentication2 ...
2533#[cfg_attr(feature = "derive_debug", derive(Debug))]
2534#[cfg_attr(feature = "derive_default", derive(Default))]
2535#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2536#[cfg_attr(feature = "derive_clone", derive(Clone))]
2537#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2538pub struct CardholderAuthentication2 {
2539	#[cfg_attr( feature = "derive_serde", serde(rename = "AuthntcnMtd") )]
2540	pub authntcn_mtd: AuthenticationMethod1Code,
2541	#[cfg_attr( feature = "derive_serde", serde(rename = "AuthntcnNtty") )]
2542	pub authntcn_ntty: AuthenticationEntity1Code,
2543}
2544
2545impl CardholderAuthentication2 {
2546	pub fn validate(&self) -> Result<(), ValidationError> {
2547		self.authntcn_mtd.validate()?;
2548		self.authntcn_ntty.validate()?;
2549		Ok(())
2550	}
2551}
2552
2553
2554// CardholderVerificationCapability1Code ...
2555#[cfg_attr(feature = "derive_debug", derive(Debug))]
2556#[cfg_attr(feature = "derive_default", derive(Default))]
2557#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2558#[cfg_attr(feature = "derive_clone", derive(Clone))]
2559#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2560pub enum CardholderVerificationCapability1Code {
2561	#[cfg_attr(feature = "derive_default", default)]
2562	#[cfg_attr( feature = "derive_serde", serde(rename = "MNSG") )]
2563	CodeMNSG,
2564	#[cfg_attr( feature = "derive_serde", serde(rename = "NPIN") )]
2565	CodeNPIN,
2566	#[cfg_attr( feature = "derive_serde", serde(rename = "FCPN") )]
2567	CodeFCPN,
2568	#[cfg_attr( feature = "derive_serde", serde(rename = "FEPN") )]
2569	CodeFEPN,
2570	#[cfg_attr( feature = "derive_serde", serde(rename = "FDSG") )]
2571	CodeFDSG,
2572	#[cfg_attr( feature = "derive_serde", serde(rename = "FBIO") )]
2573	CodeFBIO,
2574	#[cfg_attr( feature = "derive_serde", serde(rename = "MNVR") )]
2575	CodeMNVR,
2576	#[cfg_attr( feature = "derive_serde", serde(rename = "FBIG") )]
2577	CodeFBIG,
2578	#[cfg_attr( feature = "derive_serde", serde(rename = "APKI") )]
2579	CodeAPKI,
2580	#[cfg_attr( feature = "derive_serde", serde(rename = "PKIS") )]
2581	CodePKIS,
2582	#[cfg_attr( feature = "derive_serde", serde(rename = "CHDT") )]
2583	CodeCHDT,
2584	#[cfg_attr( feature = "derive_serde", serde(rename = "SCEC") )]
2585	CodeSCEC,
2586}
2587
2588impl CardholderVerificationCapability1Code {
2589	pub fn validate(&self) -> Result<(), ValidationError> {
2590		Ok(())
2591	}
2592}
2593
2594
2595// Case5 ...
2596#[cfg_attr(feature = "derive_debug", derive(Debug))]
2597#[cfg_attr(feature = "derive_default", derive(Default))]
2598#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2599#[cfg_attr(feature = "derive_clone", derive(Clone))]
2600#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2601pub struct Case5 {
2602	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
2603	pub id: String,
2604	#[cfg_attr( feature = "derive_serde", serde(rename = "Cretr") )]
2605	pub cretr: Party40Choice,
2606	#[cfg_attr( feature = "derive_serde", serde(rename = "ReopCaseIndctn", skip_serializing_if = "Option::is_none") )]
2607	pub reop_case_indctn: Option<bool>,
2608}
2609
2610impl Case5 {
2611	pub fn validate(&self) -> Result<(), ValidationError> {
2612		if self.id.chars().count() < 1 {
2613			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
2614		}
2615		if self.id.chars().count() > 35 {
2616			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
2617		}
2618		self.cretr.validate()?;
2619		Ok(())
2620	}
2621}
2622
2623
2624// CaseAssignment5 ...
2625#[cfg_attr(feature = "derive_debug", derive(Debug))]
2626#[cfg_attr(feature = "derive_default", derive(Default))]
2627#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2628#[cfg_attr(feature = "derive_clone", derive(Clone))]
2629#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2630pub struct CaseAssignment5 {
2631	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
2632	pub id: String,
2633	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgnr") )]
2634	pub assgnr: Party40Choice,
2635	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgne") )]
2636	pub assgne: Party40Choice,
2637	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
2638	pub cre_dt_tm: String,
2639}
2640
2641impl CaseAssignment5 {
2642	pub fn validate(&self) -> Result<(), ValidationError> {
2643		if self.id.chars().count() < 1 {
2644			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
2645		}
2646		if self.id.chars().count() > 35 {
2647			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
2648		}
2649		self.assgnr.validate()?;
2650		self.assgne.validate()?;
2651		Ok(())
2652	}
2653}
2654
2655
2656// CashAccount38 ...
2657#[cfg_attr(feature = "derive_debug", derive(Debug))]
2658#[cfg_attr(feature = "derive_default", derive(Default))]
2659#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2660#[cfg_attr(feature = "derive_clone", derive(Clone))]
2661#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2662pub struct CashAccount38 {
2663	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
2664	pub id: AccountIdentification4Choice,
2665	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
2666	pub tp: Option<CashAccountType2Choice>,
2667	#[cfg_attr( feature = "derive_serde", serde(rename = "Ccy", skip_serializing_if = "Option::is_none") )]
2668	pub ccy: Option<String>,
2669	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
2670	pub nm: Option<String>,
2671	#[cfg_attr( feature = "derive_serde", serde(rename = "Prxy", skip_serializing_if = "Option::is_none") )]
2672	pub prxy: Option<ProxyAccountIdentification1>,
2673}
2674
2675impl CashAccount38 {
2676	pub fn validate(&self) -> Result<(), ValidationError> {
2677		self.id.validate()?;
2678		if let Some(ref val) = self.tp { val.validate()? }
2679		if let Some(ref val) = self.ccy {
2680			let pattern = Regex::new("[A-Z]{3,3}").unwrap();
2681			if !pattern.is_match(val) {
2682				return Err(ValidationError::new(1005, "ccy does not match the required pattern".to_string()));
2683			}
2684		}
2685		if let Some(ref val) = self.nm {
2686			if val.chars().count() < 1 {
2687				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
2688			}
2689			if val.chars().count() > 70 {
2690				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 70".to_string()));
2691			}
2692		}
2693		if let Some(ref val) = self.prxy { val.validate()? }
2694		Ok(())
2695	}
2696}
2697
2698
2699// CashAccount39 ...
2700#[cfg_attr(feature = "derive_debug", derive(Debug))]
2701#[cfg_attr(feature = "derive_default", derive(Default))]
2702#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2703#[cfg_attr(feature = "derive_clone", derive(Clone))]
2704#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2705pub struct CashAccount39 {
2706	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
2707	pub id: AccountIdentification4Choice,
2708	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
2709	pub tp: Option<CashAccountType2Choice>,
2710	#[cfg_attr( feature = "derive_serde", serde(rename = "Ccy", skip_serializing_if = "Option::is_none") )]
2711	pub ccy: Option<String>,
2712	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
2713	pub nm: Option<String>,
2714	#[cfg_attr( feature = "derive_serde", serde(rename = "Prxy", skip_serializing_if = "Option::is_none") )]
2715	pub prxy: Option<ProxyAccountIdentification1>,
2716	#[cfg_attr( feature = "derive_serde", serde(rename = "Ownr", skip_serializing_if = "Option::is_none") )]
2717	pub ownr: Option<PartyIdentification135>,
2718	#[cfg_attr( feature = "derive_serde", serde(rename = "Svcr", skip_serializing_if = "Option::is_none") )]
2719	pub svcr: Option<BranchAndFinancialInstitutionIdentification6>,
2720}
2721
2722impl CashAccount39 {
2723	pub fn validate(&self) -> Result<(), ValidationError> {
2724		self.id.validate()?;
2725		if let Some(ref val) = self.tp { val.validate()? }
2726		if let Some(ref val) = self.ccy {
2727			let pattern = Regex::new("[A-Z]{3,3}").unwrap();
2728			if !pattern.is_match(val) {
2729				return Err(ValidationError::new(1005, "ccy does not match the required pattern".to_string()));
2730			}
2731		}
2732		if let Some(ref val) = self.nm {
2733			if val.chars().count() < 1 {
2734				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
2735			}
2736			if val.chars().count() > 70 {
2737				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 70".to_string()));
2738			}
2739		}
2740		if let Some(ref val) = self.prxy { val.validate()? }
2741		if let Some(ref val) = self.ownr { val.validate()? }
2742		if let Some(ref val) = self.svcr { val.validate()? }
2743		Ok(())
2744	}
2745}
2746
2747
2748// CashAccountType2Choice ...
2749#[cfg_attr(feature = "derive_debug", derive(Debug))]
2750#[cfg_attr(feature = "derive_default", derive(Default))]
2751#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2752#[cfg_attr(feature = "derive_clone", derive(Clone))]
2753#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2754pub struct CashAccountType2Choice {
2755	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
2756	pub cd: Option<String>,
2757	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
2758	pub prtry: Option<String>,
2759}
2760
2761impl CashAccountType2Choice {
2762	pub fn validate(&self) -> Result<(), ValidationError> {
2763		if let Some(ref val) = self.cd {
2764			if val.chars().count() < 1 {
2765				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
2766			}
2767			if val.chars().count() > 4 {
2768				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
2769			}
2770		}
2771		if let Some(ref val) = self.prtry {
2772			if val.chars().count() < 1 {
2773				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
2774			}
2775			if val.chars().count() > 35 {
2776				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
2777			}
2778		}
2779		Ok(())
2780	}
2781}
2782
2783
2784// CashAvailability1 ...
2785#[cfg_attr(feature = "derive_debug", derive(Debug))]
2786#[cfg_attr(feature = "derive_default", derive(Default))]
2787#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2788#[cfg_attr(feature = "derive_clone", derive(Clone))]
2789#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2790pub struct CashAvailability1 {
2791	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt") )]
2792	pub dt: CashAvailabilityDate1Choice,
2793	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
2794	pub amt: ActiveOrHistoricCurrencyAndAmount,
2795	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
2796	pub cdt_dbt_ind: CreditDebitCode,
2797}
2798
2799impl CashAvailability1 {
2800	pub fn validate(&self) -> Result<(), ValidationError> {
2801		self.dt.validate()?;
2802		self.amt.validate()?;
2803		self.cdt_dbt_ind.validate()?;
2804		Ok(())
2805	}
2806}
2807
2808
2809// CashAvailabilityDate1Choice ...
2810#[cfg_attr(feature = "derive_debug", derive(Debug))]
2811#[cfg_attr(feature = "derive_default", derive(Default))]
2812#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2813#[cfg_attr(feature = "derive_clone", derive(Clone))]
2814#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2815pub struct CashAvailabilityDate1Choice {
2816	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfDays", skip_serializing_if = "Option::is_none") )]
2817	pub nb_of_days: Option<String>,
2818	#[cfg_attr( feature = "derive_serde", serde(rename = "ActlDt", skip_serializing_if = "Option::is_none") )]
2819	pub actl_dt: Option<String>,
2820}
2821
2822impl CashAvailabilityDate1Choice {
2823	pub fn validate(&self) -> Result<(), ValidationError> {
2824		if let Some(ref val) = self.nb_of_days {
2825			let pattern = Regex::new("[\\+]{0,1}[0-9]{1,15}").unwrap();
2826			if !pattern.is_match(val) {
2827				return Err(ValidationError::new(1005, "nb_of_days does not match the required pattern".to_string()));
2828			}
2829		}
2830		Ok(())
2831	}
2832}
2833
2834
2835// CashBalance8 ...
2836#[cfg_attr(feature = "derive_debug", derive(Debug))]
2837#[cfg_attr(feature = "derive_default", derive(Default))]
2838#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2839#[cfg_attr(feature = "derive_clone", derive(Clone))]
2840#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2841pub struct CashBalance8 {
2842	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
2843	pub tp: BalanceType13,
2844	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtLine", skip_serializing_if = "Option::is_none") )]
2845	pub cdt_line: Option<Vec<CreditLine3>>,
2846	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
2847	pub amt: ActiveOrHistoricCurrencyAndAmount,
2848	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
2849	pub cdt_dbt_ind: CreditDebitCode,
2850	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt") )]
2851	pub dt: DateAndDateTime2Choice,
2852	#[cfg_attr( feature = "derive_serde", serde(rename = "Avlbty", skip_serializing_if = "Option::is_none") )]
2853	pub avlbty: Option<Vec<CashAvailability1>>,
2854}
2855
2856impl CashBalance8 {
2857	pub fn validate(&self) -> Result<(), ValidationError> {
2858		self.tp.validate()?;
2859		if let Some(ref vec) = self.cdt_line { for item in vec { item.validate()? } }
2860		self.amt.validate()?;
2861		self.cdt_dbt_ind.validate()?;
2862		self.dt.validate()?;
2863		if let Some(ref vec) = self.avlbty { for item in vec { item.validate()? } }
2864		Ok(())
2865	}
2866}
2867
2868
2869// CashDeposit1 ...
2870#[cfg_attr(feature = "derive_debug", derive(Debug))]
2871#[cfg_attr(feature = "derive_default", derive(Default))]
2872#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2873#[cfg_attr(feature = "derive_clone", derive(Clone))]
2874#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2875pub struct CashDeposit1 {
2876	#[cfg_attr( feature = "derive_serde", serde(rename = "NoteDnmtn") )]
2877	pub note_dnmtn: ActiveCurrencyAndAmount,
2878	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfNotes") )]
2879	pub nb_of_notes: String,
2880	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
2881	pub amt: ActiveCurrencyAndAmount,
2882}
2883
2884impl CashDeposit1 {
2885	pub fn validate(&self) -> Result<(), ValidationError> {
2886		self.note_dnmtn.validate()?;
2887		let pattern = Regex::new("[0-9]{1,15}").unwrap();
2888		if !pattern.is_match(&self.nb_of_notes) {
2889			return Err(ValidationError::new(1005, "nb_of_notes does not match the required pattern".to_string()));
2890		}
2891		self.amt.validate()?;
2892		Ok(())
2893	}
2894}
2895
2896
2897// CategoryPurpose1Choice ...
2898#[cfg_attr(feature = "derive_debug", derive(Debug))]
2899#[cfg_attr(feature = "derive_default", derive(Default))]
2900#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2901#[cfg_attr(feature = "derive_clone", derive(Clone))]
2902#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2903pub struct CategoryPurpose1Choice {
2904	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
2905	pub cd: Option<String>,
2906	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
2907	pub prtry: Option<String>,
2908}
2909
2910impl CategoryPurpose1Choice {
2911	pub fn validate(&self) -> Result<(), ValidationError> {
2912		if let Some(ref val) = self.cd {
2913			if val.chars().count() < 1 {
2914				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
2915			}
2916			if val.chars().count() > 4 {
2917				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
2918			}
2919		}
2920		if let Some(ref val) = self.prtry {
2921			if val.chars().count() < 1 {
2922				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
2923			}
2924			if val.chars().count() > 35 {
2925				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
2926			}
2927		}
2928		Ok(())
2929	}
2930}
2931
2932
2933// ChargeBearerType1Code ...
2934#[cfg_attr(feature = "derive_debug", derive(Debug))]
2935#[cfg_attr(feature = "derive_default", derive(Default))]
2936#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2937#[cfg_attr(feature = "derive_clone", derive(Clone))]
2938#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2939pub enum ChargeBearerType1Code {
2940	#[cfg_attr(feature = "derive_default", default)]
2941	#[cfg_attr( feature = "derive_serde", serde(rename = "DEBT") )]
2942	CodeDEBT,
2943	#[cfg_attr( feature = "derive_serde", serde(rename = "CRED") )]
2944	CodeCRED,
2945	#[cfg_attr( feature = "derive_serde", serde(rename = "SHAR") )]
2946	CodeSHAR,
2947	#[cfg_attr( feature = "derive_serde", serde(rename = "SLEV") )]
2948	CodeSLEV,
2949}
2950
2951impl ChargeBearerType1Code {
2952	pub fn validate(&self) -> Result<(), ValidationError> {
2953		Ok(())
2954	}
2955}
2956
2957
2958// ChargeType3Choice ...
2959#[cfg_attr(feature = "derive_debug", derive(Debug))]
2960#[cfg_attr(feature = "derive_default", derive(Default))]
2961#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "derive_clone", derive(Clone))]
2963#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2964pub struct ChargeType3Choice {
2965	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
2966	pub cd: Option<String>,
2967	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
2968	pub prtry: Option<GenericIdentification3>,
2969}
2970
2971impl ChargeType3Choice {
2972	pub fn validate(&self) -> Result<(), ValidationError> {
2973		if let Some(ref val) = self.cd {
2974			if val.chars().count() < 1 {
2975				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
2976			}
2977			if val.chars().count() > 4 {
2978				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
2979			}
2980		}
2981		if let Some(ref val) = self.prtry { val.validate()? }
2982		Ok(())
2983	}
2984}
2985
2986
2987// Charges6 ...
2988#[cfg_attr(feature = "derive_debug", derive(Debug))]
2989#[cfg_attr(feature = "derive_default", derive(Default))]
2990#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "derive_clone", derive(Clone))]
2992#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
2993pub struct Charges6 {
2994	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlChrgsAndTaxAmt", skip_serializing_if = "Option::is_none") )]
2995	pub ttl_chrgs_and_tax_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
2996	#[cfg_attr( feature = "derive_serde", serde(rename = "Rcrd", skip_serializing_if = "Option::is_none") )]
2997	pub rcrd: Option<Vec<ChargesRecord3>>,
2998}
2999
3000impl Charges6 {
3001	pub fn validate(&self) -> Result<(), ValidationError> {
3002		if let Some(ref val) = self.ttl_chrgs_and_tax_amt { val.validate()? }
3003		if let Some(ref vec) = self.rcrd { for item in vec { item.validate()? } }
3004		Ok(())
3005	}
3006}
3007
3008
3009// Charges7 ...
3010#[cfg_attr(feature = "derive_debug", derive(Debug))]
3011#[cfg_attr(feature = "derive_default", derive(Default))]
3012#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3013#[cfg_attr(feature = "derive_clone", derive(Clone))]
3014#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3015pub struct Charges7 {
3016	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
3017	pub amt: ActiveOrHistoricCurrencyAndAmount,
3018	#[cfg_attr( feature = "derive_serde", serde(rename = "Agt") )]
3019	pub agt: BranchAndFinancialInstitutionIdentification6,
3020}
3021
3022impl Charges7 {
3023	pub fn validate(&self) -> Result<(), ValidationError> {
3024		self.amt.validate()?;
3025		self.agt.validate()?;
3026		Ok(())
3027	}
3028}
3029
3030
3031// ChargesRecord3 ...
3032#[cfg_attr(feature = "derive_debug", derive(Debug))]
3033#[cfg_attr(feature = "derive_default", derive(Default))]
3034#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3035#[cfg_attr(feature = "derive_clone", derive(Clone))]
3036#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3037pub struct ChargesRecord3 {
3038	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
3039	pub amt: ActiveOrHistoricCurrencyAndAmount,
3040	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none") )]
3041	pub cdt_dbt_ind: Option<CreditDebitCode>,
3042	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgInclInd", skip_serializing_if = "Option::is_none") )]
3043	pub chrg_incl_ind: Option<bool>,
3044	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
3045	pub tp: Option<ChargeType3Choice>,
3046	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
3047	pub rate: Option<f64>,
3048	#[cfg_attr( feature = "derive_serde", serde(rename = "Br", skip_serializing_if = "Option::is_none") )]
3049	pub br: Option<ChargeBearerType1Code>,
3050	#[cfg_attr( feature = "derive_serde", serde(rename = "Agt", skip_serializing_if = "Option::is_none") )]
3051	pub agt: Option<BranchAndFinancialInstitutionIdentification6>,
3052	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
3053	pub tax: Option<TaxCharges2>,
3054}
3055
3056impl ChargesRecord3 {
3057	pub fn validate(&self) -> Result<(), ValidationError> {
3058		self.amt.validate()?;
3059		if let Some(ref val) = self.cdt_dbt_ind { val.validate()? }
3060		if let Some(ref val) = self.tp { val.validate()? }
3061		if let Some(ref val) = self.br { val.validate()? }
3062		if let Some(ref val) = self.agt { val.validate()? }
3063		if let Some(ref val) = self.tax { val.validate()? }
3064		Ok(())
3065	}
3066}
3067
3068
3069// Cheque11 ...
3070#[cfg_attr(feature = "derive_debug", derive(Debug))]
3071#[cfg_attr(feature = "derive_default", derive(Default))]
3072#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3073#[cfg_attr(feature = "derive_clone", derive(Clone))]
3074#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3075pub struct Cheque11 {
3076	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqTp", skip_serializing_if = "Option::is_none") )]
3077	pub chq_tp: Option<ChequeType2Code>,
3078	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqNb", skip_serializing_if = "Option::is_none") )]
3079	pub chq_nb: Option<String>,
3080	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqFr", skip_serializing_if = "Option::is_none") )]
3081	pub chq_fr: Option<NameAndAddress16>,
3082	#[cfg_attr( feature = "derive_serde", serde(rename = "DlvryMtd", skip_serializing_if = "Option::is_none") )]
3083	pub dlvry_mtd: Option<ChequeDeliveryMethod1Choice>,
3084	#[cfg_attr( feature = "derive_serde", serde(rename = "DlvrTo", skip_serializing_if = "Option::is_none") )]
3085	pub dlvr_to: Option<NameAndAddress16>,
3086	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrPrty", skip_serializing_if = "Option::is_none") )]
3087	pub instr_prty: Option<Priority2Code>,
3088	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqMtrtyDt", skip_serializing_if = "Option::is_none") )]
3089	pub chq_mtrty_dt: Option<String>,
3090	#[cfg_attr( feature = "derive_serde", serde(rename = "FrmsCd", skip_serializing_if = "Option::is_none") )]
3091	pub frms_cd: Option<String>,
3092	#[cfg_attr( feature = "derive_serde", serde(rename = "MemoFld", skip_serializing_if = "Option::is_none") )]
3093	pub memo_fld: Option<Vec<String>>,
3094	#[cfg_attr( feature = "derive_serde", serde(rename = "RgnlClrZone", skip_serializing_if = "Option::is_none") )]
3095	pub rgnl_clr_zone: Option<String>,
3096	#[cfg_attr( feature = "derive_serde", serde(rename = "PrtLctn", skip_serializing_if = "Option::is_none") )]
3097	pub prt_lctn: Option<String>,
3098	#[cfg_attr( feature = "derive_serde", serde(rename = "Sgntr", skip_serializing_if = "Option::is_none") )]
3099	pub sgntr: Option<Vec<String>>,
3100}
3101
3102impl Cheque11 {
3103	pub fn validate(&self) -> Result<(), ValidationError> {
3104		if let Some(ref val) = self.chq_tp { val.validate()? }
3105		if let Some(ref val) = self.chq_nb {
3106			if val.chars().count() < 1 {
3107				return Err(ValidationError::new(1001, "chq_nb is shorter than the minimum length of 1".to_string()));
3108			}
3109			if val.chars().count() > 35 {
3110				return Err(ValidationError::new(1002, "chq_nb exceeds the maximum length of 35".to_string()));
3111			}
3112		}
3113		if let Some(ref val) = self.chq_fr { val.validate()? }
3114		if let Some(ref val) = self.dlvry_mtd { val.validate()? }
3115		if let Some(ref val) = self.dlvr_to { val.validate()? }
3116		if let Some(ref val) = self.instr_prty { val.validate()? }
3117		if let Some(ref val) = self.frms_cd {
3118			if val.chars().count() < 1 {
3119				return Err(ValidationError::new(1001, "frms_cd is shorter than the minimum length of 1".to_string()));
3120			}
3121			if val.chars().count() > 35 {
3122				return Err(ValidationError::new(1002, "frms_cd exceeds the maximum length of 35".to_string()));
3123			}
3124		}
3125		if let Some(ref vec) = self.memo_fld {
3126			for item in vec {
3127				if item.chars().count() < 1 {
3128					return Err(ValidationError::new(1001, "memo_fld is shorter than the minimum length of 1".to_string()));
3129				}
3130				if item.chars().count() > 35 {
3131					return Err(ValidationError::new(1002, "memo_fld exceeds the maximum length of 35".to_string()));
3132				}
3133			}
3134		}
3135		if let Some(ref val) = self.rgnl_clr_zone {
3136			if val.chars().count() < 1 {
3137				return Err(ValidationError::new(1001, "rgnl_clr_zone is shorter than the minimum length of 1".to_string()));
3138			}
3139			if val.chars().count() > 35 {
3140				return Err(ValidationError::new(1002, "rgnl_clr_zone exceeds the maximum length of 35".to_string()));
3141			}
3142		}
3143		if let Some(ref val) = self.prt_lctn {
3144			if val.chars().count() < 1 {
3145				return Err(ValidationError::new(1001, "prt_lctn is shorter than the minimum length of 1".to_string()));
3146			}
3147			if val.chars().count() > 35 {
3148				return Err(ValidationError::new(1002, "prt_lctn exceeds the maximum length of 35".to_string()));
3149			}
3150		}
3151		if let Some(ref vec) = self.sgntr {
3152			for item in vec {
3153				if item.chars().count() < 1 {
3154					return Err(ValidationError::new(1001, "sgntr is shorter than the minimum length of 1".to_string()));
3155				}
3156				if item.chars().count() > 70 {
3157					return Err(ValidationError::new(1002, "sgntr exceeds the maximum length of 70".to_string()));
3158				}
3159			}
3160		}
3161		Ok(())
3162	}
3163}
3164
3165
3166// ChequeDelivery1Code ...
3167#[cfg_attr(feature = "derive_debug", derive(Debug))]
3168#[cfg_attr(feature = "derive_default", derive(Default))]
3169#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3170#[cfg_attr(feature = "derive_clone", derive(Clone))]
3171#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3172pub enum ChequeDelivery1Code {
3173	#[cfg_attr(feature = "derive_default", default)]
3174	#[cfg_attr( feature = "derive_serde", serde(rename = "MLDB") )]
3175	CodeMLDB,
3176	#[cfg_attr( feature = "derive_serde", serde(rename = "MLCD") )]
3177	CodeMLCD,
3178	#[cfg_attr( feature = "derive_serde", serde(rename = "MLFA") )]
3179	CodeMLFA,
3180	#[cfg_attr( feature = "derive_serde", serde(rename = "CRDB") )]
3181	CodeCRDB,
3182	#[cfg_attr( feature = "derive_serde", serde(rename = "CRCD") )]
3183	CodeCRCD,
3184	#[cfg_attr( feature = "derive_serde", serde(rename = "CRFA") )]
3185	CodeCRFA,
3186	#[cfg_attr( feature = "derive_serde", serde(rename = "PUDB") )]
3187	CodePUDB,
3188	#[cfg_attr( feature = "derive_serde", serde(rename = "PUCD") )]
3189	CodePUCD,
3190	#[cfg_attr( feature = "derive_serde", serde(rename = "PUFA") )]
3191	CodePUFA,
3192	#[cfg_attr( feature = "derive_serde", serde(rename = "RGDB") )]
3193	CodeRGDB,
3194	#[cfg_attr( feature = "derive_serde", serde(rename = "RGCD") )]
3195	CodeRGCD,
3196	#[cfg_attr( feature = "derive_serde", serde(rename = "RGFA") )]
3197	CodeRGFA,
3198}
3199
3200impl ChequeDelivery1Code {
3201	pub fn validate(&self) -> Result<(), ValidationError> {
3202		Ok(())
3203	}
3204}
3205
3206
3207// ChequeDeliveryMethod1Choice ...
3208#[cfg_attr(feature = "derive_debug", derive(Debug))]
3209#[cfg_attr(feature = "derive_default", derive(Default))]
3210#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3211#[cfg_attr(feature = "derive_clone", derive(Clone))]
3212#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3213pub struct ChequeDeliveryMethod1Choice {
3214	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3215	pub cd: Option<ChequeDelivery1Code>,
3216	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3217	pub prtry: Option<String>,
3218}
3219
3220impl ChequeDeliveryMethod1Choice {
3221	pub fn validate(&self) -> Result<(), ValidationError> {
3222		if let Some(ref val) = self.cd { val.validate()? }
3223		if let Some(ref val) = self.prtry {
3224			if val.chars().count() < 1 {
3225				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3226			}
3227			if val.chars().count() > 35 {
3228				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3229			}
3230		}
3231		Ok(())
3232	}
3233}
3234
3235
3236// ChequeType2Code ...
3237#[cfg_attr(feature = "derive_debug", derive(Debug))]
3238#[cfg_attr(feature = "derive_default", derive(Default))]
3239#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3240#[cfg_attr(feature = "derive_clone", derive(Clone))]
3241#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3242pub enum ChequeType2Code {
3243	#[cfg_attr(feature = "derive_default", default)]
3244	#[cfg_attr( feature = "derive_serde", serde(rename = "CCHQ") )]
3245	CodeCCHQ,
3246	#[cfg_attr( feature = "derive_serde", serde(rename = "CCCH") )]
3247	CodeCCCH,
3248	#[cfg_attr( feature = "derive_serde", serde(rename = "BCHQ") )]
3249	CodeBCHQ,
3250	#[cfg_attr( feature = "derive_serde", serde(rename = "DRFT") )]
3251	CodeDRFT,
3252	#[cfg_attr( feature = "derive_serde", serde(rename = "ELDR") )]
3253	CodeELDR,
3254}
3255
3256impl ChequeType2Code {
3257	pub fn validate(&self) -> Result<(), ValidationError> {
3258		Ok(())
3259	}
3260}
3261
3262
3263// ClaimNonReceipt2 ...
3264#[cfg_attr(feature = "derive_debug", derive(Debug))]
3265#[cfg_attr(feature = "derive_default", derive(Default))]
3266#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3267#[cfg_attr(feature = "derive_clone", derive(Clone))]
3268#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3269pub struct ClaimNonReceipt2 {
3270	#[cfg_attr( feature = "derive_serde", serde(rename = "DtPrcd") )]
3271	pub dt_prcd: String,
3272	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNxtAgt", skip_serializing_if = "Option::is_none") )]
3273	pub orgnl_nxt_agt: Option<BranchAndFinancialInstitutionIdentification6>,
3274}
3275
3276impl ClaimNonReceipt2 {
3277	pub fn validate(&self) -> Result<(), ValidationError> {
3278		if let Some(ref val) = self.orgnl_nxt_agt { val.validate()? }
3279		Ok(())
3280	}
3281}
3282
3283
3284// ClaimNonReceipt2Choice ...
3285#[cfg_attr(feature = "derive_debug", derive(Debug))]
3286#[cfg_attr(feature = "derive_default", derive(Default))]
3287#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3288#[cfg_attr(feature = "derive_clone", derive(Clone))]
3289#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3290pub struct ClaimNonReceipt2Choice {
3291	#[cfg_attr( feature = "derive_serde", serde(rename = "Accptd", skip_serializing_if = "Option::is_none") )]
3292	pub accptd: Option<ClaimNonReceipt2>,
3293	#[cfg_attr( feature = "derive_serde", serde(rename = "Rjctd", skip_serializing_if = "Option::is_none") )]
3294	pub rjctd: Option<ClaimNonReceiptRejectReason1Choice>,
3295}
3296
3297impl ClaimNonReceipt2Choice {
3298	pub fn validate(&self) -> Result<(), ValidationError> {
3299		if let Some(ref val) = self.accptd { val.validate()? }
3300		if let Some(ref val) = self.rjctd { val.validate()? }
3301		Ok(())
3302	}
3303}
3304
3305
3306// ClaimNonReceiptRejectReason1Choice ...
3307#[cfg_attr(feature = "derive_debug", derive(Debug))]
3308#[cfg_attr(feature = "derive_default", derive(Default))]
3309#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "derive_clone", derive(Clone))]
3311#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3312pub struct ClaimNonReceiptRejectReason1Choice {
3313	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3314	pub cd: Option<String>,
3315	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3316	pub prtry: Option<String>,
3317}
3318
3319impl ClaimNonReceiptRejectReason1Choice {
3320	pub fn validate(&self) -> Result<(), ValidationError> {
3321		if let Some(ref val) = self.cd {
3322			if val.chars().count() < 1 {
3323				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
3324			}
3325			if val.chars().count() > 4 {
3326				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
3327			}
3328		}
3329		if let Some(ref val) = self.prtry {
3330			if val.chars().count() < 1 {
3331				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3332			}
3333			if val.chars().count() > 35 {
3334				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3335			}
3336		}
3337		Ok(())
3338	}
3339}
3340
3341
3342// ClearingChannel2Code ...
3343#[cfg_attr(feature = "derive_debug", derive(Debug))]
3344#[cfg_attr(feature = "derive_default", derive(Default))]
3345#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3346#[cfg_attr(feature = "derive_clone", derive(Clone))]
3347#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3348pub enum ClearingChannel2Code {
3349	#[cfg_attr(feature = "derive_default", default)]
3350	#[cfg_attr( feature = "derive_serde", serde(rename = "RTGS") )]
3351	CodeRTGS,
3352	#[cfg_attr( feature = "derive_serde", serde(rename = "RTNS") )]
3353	CodeRTNS,
3354	#[cfg_attr( feature = "derive_serde", serde(rename = "MPNS") )]
3355	CodeMPNS,
3356	#[cfg_attr( feature = "derive_serde", serde(rename = "BOOK") )]
3357	CodeBOOK,
3358}
3359
3360impl ClearingChannel2Code {
3361	pub fn validate(&self) -> Result<(), ValidationError> {
3362		Ok(())
3363	}
3364}
3365
3366
3367// ClearingSystemIdentification2Choice ...
3368#[cfg_attr(feature = "derive_debug", derive(Debug))]
3369#[cfg_attr(feature = "derive_default", derive(Default))]
3370#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3371#[cfg_attr(feature = "derive_clone", derive(Clone))]
3372#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3373pub struct ClearingSystemIdentification2Choice {
3374	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3375	pub cd: Option<String>,
3376	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3377	pub prtry: Option<String>,
3378}
3379
3380impl ClearingSystemIdentification2Choice {
3381	pub fn validate(&self) -> Result<(), ValidationError> {
3382		if let Some(ref val) = self.cd {
3383			if val.chars().count() < 1 {
3384				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
3385			}
3386			if val.chars().count() > 5 {
3387				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 5".to_string()));
3388			}
3389		}
3390		if let Some(ref val) = self.prtry {
3391			if val.chars().count() < 1 {
3392				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3393			}
3394			if val.chars().count() > 35 {
3395				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3396			}
3397		}
3398		Ok(())
3399	}
3400}
3401
3402
3403// ClearingSystemIdentification3Choice ...
3404#[cfg_attr(feature = "derive_debug", derive(Debug))]
3405#[cfg_attr(feature = "derive_default", derive(Default))]
3406#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3407#[cfg_attr(feature = "derive_clone", derive(Clone))]
3408#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3409pub struct ClearingSystemIdentification3Choice {
3410	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3411	pub cd: Option<String>,
3412	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3413	pub prtry: Option<String>,
3414}
3415
3416impl ClearingSystemIdentification3Choice {
3417	pub fn validate(&self) -> Result<(), ValidationError> {
3418		if let Some(ref val) = self.cd {
3419			if val.chars().count() < 1 {
3420				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
3421			}
3422			if val.chars().count() > 3 {
3423				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 3".to_string()));
3424			}
3425		}
3426		if let Some(ref val) = self.prtry {
3427			if val.chars().count() < 1 {
3428				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3429			}
3430			if val.chars().count() > 35 {
3431				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3432			}
3433		}
3434		Ok(())
3435	}
3436}
3437
3438
3439// ClearingSystemMemberIdentification2 ...
3440#[cfg_attr(feature = "derive_debug", derive(Debug))]
3441#[cfg_attr(feature = "derive_default", derive(Default))]
3442#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3443#[cfg_attr(feature = "derive_clone", derive(Clone))]
3444#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3445pub struct ClearingSystemMemberIdentification2 {
3446	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysId", skip_serializing_if = "Option::is_none") )]
3447	pub clr_sys_id: Option<ClearingSystemIdentification2Choice>,
3448	#[cfg_attr( feature = "derive_serde", serde(rename = "MmbId") )]
3449	pub mmb_id: String,
3450}
3451
3452impl ClearingSystemMemberIdentification2 {
3453	pub fn validate(&self) -> Result<(), ValidationError> {
3454		if let Some(ref val) = self.clr_sys_id { val.validate()? }
3455		if self.mmb_id.chars().count() < 1 {
3456			return Err(ValidationError::new(1001, "mmb_id is shorter than the minimum length of 1".to_string()));
3457		}
3458		if self.mmb_id.chars().count() > 35 {
3459			return Err(ValidationError::new(1002, "mmb_id exceeds the maximum length of 35".to_string()));
3460		}
3461		Ok(())
3462	}
3463}
3464
3465
3466// Compensation2 ...
3467#[cfg_attr(feature = "derive_debug", derive(Debug))]
3468#[cfg_attr(feature = "derive_default", derive(Default))]
3469#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3470#[cfg_attr(feature = "derive_clone", derive(Clone))]
3471#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3472pub struct Compensation2 {
3473	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
3474	pub amt: ActiveCurrencyAndAmount,
3475	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt") )]
3476	pub dbtr_agt: BranchAndFinancialInstitutionIdentification6,
3477	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
3478	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
3479	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn") )]
3480	pub rsn: CompensationReason1Choice,
3481}
3482
3483impl Compensation2 {
3484	pub fn validate(&self) -> Result<(), ValidationError> {
3485		self.amt.validate()?;
3486		self.dbtr_agt.validate()?;
3487		self.cdtr_agt.validate()?;
3488		self.rsn.validate()?;
3489		Ok(())
3490	}
3491}
3492
3493
3494// CompensationReason1Choice ...
3495#[cfg_attr(feature = "derive_debug", derive(Debug))]
3496#[cfg_attr(feature = "derive_default", derive(Default))]
3497#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3498#[cfg_attr(feature = "derive_clone", derive(Clone))]
3499#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3500pub struct CompensationReason1Choice {
3501	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3502	pub cd: Option<String>,
3503	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3504	pub prtry: Option<String>,
3505}
3506
3507impl CompensationReason1Choice {
3508	pub fn validate(&self) -> Result<(), ValidationError> {
3509		if let Some(ref val) = self.cd {
3510			if val.chars().count() < 1 {
3511				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
3512			}
3513			if val.chars().count() > 4 {
3514				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
3515			}
3516		}
3517		if let Some(ref val) = self.prtry {
3518			if val.chars().count() < 1 {
3519				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3520			}
3521			if val.chars().count() > 35 {
3522				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3523			}
3524		}
3525		Ok(())
3526	}
3527}
3528
3529
3530// Contact4 ...
3531#[cfg_attr(feature = "derive_debug", derive(Debug))]
3532#[cfg_attr(feature = "derive_default", derive(Default))]
3533#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3534#[cfg_attr(feature = "derive_clone", derive(Clone))]
3535#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3536pub struct Contact4 {
3537	#[cfg_attr( feature = "derive_serde", serde(rename = "NmPrfx", skip_serializing_if = "Option::is_none") )]
3538	pub nm_prfx: Option<NamePrefix2Code>,
3539	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
3540	pub nm: Option<String>,
3541	#[cfg_attr( feature = "derive_serde", serde(rename = "PhneNb", skip_serializing_if = "Option::is_none") )]
3542	pub phne_nb: Option<String>,
3543	#[cfg_attr( feature = "derive_serde", serde(rename = "MobNb", skip_serializing_if = "Option::is_none") )]
3544	pub mob_nb: Option<String>,
3545	#[cfg_attr( feature = "derive_serde", serde(rename = "FaxNb", skip_serializing_if = "Option::is_none") )]
3546	pub fax_nb: Option<String>,
3547	#[cfg_attr( feature = "derive_serde", serde(rename = "EmailAdr", skip_serializing_if = "Option::is_none") )]
3548	pub email_adr: Option<String>,
3549	#[cfg_attr( feature = "derive_serde", serde(rename = "EmailPurp", skip_serializing_if = "Option::is_none") )]
3550	pub email_purp: Option<String>,
3551	#[cfg_attr( feature = "derive_serde", serde(rename = "JobTitl", skip_serializing_if = "Option::is_none") )]
3552	pub job_titl: Option<String>,
3553	#[cfg_attr( feature = "derive_serde", serde(rename = "Rspnsblty", skip_serializing_if = "Option::is_none") )]
3554	pub rspnsblty: Option<String>,
3555	#[cfg_attr( feature = "derive_serde", serde(rename = "Dept", skip_serializing_if = "Option::is_none") )]
3556	pub dept: Option<String>,
3557	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
3558	pub othr: Option<Vec<OtherContact1>>,
3559	#[cfg_attr( feature = "derive_serde", serde(rename = "PrefrdMtd", skip_serializing_if = "Option::is_none") )]
3560	pub prefrd_mtd: Option<PreferredContactMethod1Code>,
3561}
3562
3563impl Contact4 {
3564	pub fn validate(&self) -> Result<(), ValidationError> {
3565		if let Some(ref val) = self.nm_prfx { val.validate()? }
3566		if let Some(ref val) = self.nm {
3567			if val.chars().count() < 1 {
3568				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
3569			}
3570			if val.chars().count() > 140 {
3571				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
3572			}
3573		}
3574		if let Some(ref val) = self.phne_nb {
3575			let pattern = Regex::new("\\+[0-9]{1,3}-[0-9()+\\-]{1,30}").unwrap();
3576			if !pattern.is_match(val) {
3577				return Err(ValidationError::new(1005, "phne_nb does not match the required pattern".to_string()));
3578			}
3579		}
3580		if let Some(ref val) = self.mob_nb {
3581			let pattern = Regex::new("\\+[0-9]{1,3}-[0-9()+\\-]{1,30}").unwrap();
3582			if !pattern.is_match(val) {
3583				return Err(ValidationError::new(1005, "mob_nb does not match the required pattern".to_string()));
3584			}
3585		}
3586		if let Some(ref val) = self.fax_nb {
3587			let pattern = Regex::new("\\+[0-9]{1,3}-[0-9()+\\-]{1,30}").unwrap();
3588			if !pattern.is_match(val) {
3589				return Err(ValidationError::new(1005, "fax_nb does not match the required pattern".to_string()));
3590			}
3591		}
3592		if let Some(ref val) = self.email_adr {
3593			if val.chars().count() < 1 {
3594				return Err(ValidationError::new(1001, "email_adr is shorter than the minimum length of 1".to_string()));
3595			}
3596			if val.chars().count() > 2048 {
3597				return Err(ValidationError::new(1002, "email_adr exceeds the maximum length of 2048".to_string()));
3598			}
3599		}
3600		if let Some(ref val) = self.email_purp {
3601			if val.chars().count() < 1 {
3602				return Err(ValidationError::new(1001, "email_purp is shorter than the minimum length of 1".to_string()));
3603			}
3604			if val.chars().count() > 35 {
3605				return Err(ValidationError::new(1002, "email_purp exceeds the maximum length of 35".to_string()));
3606			}
3607		}
3608		if let Some(ref val) = self.job_titl {
3609			if val.chars().count() < 1 {
3610				return Err(ValidationError::new(1001, "job_titl is shorter than the minimum length of 1".to_string()));
3611			}
3612			if val.chars().count() > 35 {
3613				return Err(ValidationError::new(1002, "job_titl exceeds the maximum length of 35".to_string()));
3614			}
3615		}
3616		if let Some(ref val) = self.rspnsblty {
3617			if val.chars().count() < 1 {
3618				return Err(ValidationError::new(1001, "rspnsblty is shorter than the minimum length of 1".to_string()));
3619			}
3620			if val.chars().count() > 35 {
3621				return Err(ValidationError::new(1002, "rspnsblty exceeds the maximum length of 35".to_string()));
3622			}
3623		}
3624		if let Some(ref val) = self.dept {
3625			if val.chars().count() < 1 {
3626				return Err(ValidationError::new(1001, "dept is shorter than the minimum length of 1".to_string()));
3627			}
3628			if val.chars().count() > 70 {
3629				return Err(ValidationError::new(1002, "dept exceeds the maximum length of 70".to_string()));
3630			}
3631		}
3632		if let Some(ref vec) = self.othr { for item in vec { item.validate()? } }
3633		if let Some(ref val) = self.prefrd_mtd { val.validate()? }
3634		Ok(())
3635	}
3636}
3637
3638
3639// ControlData1 ...
3640#[cfg_attr(feature = "derive_debug", derive(Debug))]
3641#[cfg_attr(feature = "derive_default", derive(Default))]
3642#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3643#[cfg_attr(feature = "derive_clone", derive(Clone))]
3644#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3645pub struct ControlData1 {
3646	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs") )]
3647	pub nb_of_txs: String,
3648	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
3649	pub ctrl_sum: Option<f64>,
3650}
3651
3652impl ControlData1 {
3653	pub fn validate(&self) -> Result<(), ValidationError> {
3654		let pattern = Regex::new("[0-9]{1,15}").unwrap();
3655		if !pattern.is_match(&self.nb_of_txs) {
3656			return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
3657		}
3658		Ok(())
3659	}
3660}
3661
3662
3663// CopyDuplicate1Code ...
3664#[cfg_attr(feature = "derive_debug", derive(Debug))]
3665#[cfg_attr(feature = "derive_default", derive(Default))]
3666#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3667#[cfg_attr(feature = "derive_clone", derive(Clone))]
3668#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3669pub enum CopyDuplicate1Code {
3670	#[cfg_attr(feature = "derive_default", default)]
3671	#[cfg_attr( feature = "derive_serde", serde(rename = "CODU") )]
3672	CodeCODU,
3673	#[cfg_attr( feature = "derive_serde", serde(rename = "COPY") )]
3674	CodeCOPY,
3675	#[cfg_attr( feature = "derive_serde", serde(rename = "DUPL") )]
3676	CodeDUPL,
3677}
3678
3679impl CopyDuplicate1Code {
3680	pub fn validate(&self) -> Result<(), ValidationError> {
3681		Ok(())
3682	}
3683}
3684
3685
3686// CorporateAction9 ...
3687#[cfg_attr(feature = "derive_debug", derive(Debug))]
3688#[cfg_attr(feature = "derive_default", derive(Default))]
3689#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3690#[cfg_attr(feature = "derive_clone", derive(Clone))]
3691#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3692pub struct CorporateAction9 {
3693	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtTp") )]
3694	pub evt_tp: String,
3695	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtId") )]
3696	pub evt_id: String,
3697}
3698
3699impl CorporateAction9 {
3700	pub fn validate(&self) -> Result<(), ValidationError> {
3701		if self.evt_tp.chars().count() < 1 {
3702			return Err(ValidationError::new(1001, "evt_tp is shorter than the minimum length of 1".to_string()));
3703		}
3704		if self.evt_tp.chars().count() > 35 {
3705			return Err(ValidationError::new(1002, "evt_tp exceeds the maximum length of 35".to_string()));
3706		}
3707		if self.evt_id.chars().count() < 1 {
3708			return Err(ValidationError::new(1001, "evt_id is shorter than the minimum length of 1".to_string()));
3709		}
3710		if self.evt_id.chars().count() > 35 {
3711			return Err(ValidationError::new(1002, "evt_id exceeds the maximum length of 35".to_string()));
3712		}
3713		Ok(())
3714	}
3715}
3716
3717
3718// CorrectiveGroupInformation1 ...
3719#[cfg_attr(feature = "derive_debug", derive(Debug))]
3720#[cfg_attr(feature = "derive_default", derive(Default))]
3721#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3722#[cfg_attr(feature = "derive_clone", derive(Clone))]
3723#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3724pub struct CorrectiveGroupInformation1 {
3725	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
3726	pub msg_id: String,
3727	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgNmId") )]
3728	pub msg_nm_id: String,
3729	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
3730	pub cre_dt_tm: Option<String>,
3731}
3732
3733impl CorrectiveGroupInformation1 {
3734	pub fn validate(&self) -> Result<(), ValidationError> {
3735		if self.msg_id.chars().count() < 1 {
3736			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
3737		}
3738		if self.msg_id.chars().count() > 35 {
3739			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
3740		}
3741		if self.msg_nm_id.chars().count() < 1 {
3742			return Err(ValidationError::new(1001, "msg_nm_id is shorter than the minimum length of 1".to_string()));
3743		}
3744		if self.msg_nm_id.chars().count() > 35 {
3745			return Err(ValidationError::new(1002, "msg_nm_id exceeds the maximum length of 35".to_string()));
3746		}
3747		Ok(())
3748	}
3749}
3750
3751
3752// CorrectiveInterbankTransaction2 ...
3753#[cfg_attr(feature = "derive_debug", derive(Debug))]
3754#[cfg_attr(feature = "derive_default", derive(Default))]
3755#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3756#[cfg_attr(feature = "derive_clone", derive(Clone))]
3757#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3758pub struct CorrectiveInterbankTransaction2 {
3759	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpHdr", skip_serializing_if = "Option::is_none") )]
3760	pub grp_hdr: Option<CorrectiveGroupInformation1>,
3761	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
3762	pub instr_id: Option<String>,
3763	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none") )]
3764	pub end_to_end_id: Option<String>,
3765	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
3766	pub tx_id: Option<String>,
3767	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
3768	pub uetr: Option<String>,
3769	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt") )]
3770	pub intr_bk_sttlm_amt: ActiveOrHistoricCurrencyAndAmount,
3771	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt") )]
3772	pub intr_bk_sttlm_dt: String,
3773}
3774
3775impl CorrectiveInterbankTransaction2 {
3776	pub fn validate(&self) -> Result<(), ValidationError> {
3777		if let Some(ref val) = self.grp_hdr { val.validate()? }
3778		if let Some(ref val) = self.instr_id {
3779			if val.chars().count() < 1 {
3780				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
3781			}
3782			if val.chars().count() > 35 {
3783				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
3784			}
3785		}
3786		if let Some(ref val) = self.end_to_end_id {
3787			if val.chars().count() < 1 {
3788				return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
3789			}
3790			if val.chars().count() > 35 {
3791				return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
3792			}
3793		}
3794		if let Some(ref val) = self.tx_id {
3795			if val.chars().count() < 1 {
3796				return Err(ValidationError::new(1001, "tx_id is shorter than the minimum length of 1".to_string()));
3797			}
3798			if val.chars().count() > 35 {
3799				return Err(ValidationError::new(1002, "tx_id exceeds the maximum length of 35".to_string()));
3800			}
3801		}
3802		if let Some(ref val) = self.uetr {
3803			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
3804			if !pattern.is_match(val) {
3805				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
3806			}
3807		}
3808		self.intr_bk_sttlm_amt.validate()?;
3809		Ok(())
3810	}
3811}
3812
3813
3814// CorrectivePaymentInitiation4 ...
3815#[cfg_attr(feature = "derive_debug", derive(Debug))]
3816#[cfg_attr(feature = "derive_default", derive(Default))]
3817#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3818#[cfg_attr(feature = "derive_clone", derive(Clone))]
3819#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3820pub struct CorrectivePaymentInitiation4 {
3821	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpHdr", skip_serializing_if = "Option::is_none") )]
3822	pub grp_hdr: Option<CorrectiveGroupInformation1>,
3823	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none") )]
3824	pub pmt_inf_id: Option<String>,
3825	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
3826	pub instr_id: Option<String>,
3827	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none") )]
3828	pub end_to_end_id: Option<String>,
3829	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
3830	pub uetr: Option<String>,
3831	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt") )]
3832	pub instd_amt: ActiveOrHistoricCurrencyAndAmount,
3833	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
3834	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
3835	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
3836	pub reqd_colltn_dt: Option<String>,
3837}
3838
3839impl CorrectivePaymentInitiation4 {
3840	pub fn validate(&self) -> Result<(), ValidationError> {
3841		if let Some(ref val) = self.grp_hdr { val.validate()? }
3842		if let Some(ref val) = self.pmt_inf_id {
3843			if val.chars().count() < 1 {
3844				return Err(ValidationError::new(1001, "pmt_inf_id is shorter than the minimum length of 1".to_string()));
3845			}
3846			if val.chars().count() > 35 {
3847				return Err(ValidationError::new(1002, "pmt_inf_id exceeds the maximum length of 35".to_string()));
3848			}
3849		}
3850		if let Some(ref val) = self.instr_id {
3851			if val.chars().count() < 1 {
3852				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
3853			}
3854			if val.chars().count() > 35 {
3855				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
3856			}
3857		}
3858		if let Some(ref val) = self.end_to_end_id {
3859			if val.chars().count() < 1 {
3860				return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
3861			}
3862			if val.chars().count() > 35 {
3863				return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
3864			}
3865		}
3866		if let Some(ref val) = self.uetr {
3867			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
3868			if !pattern.is_match(val) {
3869				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
3870			}
3871		}
3872		self.instd_amt.validate()?;
3873		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
3874		Ok(())
3875	}
3876}
3877
3878
3879// CorrectiveTransaction4Choice ...
3880#[cfg_attr(feature = "derive_debug", derive(Debug))]
3881#[cfg_attr(feature = "derive_default", derive(Default))]
3882#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3883#[cfg_attr(feature = "derive_clone", derive(Clone))]
3884#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3885pub struct CorrectiveTransaction4Choice {
3886	#[cfg_attr( feature = "derive_serde", serde(rename = "Initn", skip_serializing_if = "Option::is_none") )]
3887	pub initn: Option<CorrectivePaymentInitiation4>,
3888	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBk", skip_serializing_if = "Option::is_none") )]
3889	pub intr_bk: Option<CorrectiveInterbankTransaction2>,
3890}
3891
3892impl CorrectiveTransaction4Choice {
3893	pub fn validate(&self) -> Result<(), ValidationError> {
3894		if let Some(ref val) = self.initn { val.validate()? }
3895		if let Some(ref val) = self.intr_bk { val.validate()? }
3896		Ok(())
3897	}
3898}
3899
3900
3901// CreditDebitCode ...
3902#[cfg_attr(feature = "derive_debug", derive(Debug))]
3903#[cfg_attr(feature = "derive_default", derive(Default))]
3904#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3905#[cfg_attr(feature = "derive_clone", derive(Clone))]
3906#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3907pub enum CreditDebitCode {
3908	#[cfg_attr(feature = "derive_default", default)]
3909	#[cfg_attr( feature = "derive_serde", serde(rename = "CRDT") )]
3910	CodeCRDT,
3911	#[cfg_attr( feature = "derive_serde", serde(rename = "DBIT") )]
3912	CodeDBIT,
3913}
3914
3915impl CreditDebitCode {
3916	pub fn validate(&self) -> Result<(), ValidationError> {
3917		Ok(())
3918	}
3919}
3920
3921
3922// CreditLine3 ...
3923#[cfg_attr(feature = "derive_debug", derive(Debug))]
3924#[cfg_attr(feature = "derive_default", derive(Default))]
3925#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3926#[cfg_attr(feature = "derive_clone", derive(Clone))]
3927#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3928pub struct CreditLine3 {
3929	#[cfg_attr( feature = "derive_serde", serde(rename = "Incl") )]
3930	pub incl: bool,
3931	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
3932	pub tp: Option<CreditLineType1Choice>,
3933	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
3934	pub amt: Option<ActiveOrHistoricCurrencyAndAmount>,
3935	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
3936	pub dt: Option<DateAndDateTime2Choice>,
3937}
3938
3939impl CreditLine3 {
3940	pub fn validate(&self) -> Result<(), ValidationError> {
3941		if let Some(ref val) = self.tp { val.validate()? }
3942		if let Some(ref val) = self.amt { val.validate()? }
3943		if let Some(ref val) = self.dt { val.validate()? }
3944		Ok(())
3945	}
3946}
3947
3948
3949// CreditLineType1Choice ...
3950#[cfg_attr(feature = "derive_debug", derive(Debug))]
3951#[cfg_attr(feature = "derive_default", derive(Default))]
3952#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3953#[cfg_attr(feature = "derive_clone", derive(Clone))]
3954#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3955pub struct CreditLineType1Choice {
3956	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
3957	pub cd: Option<String>,
3958	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
3959	pub prtry: Option<String>,
3960}
3961
3962impl CreditLineType1Choice {
3963	pub fn validate(&self) -> Result<(), ValidationError> {
3964		if let Some(ref val) = self.cd {
3965			if val.chars().count() < 1 {
3966				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
3967			}
3968			if val.chars().count() > 4 {
3969				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
3970			}
3971		}
3972		if let Some(ref val) = self.prtry {
3973			if val.chars().count() < 1 {
3974				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
3975			}
3976			if val.chars().count() > 35 {
3977				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
3978			}
3979		}
3980		Ok(())
3981	}
3982}
3983
3984
3985// CreditTransferMandateData1 ...
3986#[cfg_attr(feature = "derive_debug", derive(Debug))]
3987#[cfg_attr(feature = "derive_default", derive(Default))]
3988#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
3989#[cfg_attr(feature = "derive_clone", derive(Clone))]
3990#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
3991pub struct CreditTransferMandateData1 {
3992	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtId", skip_serializing_if = "Option::is_none") )]
3993	pub mndt_id: Option<String>,
3994	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
3995	pub tp: Option<MandateTypeInformation2>,
3996	#[cfg_attr( feature = "derive_serde", serde(rename = "DtOfSgntr", skip_serializing_if = "Option::is_none") )]
3997	pub dt_of_sgntr: Option<String>,
3998	#[cfg_attr( feature = "derive_serde", serde(rename = "DtOfVrfctn", skip_serializing_if = "Option::is_none") )]
3999	pub dt_of_vrfctn: Option<String>,
4000	#[cfg_attr( feature = "derive_serde", serde(rename = "ElctrncSgntr", skip_serializing_if = "Option::is_none") )]
4001	pub elctrnc_sgntr: Option<String>,
4002	#[cfg_attr( feature = "derive_serde", serde(rename = "FrstPmtDt", skip_serializing_if = "Option::is_none") )]
4003	pub frst_pmt_dt: Option<String>,
4004	#[cfg_attr( feature = "derive_serde", serde(rename = "FnlPmtDt", skip_serializing_if = "Option::is_none") )]
4005	pub fnl_pmt_dt: Option<String>,
4006	#[cfg_attr( feature = "derive_serde", serde(rename = "Frqcy", skip_serializing_if = "Option::is_none") )]
4007	pub frqcy: Option<Frequency36Choice>,
4008	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
4009	pub rsn: Option<MandateSetupReason1Choice>,
4010}
4011
4012impl CreditTransferMandateData1 {
4013	pub fn validate(&self) -> Result<(), ValidationError> {
4014		if let Some(ref val) = self.mndt_id {
4015			if val.chars().count() < 1 {
4016				return Err(ValidationError::new(1001, "mndt_id is shorter than the minimum length of 1".to_string()));
4017			}
4018			if val.chars().count() > 35 {
4019				return Err(ValidationError::new(1002, "mndt_id exceeds the maximum length of 35".to_string()));
4020			}
4021		}
4022		if let Some(ref val) = self.tp { val.validate()? }
4023		if let Some(ref val) = self.elctrnc_sgntr {
4024			if val.chars().count() < 1 {
4025				return Err(ValidationError::new(1001, "elctrnc_sgntr is shorter than the minimum length of 1".to_string()));
4026			}
4027			if val.chars().count() > 10240 {
4028				return Err(ValidationError::new(1002, "elctrnc_sgntr exceeds the maximum length of 10240".to_string()));
4029			}
4030		}
4031		if let Some(ref val) = self.frqcy { val.validate()? }
4032		if let Some(ref val) = self.rsn { val.validate()? }
4033		Ok(())
4034	}
4035}
4036
4037
4038// CreditTransferTransaction35 ...
4039#[cfg_attr(feature = "derive_debug", derive(Debug))]
4040#[cfg_attr(feature = "derive_default", derive(Default))]
4041#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4042#[cfg_attr(feature = "derive_clone", derive(Clone))]
4043#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4044pub struct CreditTransferTransaction35 {
4045	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtId") )]
4046	pub pmt_id: PaymentIdentification6,
4047	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
4048	pub pmt_tp_inf: Option<PaymentTypeInformation26>,
4049	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCond", skip_serializing_if = "Option::is_none") )]
4050	pub pmt_cond: Option<PaymentCondition1>,
4051	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
4052	pub amt: AmountType4Choice,
4053	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgBr") )]
4054	pub chrg_br: ChargeBearerType1Code,
4055	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqInstr", skip_serializing_if = "Option::is_none") )]
4056	pub chq_instr: Option<Cheque11>,
4057	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
4058	pub ultmt_dbtr: Option<PartyIdentification135>,
4059	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
4060	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4061	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
4062	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4063	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
4064	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4065	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
4066	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
4067	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
4068	pub cdtr: PartyIdentification135,
4069	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
4070	pub cdtr_acct: Option<CashAccount38>,
4071	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
4072	pub ultmt_cdtr: Option<PartyIdentification135>,
4073	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
4074	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent1>>,
4075	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
4076	pub purp: Option<Purpose2Choice>,
4077	#[cfg_attr( feature = "derive_serde", serde(rename = "RgltryRptg", skip_serializing_if = "Option::is_none") )]
4078	pub rgltry_rptg: Option<Vec<RegulatoryReporting3>>,
4079	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
4080	pub tax: Option<TaxInformation8>,
4081	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdRmtInf", skip_serializing_if = "Option::is_none") )]
4082	pub rltd_rmt_inf: Option<Vec<RemittanceLocation7>>,
4083	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
4084	pub rmt_inf: Option<RemittanceInformation16>,
4085	#[cfg_attr( feature = "derive_serde", serde(rename = "NclsdFile", skip_serializing_if = "Option::is_none") )]
4086	pub nclsd_file: Option<Vec<Document12>>,
4087	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
4088	pub splmtry_data: Option<Vec<SupplementaryData1>>,
4089}
4090
4091impl CreditTransferTransaction35 {
4092	pub fn validate(&self) -> Result<(), ValidationError> {
4093		self.pmt_id.validate()?;
4094		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
4095		if let Some(ref val) = self.pmt_cond { val.validate()? }
4096		self.amt.validate()?;
4097		self.chrg_br.validate()?;
4098		if let Some(ref val) = self.chq_instr { val.validate()? }
4099		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
4100		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
4101		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
4102		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
4103		self.cdtr_agt.validate()?;
4104		self.cdtr.validate()?;
4105		if let Some(ref val) = self.cdtr_acct { val.validate()? }
4106		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
4107		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
4108		if let Some(ref val) = self.purp { val.validate()? }
4109		if let Some(ref vec) = self.rgltry_rptg { for item in vec { item.validate()? } }
4110		if let Some(ref val) = self.tax { val.validate()? }
4111		if let Some(ref vec) = self.rltd_rmt_inf { for item in vec { item.validate()? } }
4112		if let Some(ref val) = self.rmt_inf { val.validate()? }
4113		if let Some(ref vec) = self.nclsd_file { for item in vec { item.validate()? } }
4114		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
4115		Ok(())
4116	}
4117}
4118
4119
4120// CreditTransferTransaction36 ...
4121#[cfg_attr(feature = "derive_debug", derive(Debug))]
4122#[cfg_attr(feature = "derive_default", derive(Default))]
4123#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4124#[cfg_attr(feature = "derive_clone", derive(Clone))]
4125#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4126pub struct CreditTransferTransaction36 {
4127	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtId") )]
4128	pub pmt_id: PaymentIdentification7,
4129	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
4130	pub pmt_tp_inf: Option<PaymentTypeInformation28>,
4131	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt") )]
4132	pub intr_bk_sttlm_amt: ActiveCurrencyAndAmount,
4133	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
4134	pub intr_bk_sttlm_dt: Option<String>,
4135	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmPrty", skip_serializing_if = "Option::is_none") )]
4136	pub sttlm_prty: Option<Priority3Code>,
4137	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmTmIndctn", skip_serializing_if = "Option::is_none") )]
4138	pub sttlm_tm_indctn: Option<SettlementDateTimeIndication1>,
4139	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmTmReq", skip_serializing_if = "Option::is_none") )]
4140	pub sttlm_tm_req: Option<SettlementTimeRequest2>,
4141	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
4142	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4143	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
4144	pub prvs_instg_agt1_acct: Option<CashAccount38>,
4145	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
4146	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4147	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
4148	pub prvs_instg_agt2_acct: Option<CashAccount38>,
4149	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
4150	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4151	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
4152	pub prvs_instg_agt3_acct: Option<CashAccount38>,
4153	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
4154	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4155	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
4156	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4157	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
4158	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4159	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
4160	pub intrmy_agt1_acct: Option<CashAccount38>,
4161	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
4162	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4163	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
4164	pub intrmy_agt2_acct: Option<CashAccount38>,
4165	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
4166	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4167	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
4168	pub intrmy_agt3_acct: Option<CashAccount38>,
4169	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
4170	pub ultmt_dbtr: Option<BranchAndFinancialInstitutionIdentification6>,
4171	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
4172	pub dbtr: BranchAndFinancialInstitutionIdentification6,
4173	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
4174	pub dbtr_acct: Option<CashAccount38>,
4175	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
4176	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4177	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4178	pub dbtr_agt_acct: Option<CashAccount38>,
4179	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
4180	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4181	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4182	pub cdtr_agt_acct: Option<CashAccount38>,
4183	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
4184	pub cdtr: BranchAndFinancialInstitutionIdentification6,
4185	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
4186	pub cdtr_acct: Option<CashAccount38>,
4187	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
4188	pub ultmt_cdtr: Option<BranchAndFinancialInstitutionIdentification6>,
4189	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
4190	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent2>>,
4191	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForNxtAgt", skip_serializing_if = "Option::is_none") )]
4192	pub instr_for_nxt_agt: Option<Vec<InstructionForNextAgent1>>,
4193	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
4194	pub purp: Option<Purpose2Choice>,
4195	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
4196	pub rmt_inf: Option<RemittanceInformation2>,
4197	#[cfg_attr( feature = "derive_serde", serde(rename = "UndrlygCstmrCdtTrf", skip_serializing_if = "Option::is_none") )]
4198	pub undrlyg_cstmr_cdt_trf: Option<CreditTransferTransaction37>,
4199	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
4200	pub splmtry_data: Option<Vec<SupplementaryData1>>,
4201}
4202
4203impl CreditTransferTransaction36 {
4204	pub fn validate(&self) -> Result<(), ValidationError> {
4205		self.pmt_id.validate()?;
4206		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
4207		self.intr_bk_sttlm_amt.validate()?;
4208		if let Some(ref val) = self.sttlm_prty { val.validate()? }
4209		if let Some(ref val) = self.sttlm_tm_indctn { val.validate()? }
4210		if let Some(ref val) = self.sttlm_tm_req { val.validate()? }
4211		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
4212		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
4213		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
4214		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
4215		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
4216		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
4217		if let Some(ref val) = self.instg_agt { val.validate()? }
4218		if let Some(ref val) = self.instd_agt { val.validate()? }
4219		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
4220		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
4221		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
4222		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
4223		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
4224		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
4225		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
4226		self.dbtr.validate()?;
4227		if let Some(ref val) = self.dbtr_acct { val.validate()? }
4228		if let Some(ref val) = self.dbtr_agt { val.validate()? }
4229		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
4230		if let Some(ref val) = self.cdtr_agt { val.validate()? }
4231		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
4232		self.cdtr.validate()?;
4233		if let Some(ref val) = self.cdtr_acct { val.validate()? }
4234		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
4235		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
4236		if let Some(ref vec) = self.instr_for_nxt_agt { for item in vec { item.validate()? } }
4237		if let Some(ref val) = self.purp { val.validate()? }
4238		if let Some(ref val) = self.rmt_inf { val.validate()? }
4239		if let Some(ref val) = self.undrlyg_cstmr_cdt_trf { val.validate()? }
4240		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
4241		Ok(())
4242	}
4243}
4244
4245
4246// CreditTransferTransaction37 ...
4247#[cfg_attr(feature = "derive_debug", derive(Debug))]
4248#[cfg_attr(feature = "derive_default", derive(Default))]
4249#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4250#[cfg_attr(feature = "derive_clone", derive(Clone))]
4251#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4252pub struct CreditTransferTransaction37 {
4253	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
4254	pub ultmt_dbtr: Option<PartyIdentification135>,
4255	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty", skip_serializing_if = "Option::is_none") )]
4256	pub initg_pty: Option<PartyIdentification135>,
4257	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
4258	pub dbtr: PartyIdentification135,
4259	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
4260	pub dbtr_acct: Option<CashAccount38>,
4261	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt") )]
4262	pub dbtr_agt: BranchAndFinancialInstitutionIdentification6,
4263	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4264	pub dbtr_agt_acct: Option<CashAccount38>,
4265	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
4266	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4267	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
4268	pub prvs_instg_agt1_acct: Option<CashAccount38>,
4269	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
4270	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4271	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
4272	pub prvs_instg_agt2_acct: Option<CashAccount38>,
4273	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
4274	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4275	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
4276	pub prvs_instg_agt3_acct: Option<CashAccount38>,
4277	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
4278	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4279	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
4280	pub intrmy_agt1_acct: Option<CashAccount38>,
4281	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
4282	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4283	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
4284	pub intrmy_agt2_acct: Option<CashAccount38>,
4285	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
4286	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4287	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
4288	pub intrmy_agt3_acct: Option<CashAccount38>,
4289	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
4290	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
4291	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4292	pub cdtr_agt_acct: Option<CashAccount38>,
4293	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
4294	pub cdtr: PartyIdentification135,
4295	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
4296	pub cdtr_acct: Option<CashAccount38>,
4297	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
4298	pub ultmt_cdtr: Option<PartyIdentification135>,
4299	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
4300	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent1>>,
4301	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForNxtAgt", skip_serializing_if = "Option::is_none") )]
4302	pub instr_for_nxt_agt: Option<Vec<InstructionForNextAgent1>>,
4303	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
4304	pub tax: Option<TaxInformation8>,
4305	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
4306	pub rmt_inf: Option<RemittanceInformation16>,
4307	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none") )]
4308	pub instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
4309}
4310
4311impl CreditTransferTransaction37 {
4312	pub fn validate(&self) -> Result<(), ValidationError> {
4313		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
4314		if let Some(ref val) = self.initg_pty { val.validate()? }
4315		self.dbtr.validate()?;
4316		if let Some(ref val) = self.dbtr_acct { val.validate()? }
4317		self.dbtr_agt.validate()?;
4318		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
4319		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
4320		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
4321		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
4322		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
4323		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
4324		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
4325		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
4326		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
4327		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
4328		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
4329		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
4330		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
4331		self.cdtr_agt.validate()?;
4332		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
4333		self.cdtr.validate()?;
4334		if let Some(ref val) = self.cdtr_acct { val.validate()? }
4335		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
4336		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
4337		if let Some(ref vec) = self.instr_for_nxt_agt { for item in vec { item.validate()? } }
4338		if let Some(ref val) = self.tax { val.validate()? }
4339		if let Some(ref val) = self.rmt_inf { val.validate()? }
4340		if let Some(ref val) = self.instd_amt { val.validate()? }
4341		Ok(())
4342	}
4343}
4344
4345
4346// CreditTransferTransaction39 ...
4347#[cfg_attr(feature = "derive_debug", derive(Debug))]
4348#[cfg_attr(feature = "derive_default", derive(Default))]
4349#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4350#[cfg_attr(feature = "derive_clone", derive(Clone))]
4351#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4352pub struct CreditTransferTransaction39 {
4353	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtId") )]
4354	pub pmt_id: PaymentIdentification7,
4355	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
4356	pub pmt_tp_inf: Option<PaymentTypeInformation28>,
4357	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt") )]
4358	pub intr_bk_sttlm_amt: ActiveCurrencyAndAmount,
4359	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
4360	pub intr_bk_sttlm_dt: Option<String>,
4361	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmPrty", skip_serializing_if = "Option::is_none") )]
4362	pub sttlm_prty: Option<Priority3Code>,
4363	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmTmIndctn", skip_serializing_if = "Option::is_none") )]
4364	pub sttlm_tm_indctn: Option<SettlementDateTimeIndication1>,
4365	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmTmReq", skip_serializing_if = "Option::is_none") )]
4366	pub sttlm_tm_req: Option<SettlementTimeRequest2>,
4367	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptncDtTm", skip_serializing_if = "Option::is_none") )]
4368	pub accptnc_dt_tm: Option<String>,
4369	#[cfg_attr( feature = "derive_serde", serde(rename = "PoolgAdjstmntDt", skip_serializing_if = "Option::is_none") )]
4370	pub poolg_adjstmnt_dt: Option<String>,
4371	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none") )]
4372	pub instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
4373	#[cfg_attr( feature = "derive_serde", serde(rename = "XchgRate", skip_serializing_if = "Option::is_none") )]
4374	pub xchg_rate: Option<f64>,
4375	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgBr") )]
4376	pub chrg_br: ChargeBearerType1Code,
4377	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgsInf", skip_serializing_if = "Option::is_none") )]
4378	pub chrgs_inf: Option<Vec<Charges7>>,
4379	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
4380	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4381	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
4382	pub prvs_instg_agt1_acct: Option<CashAccount38>,
4383	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
4384	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4385	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
4386	pub prvs_instg_agt2_acct: Option<CashAccount38>,
4387	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
4388	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4389	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
4390	pub prvs_instg_agt3_acct: Option<CashAccount38>,
4391	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
4392	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4393	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
4394	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
4395	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
4396	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4397	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
4398	pub intrmy_agt1_acct: Option<CashAccount38>,
4399	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
4400	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4401	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
4402	pub intrmy_agt2_acct: Option<CashAccount38>,
4403	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
4404	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4405	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
4406	pub intrmy_agt3_acct: Option<CashAccount38>,
4407	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
4408	pub ultmt_dbtr: Option<PartyIdentification135>,
4409	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty", skip_serializing_if = "Option::is_none") )]
4410	pub initg_pty: Option<PartyIdentification135>,
4411	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
4412	pub dbtr: PartyIdentification135,
4413	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
4414	pub dbtr_acct: Option<CashAccount38>,
4415	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt") )]
4416	pub dbtr_agt: BranchAndFinancialInstitutionIdentification6,
4417	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4418	pub dbtr_agt_acct: Option<CashAccount38>,
4419	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
4420	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
4421	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4422	pub cdtr_agt_acct: Option<CashAccount38>,
4423	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
4424	pub cdtr: PartyIdentification135,
4425	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
4426	pub cdtr_acct: Option<CashAccount38>,
4427	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
4428	pub ultmt_cdtr: Option<PartyIdentification135>,
4429	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
4430	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent1>>,
4431	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForNxtAgt", skip_serializing_if = "Option::is_none") )]
4432	pub instr_for_nxt_agt: Option<Vec<InstructionForNextAgent1>>,
4433	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
4434	pub purp: Option<Purpose2Choice>,
4435	#[cfg_attr( feature = "derive_serde", serde(rename = "RgltryRptg", skip_serializing_if = "Option::is_none") )]
4436	pub rgltry_rptg: Option<Vec<RegulatoryReporting3>>,
4437	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
4438	pub tax: Option<TaxInformation8>,
4439	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdRmtInf", skip_serializing_if = "Option::is_none") )]
4440	pub rltd_rmt_inf: Option<Vec<RemittanceLocation7>>,
4441	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
4442	pub rmt_inf: Option<RemittanceInformation16>,
4443	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
4444	pub splmtry_data: Option<Vec<SupplementaryData1>>,
4445}
4446
4447impl CreditTransferTransaction39 {
4448	pub fn validate(&self) -> Result<(), ValidationError> {
4449		self.pmt_id.validate()?;
4450		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
4451		self.intr_bk_sttlm_amt.validate()?;
4452		if let Some(ref val) = self.sttlm_prty { val.validate()? }
4453		if let Some(ref val) = self.sttlm_tm_indctn { val.validate()? }
4454		if let Some(ref val) = self.sttlm_tm_req { val.validate()? }
4455		if let Some(ref val) = self.instd_amt { val.validate()? }
4456		self.chrg_br.validate()?;
4457		if let Some(ref vec) = self.chrgs_inf { for item in vec { item.validate()? } }
4458		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
4459		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
4460		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
4461		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
4462		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
4463		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
4464		if let Some(ref val) = self.instg_agt { val.validate()? }
4465		if let Some(ref val) = self.instd_agt { val.validate()? }
4466		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
4467		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
4468		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
4469		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
4470		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
4471		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
4472		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
4473		if let Some(ref val) = self.initg_pty { val.validate()? }
4474		self.dbtr.validate()?;
4475		if let Some(ref val) = self.dbtr_acct { val.validate()? }
4476		self.dbtr_agt.validate()?;
4477		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
4478		self.cdtr_agt.validate()?;
4479		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
4480		self.cdtr.validate()?;
4481		if let Some(ref val) = self.cdtr_acct { val.validate()? }
4482		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
4483		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
4484		if let Some(ref vec) = self.instr_for_nxt_agt { for item in vec { item.validate()? } }
4485		if let Some(ref val) = self.purp { val.validate()? }
4486		if let Some(ref vec) = self.rgltry_rptg { for item in vec { item.validate()? } }
4487		if let Some(ref val) = self.tax { val.validate()? }
4488		if let Some(ref vec) = self.rltd_rmt_inf { for item in vec { item.validate()? } }
4489		if let Some(ref val) = self.rmt_inf { val.validate()? }
4490		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
4491		Ok(())
4492	}
4493}
4494
4495
4496// CreditTransferTransaction45 ...
4497#[cfg_attr(feature = "derive_debug", derive(Debug))]
4498#[cfg_attr(feature = "derive_default", derive(Default))]
4499#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4500#[cfg_attr(feature = "derive_clone", derive(Clone))]
4501#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4502pub struct CreditTransferTransaction45 {
4503	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
4504	pub ultmt_dbtr: Option<PartyIdentification135>,
4505	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty", skip_serializing_if = "Option::is_none") )]
4506	pub initg_pty: Option<PartyIdentification135>,
4507	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
4508	pub dbtr: PartyIdentification135,
4509	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
4510	pub dbtr_acct: Option<CashAccount38>,
4511	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt") )]
4512	pub dbtr_agt: BranchAndFinancialInstitutionIdentification6,
4513	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4514	pub dbtr_agt_acct: Option<CashAccount38>,
4515	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
4516	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4517	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
4518	pub prvs_instg_agt1_acct: Option<CashAccount38>,
4519	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
4520	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4521	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
4522	pub prvs_instg_agt2_acct: Option<CashAccount38>,
4523	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
4524	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4525	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
4526	pub prvs_instg_agt3_acct: Option<CashAccount38>,
4527	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
4528	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
4529	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
4530	pub intrmy_agt1_acct: Option<CashAccount38>,
4531	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
4532	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
4533	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
4534	pub intrmy_agt2_acct: Option<CashAccount38>,
4535	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
4536	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
4537	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
4538	pub intrmy_agt3_acct: Option<CashAccount38>,
4539	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
4540	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
4541	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
4542	pub cdtr_agt_acct: Option<CashAccount38>,
4543	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
4544	pub cdtr: PartyIdentification135,
4545	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
4546	pub cdtr_acct: Option<CashAccount38>,
4547	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
4548	pub ultmt_cdtr: Option<PartyIdentification135>,
4549	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
4550	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent3>>,
4551	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForNxtAgt", skip_serializing_if = "Option::is_none") )]
4552	pub instr_for_nxt_agt: Option<Vec<InstructionForNextAgent1>>,
4553	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
4554	pub tax: Option<TaxInformation8>,
4555	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
4556	pub rmt_inf: Option<RemittanceInformation16>,
4557	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAmt", skip_serializing_if = "Option::is_none") )]
4558	pub instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
4559}
4560
4561impl CreditTransferTransaction45 {
4562	pub fn validate(&self) -> Result<(), ValidationError> {
4563		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
4564		if let Some(ref val) = self.initg_pty { val.validate()? }
4565		self.dbtr.validate()?;
4566		if let Some(ref val) = self.dbtr_acct { val.validate()? }
4567		self.dbtr_agt.validate()?;
4568		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
4569		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
4570		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
4571		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
4572		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
4573		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
4574		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
4575		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
4576		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
4577		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
4578		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
4579		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
4580		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
4581		self.cdtr_agt.validate()?;
4582		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
4583		self.cdtr.validate()?;
4584		if let Some(ref val) = self.cdtr_acct { val.validate()? }
4585		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
4586		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
4587		if let Some(ref vec) = self.instr_for_nxt_agt { for item in vec { item.validate()? } }
4588		if let Some(ref val) = self.tax { val.validate()? }
4589		if let Some(ref val) = self.rmt_inf { val.validate()? }
4590		if let Some(ref val) = self.instd_amt { val.validate()? }
4591		Ok(())
4592	}
4593}
4594
4595
4596// CreditorReferenceInformation2 ...
4597#[cfg_attr(feature = "derive_debug", derive(Debug))]
4598#[cfg_attr(feature = "derive_default", derive(Default))]
4599#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4600#[cfg_attr(feature = "derive_clone", derive(Clone))]
4601#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4602pub struct CreditorReferenceInformation2 {
4603	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
4604	pub tp: Option<CreditorReferenceType2>,
4605	#[cfg_attr( feature = "derive_serde", serde(rename = "Ref", skip_serializing_if = "Option::is_none") )]
4606	pub ref_attr: Option<String>,
4607}
4608
4609impl CreditorReferenceInformation2 {
4610	pub fn validate(&self) -> Result<(), ValidationError> {
4611		if let Some(ref val) = self.tp { val.validate()? }
4612		if let Some(ref val) = self.ref_attr {
4613			if val.chars().count() < 1 {
4614				return Err(ValidationError::new(1001, "ref_attr is shorter than the minimum length of 1".to_string()));
4615			}
4616			if val.chars().count() > 35 {
4617				return Err(ValidationError::new(1002, "ref_attr exceeds the maximum length of 35".to_string()));
4618			}
4619		}
4620		Ok(())
4621	}
4622}
4623
4624
4625// CreditorReferenceType1Choice ...
4626#[cfg_attr(feature = "derive_debug", derive(Debug))]
4627#[cfg_attr(feature = "derive_default", derive(Default))]
4628#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4629#[cfg_attr(feature = "derive_clone", derive(Clone))]
4630#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4631pub struct CreditorReferenceType1Choice {
4632	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
4633	pub cd: Option<DocumentType3Code>,
4634	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
4635	pub prtry: Option<String>,
4636}
4637
4638impl CreditorReferenceType1Choice {
4639	pub fn validate(&self) -> Result<(), ValidationError> {
4640		if let Some(ref val) = self.cd { val.validate()? }
4641		if let Some(ref val) = self.prtry {
4642			if val.chars().count() < 1 {
4643				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
4644			}
4645			if val.chars().count() > 35 {
4646				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
4647			}
4648		}
4649		Ok(())
4650	}
4651}
4652
4653
4654// CreditorReferenceType2 ...
4655#[cfg_attr(feature = "derive_debug", derive(Debug))]
4656#[cfg_attr(feature = "derive_default", derive(Default))]
4657#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4658#[cfg_attr(feature = "derive_clone", derive(Clone))]
4659#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4660pub struct CreditorReferenceType2 {
4661	#[cfg_attr( feature = "derive_serde", serde(rename = "CdOrPrtry") )]
4662	pub cd_or_prtry: CreditorReferenceType1Choice,
4663	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
4664	pub issr: Option<String>,
4665}
4666
4667impl CreditorReferenceType2 {
4668	pub fn validate(&self) -> Result<(), ValidationError> {
4669		self.cd_or_prtry.validate()?;
4670		if let Some(ref val) = self.issr {
4671			if val.chars().count() < 1 {
4672				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
4673			}
4674			if val.chars().count() > 35 {
4675				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
4676			}
4677		}
4678		Ok(())
4679	}
4680}
4681
4682
4683// CurrencyExchange5 ...
4684#[cfg_attr(feature = "derive_debug", derive(Debug))]
4685#[cfg_attr(feature = "derive_default", derive(Default))]
4686#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4687#[cfg_attr(feature = "derive_clone", derive(Clone))]
4688#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4689pub struct CurrencyExchange5 {
4690	#[cfg_attr( feature = "derive_serde", serde(rename = "SrcCcy") )]
4691	pub src_ccy: String,
4692	#[cfg_attr( feature = "derive_serde", serde(rename = "TrgtCcy", skip_serializing_if = "Option::is_none") )]
4693	pub trgt_ccy: Option<String>,
4694	#[cfg_attr( feature = "derive_serde", serde(rename = "UnitCcy", skip_serializing_if = "Option::is_none") )]
4695	pub unit_ccy: Option<String>,
4696	#[cfg_attr( feature = "derive_serde", serde(rename = "XchgRate") )]
4697	pub xchg_rate: f64,
4698	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrctId", skip_serializing_if = "Option::is_none") )]
4699	pub ctrct_id: Option<String>,
4700	#[cfg_attr( feature = "derive_serde", serde(rename = "QtnDt", skip_serializing_if = "Option::is_none") )]
4701	pub qtn_dt: Option<String>,
4702}
4703
4704impl CurrencyExchange5 {
4705	pub fn validate(&self) -> Result<(), ValidationError> {
4706		let pattern = Regex::new("[A-Z]{3,3}").unwrap();
4707		if !pattern.is_match(&self.src_ccy) {
4708			return Err(ValidationError::new(1005, "src_ccy does not match the required pattern".to_string()));
4709		}
4710		if let Some(ref val) = self.trgt_ccy {
4711			let pattern = Regex::new("[A-Z]{3,3}").unwrap();
4712			if !pattern.is_match(val) {
4713				return Err(ValidationError::new(1005, "trgt_ccy does not match the required pattern".to_string()));
4714			}
4715		}
4716		if let Some(ref val) = self.unit_ccy {
4717			let pattern = Regex::new("[A-Z]{3,3}").unwrap();
4718			if !pattern.is_match(val) {
4719				return Err(ValidationError::new(1005, "unit_ccy does not match the required pattern".to_string()));
4720			}
4721		}
4722		if let Some(ref val) = self.ctrct_id {
4723			if val.chars().count() < 1 {
4724				return Err(ValidationError::new(1001, "ctrct_id is shorter than the minimum length of 1".to_string()));
4725			}
4726			if val.chars().count() > 35 {
4727				return Err(ValidationError::new(1002, "ctrct_id exceeds the maximum length of 35".to_string()));
4728			}
4729		}
4730		Ok(())
4731	}
4732}
4733
4734
4735// DateAndDateTime2Choice ...
4736#[cfg_attr(feature = "derive_debug", derive(Debug))]
4737#[cfg_attr(feature = "derive_default", derive(Default))]
4738#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4739#[cfg_attr(feature = "derive_clone", derive(Clone))]
4740#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4741pub struct DateAndDateTime2Choice {
4742	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
4743	pub dt: Option<String>,
4744	#[cfg_attr( feature = "derive_serde", serde(rename = "DtTm", skip_serializing_if = "Option::is_none") )]
4745	pub dt_tm: Option<String>,
4746}
4747
4748impl DateAndDateTime2Choice {
4749	pub fn validate(&self) -> Result<(), ValidationError> {
4750		Ok(())
4751	}
4752}
4753
4754
4755// DateAndPlaceOfBirth1 ...
4756#[cfg_attr(feature = "derive_debug", derive(Debug))]
4757#[cfg_attr(feature = "derive_default", derive(Default))]
4758#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4759#[cfg_attr(feature = "derive_clone", derive(Clone))]
4760#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4761pub struct DateAndPlaceOfBirth1 {
4762	#[cfg_attr( feature = "derive_serde", serde(rename = "BirthDt") )]
4763	pub birth_dt: String,
4764	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvcOfBirth", skip_serializing_if = "Option::is_none") )]
4765	pub prvc_of_birth: Option<String>,
4766	#[cfg_attr( feature = "derive_serde", serde(rename = "CityOfBirth") )]
4767	pub city_of_birth: String,
4768	#[cfg_attr( feature = "derive_serde", serde(rename = "CtryOfBirth") )]
4769	pub ctry_of_birth: String,
4770}
4771
4772impl DateAndPlaceOfBirth1 {
4773	pub fn validate(&self) -> Result<(), ValidationError> {
4774		if let Some(ref val) = self.prvc_of_birth {
4775			if val.chars().count() < 1 {
4776				return Err(ValidationError::new(1001, "prvc_of_birth is shorter than the minimum length of 1".to_string()));
4777			}
4778			if val.chars().count() > 35 {
4779				return Err(ValidationError::new(1002, "prvc_of_birth exceeds the maximum length of 35".to_string()));
4780			}
4781		}
4782		if self.city_of_birth.chars().count() < 1 {
4783			return Err(ValidationError::new(1001, "city_of_birth is shorter than the minimum length of 1".to_string()));
4784		}
4785		if self.city_of_birth.chars().count() > 35 {
4786			return Err(ValidationError::new(1002, "city_of_birth exceeds the maximum length of 35".to_string()));
4787		}
4788		let pattern = Regex::new("[A-Z]{2,2}").unwrap();
4789		if !pattern.is_match(&self.ctry_of_birth) {
4790			return Err(ValidationError::new(1005, "ctry_of_birth does not match the required pattern".to_string()));
4791		}
4792		Ok(())
4793	}
4794}
4795
4796
4797// DateOrDateTimePeriod1Choice ...
4798#[cfg_attr(feature = "derive_debug", derive(Debug))]
4799#[cfg_attr(feature = "derive_default", derive(Default))]
4800#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4801#[cfg_attr(feature = "derive_clone", derive(Clone))]
4802#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4803pub struct DateOrDateTimePeriod1Choice {
4804	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
4805	pub dt: Option<DatePeriod2>,
4806	#[cfg_attr( feature = "derive_serde", serde(rename = "DtTm", skip_serializing_if = "Option::is_none") )]
4807	pub dt_tm: Option<DateTimePeriod1>,
4808}
4809
4810impl DateOrDateTimePeriod1Choice {
4811	pub fn validate(&self) -> Result<(), ValidationError> {
4812		if let Some(ref val) = self.dt { val.validate()? }
4813		if let Some(ref val) = self.dt_tm { val.validate()? }
4814		Ok(())
4815	}
4816}
4817
4818
4819// DatePeriod2 ...
4820#[cfg_attr(feature = "derive_debug", derive(Debug))]
4821#[cfg_attr(feature = "derive_default", derive(Default))]
4822#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4823#[cfg_attr(feature = "derive_clone", derive(Clone))]
4824#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4825pub struct DatePeriod2 {
4826	#[cfg_attr( feature = "derive_serde", serde(rename = "FrDt") )]
4827	pub fr_dt: String,
4828	#[cfg_attr( feature = "derive_serde", serde(rename = "ToDt") )]
4829	pub to_dt: String,
4830}
4831
4832impl DatePeriod2 {
4833	pub fn validate(&self) -> Result<(), ValidationError> {
4834		Ok(())
4835	}
4836}
4837
4838
4839// DatePeriodDetails1 ...
4840#[cfg_attr(feature = "derive_debug", derive(Debug))]
4841#[cfg_attr(feature = "derive_default", derive(Default))]
4842#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4843#[cfg_attr(feature = "derive_clone", derive(Clone))]
4844#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4845pub struct DatePeriodDetails1 {
4846	#[cfg_attr( feature = "derive_serde", serde(rename = "FrDt") )]
4847	pub fr_dt: String,
4848	#[cfg_attr( feature = "derive_serde", serde(rename = "ToDt", skip_serializing_if = "Option::is_none") )]
4849	pub to_dt: Option<String>,
4850}
4851
4852impl DatePeriodDetails1 {
4853	pub fn validate(&self) -> Result<(), ValidationError> {
4854		Ok(())
4855	}
4856}
4857
4858
4859// DateTimePeriod1 ...
4860#[cfg_attr(feature = "derive_debug", derive(Debug))]
4861#[cfg_attr(feature = "derive_default", derive(Default))]
4862#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4863#[cfg_attr(feature = "derive_clone", derive(Clone))]
4864#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4865pub struct DateTimePeriod1 {
4866	#[cfg_attr( feature = "derive_serde", serde(rename = "FrDtTm") )]
4867	pub fr_dt_tm: String,
4868	#[cfg_attr( feature = "derive_serde", serde(rename = "ToDtTm") )]
4869	pub to_dt_tm: String,
4870}
4871
4872impl DateTimePeriod1 {
4873	pub fn validate(&self) -> Result<(), ValidationError> {
4874		Ok(())
4875	}
4876}
4877
4878
4879// DiscountAmountAndType1 ...
4880#[cfg_attr(feature = "derive_debug", derive(Debug))]
4881#[cfg_attr(feature = "derive_default", derive(Default))]
4882#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4883#[cfg_attr(feature = "derive_clone", derive(Clone))]
4884#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4885pub struct DiscountAmountAndType1 {
4886	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
4887	pub tp: Option<DiscountAmountType1Choice>,
4888	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
4889	pub amt: ActiveOrHistoricCurrencyAndAmount,
4890}
4891
4892impl DiscountAmountAndType1 {
4893	pub fn validate(&self) -> Result<(), ValidationError> {
4894		if let Some(ref val) = self.tp { val.validate()? }
4895		self.amt.validate()?;
4896		Ok(())
4897	}
4898}
4899
4900
4901// DiscountAmountType1Choice ...
4902#[cfg_attr(feature = "derive_debug", derive(Debug))]
4903#[cfg_attr(feature = "derive_default", derive(Default))]
4904#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4905#[cfg_attr(feature = "derive_clone", derive(Clone))]
4906#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4907pub struct DiscountAmountType1Choice {
4908	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
4909	pub cd: Option<String>,
4910	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
4911	pub prtry: Option<String>,
4912}
4913
4914impl DiscountAmountType1Choice {
4915	pub fn validate(&self) -> Result<(), ValidationError> {
4916		if let Some(ref val) = self.cd {
4917			if val.chars().count() < 1 {
4918				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
4919			}
4920			if val.chars().count() > 4 {
4921				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
4922			}
4923		}
4924		if let Some(ref val) = self.prtry {
4925			if val.chars().count() < 1 {
4926				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
4927			}
4928			if val.chars().count() > 35 {
4929				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
4930			}
4931		}
4932		Ok(())
4933	}
4934}
4935
4936
4937// DisplayCapabilities1 ...
4938#[cfg_attr(feature = "derive_debug", derive(Debug))]
4939#[cfg_attr(feature = "derive_default", derive(Default))]
4940#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4941#[cfg_attr(feature = "derive_clone", derive(Clone))]
4942#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4943pub struct DisplayCapabilities1 {
4944	#[cfg_attr( feature = "derive_serde", serde(rename = "DispTp") )]
4945	pub disp_tp: UserInterface2Code,
4946	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfLines") )]
4947	pub nb_of_lines: String,
4948	#[cfg_attr( feature = "derive_serde", serde(rename = "LineWidth") )]
4949	pub line_width: String,
4950}
4951
4952impl DisplayCapabilities1 {
4953	pub fn validate(&self) -> Result<(), ValidationError> {
4954		self.disp_tp.validate()?;
4955		let pattern = Regex::new("[0-9]{1,3}").unwrap();
4956		if !pattern.is_match(&self.nb_of_lines) {
4957			return Err(ValidationError::new(1005, "nb_of_lines does not match the required pattern".to_string()));
4958		}
4959		let pattern = Regex::new("[0-9]{1,3}").unwrap();
4960		if !pattern.is_match(&self.line_width) {
4961			return Err(ValidationError::new(1005, "line_width does not match the required pattern".to_string()));
4962		}
4963		Ok(())
4964	}
4965}
4966
4967
4968// Document12 ...
4969#[cfg_attr(feature = "derive_debug", derive(Debug))]
4970#[cfg_attr(feature = "derive_default", derive(Default))]
4971#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
4972#[cfg_attr(feature = "derive_clone", derive(Clone))]
4973#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
4974pub struct Document12 {
4975	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
4976	pub tp: DocumentType1Choice,
4977	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
4978	pub id: String,
4979	#[cfg_attr( feature = "derive_serde", serde(rename = "IsseDt") )]
4980	pub isse_dt: DateAndDateTime2Choice,
4981	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
4982	pub nm: Option<String>,
4983	#[cfg_attr( feature = "derive_serde", serde(rename = "LangCd", skip_serializing_if = "Option::is_none") )]
4984	pub lang_cd: Option<String>,
4985	#[cfg_attr( feature = "derive_serde", serde(rename = "Frmt") )]
4986	pub frmt: DocumentFormat1Choice,
4987	#[cfg_attr( feature = "derive_serde", serde(rename = "FileNm", skip_serializing_if = "Option::is_none") )]
4988	pub file_nm: Option<String>,
4989	#[cfg_attr( feature = "derive_serde", serde(rename = "DgtlSgntr", skip_serializing_if = "Option::is_none") )]
4990	pub dgtl_sgntr: Option<PartyAndSignature3>,
4991	#[cfg_attr( feature = "derive_serde", serde(rename = "Nclsr") )]
4992	pub nclsr: String,
4993}
4994
4995impl Document12 {
4996	pub fn validate(&self) -> Result<(), ValidationError> {
4997		self.tp.validate()?;
4998		if self.id.chars().count() < 1 {
4999			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
5000		}
5001		if self.id.chars().count() > 35 {
5002			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
5003		}
5004		self.isse_dt.validate()?;
5005		if let Some(ref val) = self.nm {
5006			if val.chars().count() < 1 {
5007				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
5008			}
5009			if val.chars().count() > 140 {
5010				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
5011			}
5012		}
5013		self.frmt.validate()?;
5014		if let Some(ref val) = self.file_nm {
5015			if val.chars().count() < 1 {
5016				return Err(ValidationError::new(1001, "file_nm is shorter than the minimum length of 1".to_string()));
5017			}
5018			if val.chars().count() > 140 {
5019				return Err(ValidationError::new(1002, "file_nm exceeds the maximum length of 140".to_string()));
5020			}
5021		}
5022		if let Some(ref val) = self.dgtl_sgntr { val.validate()? }
5023		if self.nclsr.chars().count() < 1 {
5024			return Err(ValidationError::new(1001, "nclsr is shorter than the minimum length of 1".to_string()));
5025		}
5026		if self.nclsr.chars().count() > 10485760 {
5027			return Err(ValidationError::new(1002, "nclsr exceeds the maximum length of 10485760".to_string()));
5028		}
5029		Ok(())
5030	}
5031}
5032
5033
5034// DocumentAdjustment1 ...
5035#[cfg_attr(feature = "derive_debug", derive(Debug))]
5036#[cfg_attr(feature = "derive_default", derive(Default))]
5037#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5038#[cfg_attr(feature = "derive_clone", derive(Clone))]
5039#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5040pub struct DocumentAdjustment1 {
5041	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
5042	pub amt: ActiveOrHistoricCurrencyAndAmount,
5043	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none") )]
5044	pub cdt_dbt_ind: Option<CreditDebitCode>,
5045	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
5046	pub rsn: Option<String>,
5047	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
5048	pub addtl_inf: Option<String>,
5049}
5050
5051impl DocumentAdjustment1 {
5052	pub fn validate(&self) -> Result<(), ValidationError> {
5053		self.amt.validate()?;
5054		if let Some(ref val) = self.cdt_dbt_ind { val.validate()? }
5055		if let Some(ref val) = self.rsn {
5056			if val.chars().count() < 1 {
5057				return Err(ValidationError::new(1001, "rsn is shorter than the minimum length of 1".to_string()));
5058			}
5059			if val.chars().count() > 4 {
5060				return Err(ValidationError::new(1002, "rsn exceeds the maximum length of 4".to_string()));
5061			}
5062		}
5063		if let Some(ref val) = self.addtl_inf {
5064			if val.chars().count() < 1 {
5065				return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
5066			}
5067			if val.chars().count() > 140 {
5068				return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 140".to_string()));
5069			}
5070		}
5071		Ok(())
5072	}
5073}
5074
5075
5076// DocumentFormat1Choice ...
5077#[cfg_attr(feature = "derive_debug", derive(Debug))]
5078#[cfg_attr(feature = "derive_default", derive(Default))]
5079#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5080#[cfg_attr(feature = "derive_clone", derive(Clone))]
5081#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5082pub struct DocumentFormat1Choice {
5083	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5084	pub cd: Option<String>,
5085	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5086	pub prtry: Option<GenericIdentification1>,
5087}
5088
5089impl DocumentFormat1Choice {
5090	pub fn validate(&self) -> Result<(), ValidationError> {
5091		if let Some(ref val) = self.cd {
5092			if val.chars().count() < 1 {
5093				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5094			}
5095			if val.chars().count() > 4 {
5096				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5097			}
5098		}
5099		if let Some(ref val) = self.prtry { val.validate()? }
5100		Ok(())
5101	}
5102}
5103
5104
5105// DocumentLineIdentification1 ...
5106#[cfg_attr(feature = "derive_debug", derive(Debug))]
5107#[cfg_attr(feature = "derive_default", derive(Default))]
5108#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5109#[cfg_attr(feature = "derive_clone", derive(Clone))]
5110#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5111pub struct DocumentLineIdentification1 {
5112	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
5113	pub tp: Option<DocumentLineType1>,
5114	#[cfg_attr( feature = "derive_serde", serde(rename = "Nb", skip_serializing_if = "Option::is_none") )]
5115	pub nb: Option<String>,
5116	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdDt", skip_serializing_if = "Option::is_none") )]
5117	pub rltd_dt: Option<String>,
5118}
5119
5120impl DocumentLineIdentification1 {
5121	pub fn validate(&self) -> Result<(), ValidationError> {
5122		if let Some(ref val) = self.tp { val.validate()? }
5123		if let Some(ref val) = self.nb {
5124			if val.chars().count() < 1 {
5125				return Err(ValidationError::new(1001, "nb is shorter than the minimum length of 1".to_string()));
5126			}
5127			if val.chars().count() > 35 {
5128				return Err(ValidationError::new(1002, "nb exceeds the maximum length of 35".to_string()));
5129			}
5130		}
5131		Ok(())
5132	}
5133}
5134
5135
5136// DocumentLineInformation1 ...
5137#[cfg_attr(feature = "derive_debug", derive(Debug))]
5138#[cfg_attr(feature = "derive_default", derive(Default))]
5139#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5140#[cfg_attr(feature = "derive_clone", derive(Clone))]
5141#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5142pub struct DocumentLineInformation1 {
5143	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
5144	pub id: Vec<DocumentLineIdentification1>,
5145	#[cfg_attr( feature = "derive_serde", serde(rename = "Desc", skip_serializing_if = "Option::is_none") )]
5146	pub desc: Option<String>,
5147	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
5148	pub amt: Option<RemittanceAmount3>,
5149}
5150
5151impl DocumentLineInformation1 {
5152	pub fn validate(&self) -> Result<(), ValidationError> {
5153		for item in &self.id { item.validate()? }
5154		if let Some(ref val) = self.desc {
5155			if val.chars().count() < 1 {
5156				return Err(ValidationError::new(1001, "desc is shorter than the minimum length of 1".to_string()));
5157			}
5158			if val.chars().count() > 2048 {
5159				return Err(ValidationError::new(1002, "desc exceeds the maximum length of 2048".to_string()));
5160			}
5161		}
5162		if let Some(ref val) = self.amt { val.validate()? }
5163		Ok(())
5164	}
5165}
5166
5167
5168// DocumentLineType1 ...
5169#[cfg_attr(feature = "derive_debug", derive(Debug))]
5170#[cfg_attr(feature = "derive_default", derive(Default))]
5171#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5172#[cfg_attr(feature = "derive_clone", derive(Clone))]
5173#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5174pub struct DocumentLineType1 {
5175	#[cfg_attr( feature = "derive_serde", serde(rename = "CdOrPrtry") )]
5176	pub cd_or_prtry: DocumentLineType1Choice,
5177	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
5178	pub issr: Option<String>,
5179}
5180
5181impl DocumentLineType1 {
5182	pub fn validate(&self) -> Result<(), ValidationError> {
5183		self.cd_or_prtry.validate()?;
5184		if let Some(ref val) = self.issr {
5185			if val.chars().count() < 1 {
5186				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
5187			}
5188			if val.chars().count() > 35 {
5189				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
5190			}
5191		}
5192		Ok(())
5193	}
5194}
5195
5196
5197// DocumentLineType1Choice ...
5198#[cfg_attr(feature = "derive_debug", derive(Debug))]
5199#[cfg_attr(feature = "derive_default", derive(Default))]
5200#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5201#[cfg_attr(feature = "derive_clone", derive(Clone))]
5202#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5203pub struct DocumentLineType1Choice {
5204	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5205	pub cd: Option<String>,
5206	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5207	pub prtry: Option<String>,
5208}
5209
5210impl DocumentLineType1Choice {
5211	pub fn validate(&self) -> Result<(), ValidationError> {
5212		if let Some(ref val) = self.cd {
5213			if val.chars().count() < 1 {
5214				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5215			}
5216			if val.chars().count() > 4 {
5217				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5218			}
5219		}
5220		if let Some(ref val) = self.prtry {
5221			if val.chars().count() < 1 {
5222				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
5223			}
5224			if val.chars().count() > 35 {
5225				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
5226			}
5227		}
5228		Ok(())
5229	}
5230}
5231
5232
5233// DocumentType1Choice ...
5234#[cfg_attr(feature = "derive_debug", derive(Debug))]
5235#[cfg_attr(feature = "derive_default", derive(Default))]
5236#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5237#[cfg_attr(feature = "derive_clone", derive(Clone))]
5238#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5239pub struct DocumentType1Choice {
5240	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5241	pub cd: Option<String>,
5242	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5243	pub prtry: Option<GenericIdentification1>,
5244}
5245
5246impl DocumentType1Choice {
5247	pub fn validate(&self) -> Result<(), ValidationError> {
5248		if let Some(ref val) = self.cd {
5249			if val.chars().count() < 1 {
5250				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5251			}
5252			if val.chars().count() > 4 {
5253				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5254			}
5255		}
5256		if let Some(ref val) = self.prtry { val.validate()? }
5257		Ok(())
5258	}
5259}
5260
5261
5262// DocumentType3Code ...
5263#[cfg_attr(feature = "derive_debug", derive(Debug))]
5264#[cfg_attr(feature = "derive_default", derive(Default))]
5265#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5266#[cfg_attr(feature = "derive_clone", derive(Clone))]
5267#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5268pub enum DocumentType3Code {
5269	#[cfg_attr(feature = "derive_default", default)]
5270	#[cfg_attr( feature = "derive_serde", serde(rename = "RADM") )]
5271	CodeRADM,
5272	#[cfg_attr( feature = "derive_serde", serde(rename = "RPIN") )]
5273	CodeRPIN,
5274	#[cfg_attr( feature = "derive_serde", serde(rename = "FXDR") )]
5275	CodeFXDR,
5276	#[cfg_attr( feature = "derive_serde", serde(rename = "DISP") )]
5277	CodeDISP,
5278	#[cfg_attr( feature = "derive_serde", serde(rename = "PUOR") )]
5279	CodePUOR,
5280	#[cfg_attr( feature = "derive_serde", serde(rename = "SCOR") )]
5281	CodeSCOR,
5282}
5283
5284impl DocumentType3Code {
5285	pub fn validate(&self) -> Result<(), ValidationError> {
5286		Ok(())
5287	}
5288}
5289
5290
5291// DocumentType6Code ...
5292#[cfg_attr(feature = "derive_debug", derive(Debug))]
5293#[cfg_attr(feature = "derive_default", derive(Default))]
5294#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5295#[cfg_attr(feature = "derive_clone", derive(Clone))]
5296#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5297pub enum DocumentType6Code {
5298	#[cfg_attr(feature = "derive_default", default)]
5299	#[cfg_attr( feature = "derive_serde", serde(rename = "MSIN") )]
5300	CodeMSIN,
5301	#[cfg_attr( feature = "derive_serde", serde(rename = "CNFA") )]
5302	CodeCNFA,
5303	#[cfg_attr( feature = "derive_serde", serde(rename = "DNFA") )]
5304	CodeDNFA,
5305	#[cfg_attr( feature = "derive_serde", serde(rename = "CINV") )]
5306	CodeCINV,
5307	#[cfg_attr( feature = "derive_serde", serde(rename = "CREN") )]
5308	CodeCREN,
5309	#[cfg_attr( feature = "derive_serde", serde(rename = "DEBN") )]
5310	CodeDEBN,
5311	#[cfg_attr( feature = "derive_serde", serde(rename = "HIRI") )]
5312	CodeHIRI,
5313	#[cfg_attr( feature = "derive_serde", serde(rename = "SBIN") )]
5314	CodeSBIN,
5315	#[cfg_attr( feature = "derive_serde", serde(rename = "CMCN") )]
5316	CodeCMCN,
5317	#[cfg_attr( feature = "derive_serde", serde(rename = "SOAC") )]
5318	CodeSOAC,
5319	#[cfg_attr( feature = "derive_serde", serde(rename = "DISP") )]
5320	CodeDISP,
5321	#[cfg_attr( feature = "derive_serde", serde(rename = "BOLD") )]
5322	CodeBOLD,
5323	#[cfg_attr( feature = "derive_serde", serde(rename = "VCHR") )]
5324	CodeVCHR,
5325	#[cfg_attr( feature = "derive_serde", serde(rename = "AROI") )]
5326	CodeAROI,
5327	#[cfg_attr( feature = "derive_serde", serde(rename = "TSUT") )]
5328	CodeTSUT,
5329	#[cfg_attr( feature = "derive_serde", serde(rename = "PUOR") )]
5330	CodePUOR,
5331}
5332
5333impl DocumentType6Code {
5334	pub fn validate(&self) -> Result<(), ValidationError> {
5335		Ok(())
5336	}
5337}
5338
5339
5340// EntryDetails9 ...
5341#[cfg_attr(feature = "derive_debug", derive(Debug))]
5342#[cfg_attr(feature = "derive_default", derive(Default))]
5343#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5344#[cfg_attr(feature = "derive_clone", derive(Clone))]
5345#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5346pub struct EntryDetails9 {
5347	#[cfg_attr( feature = "derive_serde", serde(rename = "Btch", skip_serializing_if = "Option::is_none") )]
5348	pub btch: Option<BatchInformation2>,
5349	#[cfg_attr( feature = "derive_serde", serde(rename = "TxDtls", skip_serializing_if = "Option::is_none") )]
5350	pub tx_dtls: Option<Vec<EntryTransaction10>>,
5351}
5352
5353impl EntryDetails9 {
5354	pub fn validate(&self) -> Result<(), ValidationError> {
5355		if let Some(ref val) = self.btch { val.validate()? }
5356		if let Some(ref vec) = self.tx_dtls { for item in vec { item.validate()? } }
5357		Ok(())
5358	}
5359}
5360
5361
5362// EntryStatus1Choice ...
5363#[cfg_attr(feature = "derive_debug", derive(Debug))]
5364#[cfg_attr(feature = "derive_default", derive(Default))]
5365#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5366#[cfg_attr(feature = "derive_clone", derive(Clone))]
5367#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5368pub struct EntryStatus1Choice {
5369	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5370	pub cd: Option<String>,
5371	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5372	pub prtry: Option<String>,
5373}
5374
5375impl EntryStatus1Choice {
5376	pub fn validate(&self) -> Result<(), ValidationError> {
5377		if let Some(ref val) = self.cd {
5378			if val.chars().count() < 1 {
5379				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5380			}
5381			if val.chars().count() > 4 {
5382				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5383			}
5384		}
5385		if let Some(ref val) = self.prtry {
5386			if val.chars().count() < 1 {
5387				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
5388			}
5389			if val.chars().count() > 35 {
5390				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
5391			}
5392		}
5393		Ok(())
5394	}
5395}
5396
5397
5398// EntryTransaction10 ...
5399#[cfg_attr(feature = "derive_debug", derive(Debug))]
5400#[cfg_attr(feature = "derive_default", derive(Default))]
5401#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5402#[cfg_attr(feature = "derive_clone", derive(Clone))]
5403#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5404pub struct EntryTransaction10 {
5405	#[cfg_attr( feature = "derive_serde", serde(rename = "Refs", skip_serializing_if = "Option::is_none") )]
5406	pub refs: Option<TransactionReferences6>,
5407	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
5408	pub amt: Option<ActiveOrHistoricCurrencyAndAmount>,
5409	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd", skip_serializing_if = "Option::is_none") )]
5410	pub cdt_dbt_ind: Option<CreditDebitCode>,
5411	#[cfg_attr( feature = "derive_serde", serde(rename = "AmtDtls", skip_serializing_if = "Option::is_none") )]
5412	pub amt_dtls: Option<AmountAndCurrencyExchange3>,
5413	#[cfg_attr( feature = "derive_serde", serde(rename = "Avlbty", skip_serializing_if = "Option::is_none") )]
5414	pub avlbty: Option<Vec<CashAvailability1>>,
5415	#[cfg_attr( feature = "derive_serde", serde(rename = "BkTxCd", skip_serializing_if = "Option::is_none") )]
5416	pub bk_tx_cd: Option<BankTransactionCodeStructure4>,
5417	#[cfg_attr( feature = "derive_serde", serde(rename = "Chrgs", skip_serializing_if = "Option::is_none") )]
5418	pub chrgs: Option<Charges6>,
5419	#[cfg_attr( feature = "derive_serde", serde(rename = "Intrst", skip_serializing_if = "Option::is_none") )]
5420	pub intrst: Option<TransactionInterest4>,
5421	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdPties", skip_serializing_if = "Option::is_none") )]
5422	pub rltd_pties: Option<TransactionParties6>,
5423	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdAgts", skip_serializing_if = "Option::is_none") )]
5424	pub rltd_agts: Option<TransactionAgents5>,
5425	#[cfg_attr( feature = "derive_serde", serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none") )]
5426	pub lcl_instrm: Option<LocalInstrument2Choice>,
5427	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
5428	pub purp: Option<Purpose2Choice>,
5429	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdRmtInf", skip_serializing_if = "Option::is_none") )]
5430	pub rltd_rmt_inf: Option<Vec<RemittanceLocation7>>,
5431	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
5432	pub rmt_inf: Option<RemittanceInformation16>,
5433	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdDts", skip_serializing_if = "Option::is_none") )]
5434	pub rltd_dts: Option<TransactionDates3>,
5435	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdPric", skip_serializing_if = "Option::is_none") )]
5436	pub rltd_pric: Option<TransactionPrice4Choice>,
5437	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdQties", skip_serializing_if = "Option::is_none") )]
5438	pub rltd_qties: Option<Vec<TransactionQuantities3Choice>>,
5439	#[cfg_attr( feature = "derive_serde", serde(rename = "FinInstrmId", skip_serializing_if = "Option::is_none") )]
5440	pub fin_instrm_id: Option<SecurityIdentification19>,
5441	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
5442	pub tax: Option<TaxInformation8>,
5443	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrInf", skip_serializing_if = "Option::is_none") )]
5444	pub rtr_inf: Option<PaymentReturnReason5>,
5445	#[cfg_attr( feature = "derive_serde", serde(rename = "CorpActn", skip_serializing_if = "Option::is_none") )]
5446	pub corp_actn: Option<CorporateAction9>,
5447	#[cfg_attr( feature = "derive_serde", serde(rename = "SfkpgAcct", skip_serializing_if = "Option::is_none") )]
5448	pub sfkpg_acct: Option<SecuritiesAccount19>,
5449	#[cfg_attr( feature = "derive_serde", serde(rename = "CshDpst", skip_serializing_if = "Option::is_none") )]
5450	pub csh_dpst: Option<Vec<CashDeposit1>>,
5451	#[cfg_attr( feature = "derive_serde", serde(rename = "CardTx", skip_serializing_if = "Option::is_none") )]
5452	pub card_tx: Option<CardTransaction17>,
5453	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlTxInf", skip_serializing_if = "Option::is_none") )]
5454	pub addtl_tx_inf: Option<String>,
5455	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
5456	pub splmtry_data: Option<Vec<SupplementaryData1>>,
5457}
5458
5459impl EntryTransaction10 {
5460	pub fn validate(&self) -> Result<(), ValidationError> {
5461		if let Some(ref val) = self.refs { val.validate()? }
5462		if let Some(ref val) = self.amt { val.validate()? }
5463		if let Some(ref val) = self.cdt_dbt_ind { val.validate()? }
5464		if let Some(ref val) = self.amt_dtls { val.validate()? }
5465		if let Some(ref vec) = self.avlbty { for item in vec { item.validate()? } }
5466		if let Some(ref val) = self.bk_tx_cd { val.validate()? }
5467		if let Some(ref val) = self.chrgs { val.validate()? }
5468		if let Some(ref val) = self.intrst { val.validate()? }
5469		if let Some(ref val) = self.rltd_pties { val.validate()? }
5470		if let Some(ref val) = self.rltd_agts { val.validate()? }
5471		if let Some(ref val) = self.lcl_instrm { val.validate()? }
5472		if let Some(ref val) = self.purp { val.validate()? }
5473		if let Some(ref vec) = self.rltd_rmt_inf { for item in vec { item.validate()? } }
5474		if let Some(ref val) = self.rmt_inf { val.validate()? }
5475		if let Some(ref val) = self.rltd_dts { val.validate()? }
5476		if let Some(ref val) = self.rltd_pric { val.validate()? }
5477		if let Some(ref vec) = self.rltd_qties { for item in vec { item.validate()? } }
5478		if let Some(ref val) = self.fin_instrm_id { val.validate()? }
5479		if let Some(ref val) = self.tax { val.validate()? }
5480		if let Some(ref val) = self.rtr_inf { val.validate()? }
5481		if let Some(ref val) = self.corp_actn { val.validate()? }
5482		if let Some(ref val) = self.sfkpg_acct { val.validate()? }
5483		if let Some(ref vec) = self.csh_dpst { for item in vec { item.validate()? } }
5484		if let Some(ref val) = self.card_tx { val.validate()? }
5485		if let Some(ref val) = self.addtl_tx_inf {
5486			if val.chars().count() < 1 {
5487				return Err(ValidationError::new(1001, "addtl_tx_inf is shorter than the minimum length of 1".to_string()));
5488			}
5489			if val.chars().count() > 500 {
5490				return Err(ValidationError::new(1002, "addtl_tx_inf exceeds the maximum length of 500".to_string()));
5491			}
5492		}
5493		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
5494		Ok(())
5495	}
5496}
5497
5498
5499// EquivalentAmount2 ...
5500#[cfg_attr(feature = "derive_debug", derive(Debug))]
5501#[cfg_attr(feature = "derive_default", derive(Default))]
5502#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5503#[cfg_attr(feature = "derive_clone", derive(Clone))]
5504#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5505pub struct EquivalentAmount2 {
5506	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
5507	pub amt: ActiveOrHistoricCurrencyAndAmount,
5508	#[cfg_attr( feature = "derive_serde", serde(rename = "CcyOfTrf") )]
5509	pub ccy_of_trf: String,
5510}
5511
5512impl EquivalentAmount2 {
5513	pub fn validate(&self) -> Result<(), ValidationError> {
5514		self.amt.validate()?;
5515		let pattern = Regex::new("[A-Z]{3,3}").unwrap();
5516		if !pattern.is_match(&self.ccy_of_trf) {
5517			return Err(ValidationError::new(1005, "ccy_of_trf does not match the required pattern".to_string()));
5518		}
5519		Ok(())
5520	}
5521}
5522
5523
5524// Event1 ...
5525#[cfg_attr(feature = "derive_debug", derive(Debug))]
5526#[cfg_attr(feature = "derive_default", derive(Default))]
5527#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5528#[cfg_attr(feature = "derive_clone", derive(Clone))]
5529#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5530pub struct Event1 {
5531	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtCd") )]
5532	pub evt_cd: String,
5533	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtParam", skip_serializing_if = "Option::is_none") )]
5534	pub evt_param: Option<Vec<String>>,
5535	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtDesc", skip_serializing_if = "Option::is_none") )]
5536	pub evt_desc: Option<String>,
5537	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtTm", skip_serializing_if = "Option::is_none") )]
5538	pub evt_tm: Option<String>,
5539}
5540
5541impl Event1 {
5542	pub fn validate(&self) -> Result<(), ValidationError> {
5543		if self.evt_cd.chars().count() < 1 {
5544			return Err(ValidationError::new(1001, "evt_cd is shorter than the minimum length of 1".to_string()));
5545		}
5546		if self.evt_cd.chars().count() > 4 {
5547			return Err(ValidationError::new(1002, "evt_cd exceeds the maximum length of 4".to_string()));
5548		}
5549		let pattern = Regex::new("[a-zA-Z0-9]{1,4}").unwrap();
5550		if !pattern.is_match(&self.evt_cd) {
5551			return Err(ValidationError::new(1005, "evt_cd does not match the required pattern".to_string()));
5552		}
5553		if let Some(ref vec) = self.evt_param {
5554			for item in vec {
5555				if item.chars().count() < 1 {
5556					return Err(ValidationError::new(1001, "evt_param is shorter than the minimum length of 1".to_string()));
5557				}
5558				if item.chars().count() > 35 {
5559					return Err(ValidationError::new(1002, "evt_param exceeds the maximum length of 35".to_string()));
5560				}
5561			}
5562		}
5563		if let Some(ref val) = self.evt_desc {
5564			if val.chars().count() < 1 {
5565				return Err(ValidationError::new(1001, "evt_desc is shorter than the minimum length of 1".to_string()));
5566			}
5567			if val.chars().count() > 350 {
5568				return Err(ValidationError::new(1002, "evt_desc exceeds the maximum length of 350".to_string()));
5569			}
5570		}
5571		Ok(())
5572	}
5573}
5574
5575
5576// Event2 ...
5577#[cfg_attr(feature = "derive_debug", derive(Debug))]
5578#[cfg_attr(feature = "derive_default", derive(Default))]
5579#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5580#[cfg_attr(feature = "derive_clone", derive(Clone))]
5581#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5582pub struct Event2 {
5583	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtCd") )]
5584	pub evt_cd: String,
5585	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtParam", skip_serializing_if = "Option::is_none") )]
5586	pub evt_param: Option<Vec<String>>,
5587	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtDesc", skip_serializing_if = "Option::is_none") )]
5588	pub evt_desc: Option<String>,
5589	#[cfg_attr( feature = "derive_serde", serde(rename = "EvtTm", skip_serializing_if = "Option::is_none") )]
5590	pub evt_tm: Option<String>,
5591}
5592
5593impl Event2 {
5594	pub fn validate(&self) -> Result<(), ValidationError> {
5595		if self.evt_cd.chars().count() < 1 {
5596			return Err(ValidationError::new(1001, "evt_cd is shorter than the minimum length of 1".to_string()));
5597		}
5598		if self.evt_cd.chars().count() > 4 {
5599			return Err(ValidationError::new(1002, "evt_cd exceeds the maximum length of 4".to_string()));
5600		}
5601		let pattern = Regex::new("[a-zA-Z0-9]{1,4}").unwrap();
5602		if !pattern.is_match(&self.evt_cd) {
5603			return Err(ValidationError::new(1005, "evt_cd does not match the required pattern".to_string()));
5604		}
5605		if let Some(ref vec) = self.evt_param {
5606			for item in vec {
5607				if item.chars().count() < 1 {
5608					return Err(ValidationError::new(1001, "evt_param is shorter than the minimum length of 1".to_string()));
5609				}
5610				if item.chars().count() > 35 {
5611					return Err(ValidationError::new(1002, "evt_param exceeds the maximum length of 35".to_string()));
5612				}
5613			}
5614		}
5615		if let Some(ref val) = self.evt_desc {
5616			if val.chars().count() < 1 {
5617				return Err(ValidationError::new(1001, "evt_desc is shorter than the minimum length of 1".to_string()));
5618			}
5619			if val.chars().count() > 1000 {
5620				return Err(ValidationError::new(1002, "evt_desc exceeds the maximum length of 1000".to_string()));
5621			}
5622		}
5623		Ok(())
5624	}
5625}
5626
5627
5628// FinancialIdentificationSchemeName1Choice ...
5629#[cfg_attr(feature = "derive_debug", derive(Debug))]
5630#[cfg_attr(feature = "derive_default", derive(Default))]
5631#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5632#[cfg_attr(feature = "derive_clone", derive(Clone))]
5633#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5634pub struct FinancialIdentificationSchemeName1Choice {
5635	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5636	pub cd: Option<String>,
5637	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5638	pub prtry: Option<String>,
5639}
5640
5641impl FinancialIdentificationSchemeName1Choice {
5642	pub fn validate(&self) -> Result<(), ValidationError> {
5643		if let Some(ref val) = self.cd {
5644			if val.chars().count() < 1 {
5645				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5646			}
5647			if val.chars().count() > 4 {
5648				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5649			}
5650		}
5651		if let Some(ref val) = self.prtry {
5652			if val.chars().count() < 1 {
5653				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
5654			}
5655			if val.chars().count() > 35 {
5656				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
5657			}
5658		}
5659		Ok(())
5660	}
5661}
5662
5663
5664// FinancialInstitutionIdentification18 ...
5665#[cfg_attr(feature = "derive_debug", derive(Debug))]
5666#[cfg_attr(feature = "derive_default", derive(Default))]
5667#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5668#[cfg_attr(feature = "derive_clone", derive(Clone))]
5669#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5670pub struct FinancialInstitutionIdentification18 {
5671	#[cfg_attr( feature = "derive_serde", serde(rename = "BICFI", skip_serializing_if = "Option::is_none") )]
5672	pub bicfi: Option<String>,
5673	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysMmbId", skip_serializing_if = "Option::is_none") )]
5674	pub clr_sys_mmb_id: Option<ClearingSystemMemberIdentification2>,
5675	#[cfg_attr( feature = "derive_serde", serde(rename = "LEI", skip_serializing_if = "Option::is_none") )]
5676	pub lei: Option<String>,
5677	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
5678	pub nm: Option<String>,
5679	#[cfg_attr( feature = "derive_serde", serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none") )]
5680	pub pstl_adr: Option<PostalAddress24>,
5681	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
5682	pub othr: Option<GenericFinancialIdentification1>,
5683}
5684
5685impl FinancialInstitutionIdentification18 {
5686	pub fn validate(&self) -> Result<(), ValidationError> {
5687		if let Some(ref val) = self.bicfi {
5688			let pattern = Regex::new("[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}").unwrap();
5689			if !pattern.is_match(val) {
5690				return Err(ValidationError::new(1005, "bicfi does not match the required pattern".to_string()));
5691			}
5692		}
5693		if let Some(ref val) = self.clr_sys_mmb_id { val.validate()? }
5694		if let Some(ref val) = self.lei {
5695			let pattern = Regex::new("[A-Z0-9]{18,18}[0-9]{2,2}").unwrap();
5696			if !pattern.is_match(val) {
5697				return Err(ValidationError::new(1005, "lei does not match the required pattern".to_string()));
5698			}
5699		}
5700		if let Some(ref val) = self.nm {
5701			if val.chars().count() < 1 {
5702				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
5703			}
5704			if val.chars().count() > 140 {
5705				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
5706			}
5707		}
5708		if let Some(ref val) = self.pstl_adr { val.validate()? }
5709		if let Some(ref val) = self.othr { val.validate()? }
5710		Ok(())
5711	}
5712}
5713
5714
5715// FinancialInstrumentQuantity1Choice ...
5716#[cfg_attr(feature = "derive_debug", derive(Debug))]
5717#[cfg_attr(feature = "derive_default", derive(Default))]
5718#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5719#[cfg_attr(feature = "derive_clone", derive(Clone))]
5720#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5721pub struct FinancialInstrumentQuantity1Choice {
5722	#[cfg_attr( feature = "derive_serde", serde(rename = "Unit", skip_serializing_if = "Option::is_none") )]
5723	pub unit: Option<f64>,
5724	#[cfg_attr( feature = "derive_serde", serde(rename = "FaceAmt", skip_serializing_if = "Option::is_none") )]
5725	pub face_amt: Option<f64>,
5726	#[cfg_attr( feature = "derive_serde", serde(rename = "AmtsdVal", skip_serializing_if = "Option::is_none") )]
5727	pub amtsd_val: Option<f64>,
5728}
5729
5730impl FinancialInstrumentQuantity1Choice {
5731	pub fn validate(&self) -> Result<(), ValidationError> {
5732		if let Some(ref val) = self.face_amt {
5733			if *val < 0.000000 {
5734				return Err(ValidationError::new(1003, "face_amt is less than the minimum value of 0.000000".to_string()));
5735			}
5736		}
5737		if let Some(ref val) = self.amtsd_val {
5738			if *val < 0.000000 {
5739				return Err(ValidationError::new(1003, "amtsd_val is less than the minimum value of 0.000000".to_string()));
5740			}
5741		}
5742		Ok(())
5743	}
5744}
5745
5746
5747// FloorLimitType1Code ...
5748#[cfg_attr(feature = "derive_debug", derive(Debug))]
5749#[cfg_attr(feature = "derive_default", derive(Default))]
5750#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5751#[cfg_attr(feature = "derive_clone", derive(Clone))]
5752#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5753pub enum FloorLimitType1Code {
5754	#[cfg_attr(feature = "derive_default", default)]
5755	#[cfg_attr( feature = "derive_serde", serde(rename = "CRED") )]
5756	CodeCRED,
5757	#[cfg_attr( feature = "derive_serde", serde(rename = "DEBT") )]
5758	CodeDEBT,
5759	#[cfg_attr( feature = "derive_serde", serde(rename = "BOTH") )]
5760	CodeBOTH,
5761}
5762
5763impl FloorLimitType1Code {
5764	pub fn validate(&self) -> Result<(), ValidationError> {
5765		Ok(())
5766	}
5767}
5768
5769
5770// Frequency36Choice ...
5771#[cfg_attr(feature = "derive_debug", derive(Debug))]
5772#[cfg_attr(feature = "derive_default", derive(Default))]
5773#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5774#[cfg_attr(feature = "derive_clone", derive(Clone))]
5775#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5776pub struct Frequency36Choice {
5777	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
5778	pub tp: Option<Frequency6Code>,
5779	#[cfg_attr( feature = "derive_serde", serde(rename = "Prd", skip_serializing_if = "Option::is_none") )]
5780	pub prd: Option<FrequencyPeriod1>,
5781	#[cfg_attr( feature = "derive_serde", serde(rename = "PtInTm", skip_serializing_if = "Option::is_none") )]
5782	pub pt_in_tm: Option<FrequencyAndMoment1>,
5783}
5784
5785impl Frequency36Choice {
5786	pub fn validate(&self) -> Result<(), ValidationError> {
5787		if let Some(ref val) = self.tp { val.validate()? }
5788		if let Some(ref val) = self.prd { val.validate()? }
5789		if let Some(ref val) = self.pt_in_tm { val.validate()? }
5790		Ok(())
5791	}
5792}
5793
5794
5795// Frequency6Code ...
5796#[cfg_attr(feature = "derive_debug", derive(Debug))]
5797#[cfg_attr(feature = "derive_default", derive(Default))]
5798#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5799#[cfg_attr(feature = "derive_clone", derive(Clone))]
5800#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5801pub enum Frequency6Code {
5802	#[cfg_attr(feature = "derive_default", default)]
5803	#[cfg_attr( feature = "derive_serde", serde(rename = "YEAR") )]
5804	CodeYEAR,
5805	#[cfg_attr( feature = "derive_serde", serde(rename = "MNTH") )]
5806	CodeMNTH,
5807	#[cfg_attr( feature = "derive_serde", serde(rename = "QURT") )]
5808	CodeQURT,
5809	#[cfg_attr( feature = "derive_serde", serde(rename = "MIAN") )]
5810	CodeMIAN,
5811	#[cfg_attr( feature = "derive_serde", serde(rename = "WEEK") )]
5812	CodeWEEK,
5813	#[cfg_attr( feature = "derive_serde", serde(rename = "DAIL") )]
5814	CodeDAIL,
5815	#[cfg_attr( feature = "derive_serde", serde(rename = "ADHO") )]
5816	CodeADHO,
5817	#[cfg_attr( feature = "derive_serde", serde(rename = "INDA") )]
5818	CodeINDA,
5819	#[cfg_attr( feature = "derive_serde", serde(rename = "FRTN") )]
5820	CodeFRTN,
5821}
5822
5823impl Frequency6Code {
5824	pub fn validate(&self) -> Result<(), ValidationError> {
5825		Ok(())
5826	}
5827}
5828
5829
5830// FrequencyAndMoment1 ...
5831#[cfg_attr(feature = "derive_debug", derive(Debug))]
5832#[cfg_attr(feature = "derive_default", derive(Default))]
5833#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5834#[cfg_attr(feature = "derive_clone", derive(Clone))]
5835#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5836pub struct FrequencyAndMoment1 {
5837	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
5838	pub tp: Frequency6Code,
5839	#[cfg_attr( feature = "derive_serde", serde(rename = "PtInTm") )]
5840	pub pt_in_tm: String,
5841}
5842
5843impl FrequencyAndMoment1 {
5844	pub fn validate(&self) -> Result<(), ValidationError> {
5845		self.tp.validate()?;
5846		let pattern = Regex::new("[0-9]{2}").unwrap();
5847		if !pattern.is_match(&self.pt_in_tm) {
5848			return Err(ValidationError::new(1005, "pt_in_tm does not match the required pattern".to_string()));
5849		}
5850		Ok(())
5851	}
5852}
5853
5854
5855// FrequencyPeriod1 ...
5856#[cfg_attr(feature = "derive_debug", derive(Debug))]
5857#[cfg_attr(feature = "derive_default", derive(Default))]
5858#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5859#[cfg_attr(feature = "derive_clone", derive(Clone))]
5860#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5861pub struct FrequencyPeriod1 {
5862	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
5863	pub tp: Frequency6Code,
5864	#[cfg_attr( feature = "derive_serde", serde(rename = "CntPerPrd") )]
5865	pub cnt_per_prd: f64,
5866}
5867
5868impl FrequencyPeriod1 {
5869	pub fn validate(&self) -> Result<(), ValidationError> {
5870		self.tp.validate()?;
5871		Ok(())
5872	}
5873}
5874
5875
5876// FromToAmountRange1 ...
5877#[cfg_attr(feature = "derive_debug", derive(Debug))]
5878#[cfg_attr(feature = "derive_default", derive(Default))]
5879#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5880#[cfg_attr(feature = "derive_clone", derive(Clone))]
5881#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5882pub struct FromToAmountRange1 {
5883	#[cfg_attr( feature = "derive_serde", serde(rename = "FrAmt") )]
5884	pub fr_amt: AmountRangeBoundary1,
5885	#[cfg_attr( feature = "derive_serde", serde(rename = "ToAmt") )]
5886	pub to_amt: AmountRangeBoundary1,
5887}
5888
5889impl FromToAmountRange1 {
5890	pub fn validate(&self) -> Result<(), ValidationError> {
5891		self.fr_amt.validate()?;
5892		self.to_amt.validate()?;
5893		Ok(())
5894	}
5895}
5896
5897
5898// Garnishment3 ...
5899#[cfg_attr(feature = "derive_debug", derive(Debug))]
5900#[cfg_attr(feature = "derive_default", derive(Default))]
5901#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5902#[cfg_attr(feature = "derive_clone", derive(Clone))]
5903#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5904pub struct Garnishment3 {
5905	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
5906	pub tp: GarnishmentType1,
5907	#[cfg_attr( feature = "derive_serde", serde(rename = "Grnshee", skip_serializing_if = "Option::is_none") )]
5908	pub grnshee: Option<PartyIdentification135>,
5909	#[cfg_attr( feature = "derive_serde", serde(rename = "GrnshmtAdmstr", skip_serializing_if = "Option::is_none") )]
5910	pub grnshmt_admstr: Option<PartyIdentification135>,
5911	#[cfg_attr( feature = "derive_serde", serde(rename = "RefNb", skip_serializing_if = "Option::is_none") )]
5912	pub ref_nb: Option<String>,
5913	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
5914	pub dt: Option<String>,
5915	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none") )]
5916	pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
5917	#[cfg_attr( feature = "derive_serde", serde(rename = "FmlyMdclInsrncInd", skip_serializing_if = "Option::is_none") )]
5918	pub fmly_mdcl_insrnc_ind: Option<bool>,
5919	#[cfg_attr( feature = "derive_serde", serde(rename = "MplyeeTermntnInd", skip_serializing_if = "Option::is_none") )]
5920	pub mplyee_termntn_ind: Option<bool>,
5921}
5922
5923impl Garnishment3 {
5924	pub fn validate(&self) -> Result<(), ValidationError> {
5925		self.tp.validate()?;
5926		if let Some(ref val) = self.grnshee { val.validate()? }
5927		if let Some(ref val) = self.grnshmt_admstr { val.validate()? }
5928		if let Some(ref val) = self.ref_nb {
5929			if val.chars().count() < 1 {
5930				return Err(ValidationError::new(1001, "ref_nb is shorter than the minimum length of 1".to_string()));
5931			}
5932			if val.chars().count() > 140 {
5933				return Err(ValidationError::new(1002, "ref_nb exceeds the maximum length of 140".to_string()));
5934			}
5935		}
5936		if let Some(ref val) = self.rmtd_amt { val.validate()? }
5937		Ok(())
5938	}
5939}
5940
5941
5942// GarnishmentType1 ...
5943#[cfg_attr(feature = "derive_debug", derive(Debug))]
5944#[cfg_attr(feature = "derive_default", derive(Default))]
5945#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5946#[cfg_attr(feature = "derive_clone", derive(Clone))]
5947#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5948pub struct GarnishmentType1 {
5949	#[cfg_attr( feature = "derive_serde", serde(rename = "CdOrPrtry") )]
5950	pub cd_or_prtry: GarnishmentType1Choice,
5951	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
5952	pub issr: Option<String>,
5953}
5954
5955impl GarnishmentType1 {
5956	pub fn validate(&self) -> Result<(), ValidationError> {
5957		self.cd_or_prtry.validate()?;
5958		if let Some(ref val) = self.issr {
5959			if val.chars().count() < 1 {
5960				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
5961			}
5962			if val.chars().count() > 35 {
5963				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
5964			}
5965		}
5966		Ok(())
5967	}
5968}
5969
5970
5971// GarnishmentType1Choice ...
5972#[cfg_attr(feature = "derive_debug", derive(Debug))]
5973#[cfg_attr(feature = "derive_default", derive(Default))]
5974#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
5975#[cfg_attr(feature = "derive_clone", derive(Clone))]
5976#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
5977pub struct GarnishmentType1Choice {
5978	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
5979	pub cd: Option<String>,
5980	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
5981	pub prtry: Option<String>,
5982}
5983
5984impl GarnishmentType1Choice {
5985	pub fn validate(&self) -> Result<(), ValidationError> {
5986		if let Some(ref val) = self.cd {
5987			if val.chars().count() < 1 {
5988				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
5989			}
5990			if val.chars().count() > 4 {
5991				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
5992			}
5993		}
5994		if let Some(ref val) = self.prtry {
5995			if val.chars().count() < 1 {
5996				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
5997			}
5998			if val.chars().count() > 35 {
5999				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
6000			}
6001		}
6002		Ok(())
6003	}
6004}
6005
6006
6007// GenericAccountIdentification1 ...
6008#[cfg_attr(feature = "derive_debug", derive(Debug))]
6009#[cfg_attr(feature = "derive_default", derive(Default))]
6010#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6011#[cfg_attr(feature = "derive_clone", derive(Clone))]
6012#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6013pub struct GenericAccountIdentification1 {
6014	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6015	pub id: String,
6016	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6017	pub schme_nm: Option<AccountSchemeName1Choice>,
6018	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6019	pub issr: Option<String>,
6020}
6021
6022impl GenericAccountIdentification1 {
6023	pub fn validate(&self) -> Result<(), ValidationError> {
6024		if self.id.chars().count() < 1 {
6025			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6026		}
6027		if self.id.chars().count() > 34 {
6028			return Err(ValidationError::new(1002, "id exceeds the maximum length of 34".to_string()));
6029		}
6030		if let Some(ref val) = self.schme_nm { val.validate()? }
6031		if let Some(ref val) = self.issr {
6032			if val.chars().count() < 1 {
6033				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6034			}
6035			if val.chars().count() > 35 {
6036				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6037			}
6038		}
6039		Ok(())
6040	}
6041}
6042
6043
6044// GenericFinancialIdentification1 ...
6045#[cfg_attr(feature = "derive_debug", derive(Debug))]
6046#[cfg_attr(feature = "derive_default", derive(Default))]
6047#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6048#[cfg_attr(feature = "derive_clone", derive(Clone))]
6049#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6050pub struct GenericFinancialIdentification1 {
6051	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6052	pub id: String,
6053	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6054	pub schme_nm: Option<FinancialIdentificationSchemeName1Choice>,
6055	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6056	pub issr: Option<String>,
6057}
6058
6059impl GenericFinancialIdentification1 {
6060	pub fn validate(&self) -> Result<(), ValidationError> {
6061		if self.id.chars().count() < 1 {
6062			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6063		}
6064		if self.id.chars().count() > 35 {
6065			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6066		}
6067		if let Some(ref val) = self.schme_nm { val.validate()? }
6068		if let Some(ref val) = self.issr {
6069			if val.chars().count() < 1 {
6070				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6071			}
6072			if val.chars().count() > 35 {
6073				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6074			}
6075		}
6076		Ok(())
6077	}
6078}
6079
6080
6081// GenericIdentification1 ...
6082#[cfg_attr(feature = "derive_debug", derive(Debug))]
6083#[cfg_attr(feature = "derive_default", derive(Default))]
6084#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6085#[cfg_attr(feature = "derive_clone", derive(Clone))]
6086#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6087pub struct GenericIdentification1 {
6088	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6089	pub id: String,
6090	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6091	pub schme_nm: Option<String>,
6092	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6093	pub issr: Option<String>,
6094}
6095
6096impl GenericIdentification1 {
6097	pub fn validate(&self) -> Result<(), ValidationError> {
6098		if self.id.chars().count() < 1 {
6099			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6100		}
6101		if self.id.chars().count() > 35 {
6102			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6103		}
6104		if let Some(ref val) = self.schme_nm {
6105			if val.chars().count() < 1 {
6106				return Err(ValidationError::new(1001, "schme_nm is shorter than the minimum length of 1".to_string()));
6107			}
6108			if val.chars().count() > 35 {
6109				return Err(ValidationError::new(1002, "schme_nm exceeds the maximum length of 35".to_string()));
6110			}
6111		}
6112		if let Some(ref val) = self.issr {
6113			if val.chars().count() < 1 {
6114				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6115			}
6116			if val.chars().count() > 35 {
6117				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6118			}
6119		}
6120		Ok(())
6121	}
6122}
6123
6124
6125// GenericIdentification3 ...
6126#[cfg_attr(feature = "derive_debug", derive(Debug))]
6127#[cfg_attr(feature = "derive_default", derive(Default))]
6128#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6129#[cfg_attr(feature = "derive_clone", derive(Clone))]
6130#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6131pub struct GenericIdentification3 {
6132	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6133	pub id: String,
6134	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6135	pub issr: Option<String>,
6136}
6137
6138impl GenericIdentification3 {
6139	pub fn validate(&self) -> Result<(), ValidationError> {
6140		if self.id.chars().count() < 1 {
6141			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6142		}
6143		if self.id.chars().count() > 35 {
6144			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6145		}
6146		if let Some(ref val) = self.issr {
6147			if val.chars().count() < 1 {
6148				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6149			}
6150			if val.chars().count() > 35 {
6151				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6152			}
6153		}
6154		Ok(())
6155	}
6156}
6157
6158
6159// GenericIdentification30 ...
6160#[cfg_attr(feature = "derive_debug", derive(Debug))]
6161#[cfg_attr(feature = "derive_default", derive(Default))]
6162#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6163#[cfg_attr(feature = "derive_clone", derive(Clone))]
6164#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6165pub struct GenericIdentification30 {
6166	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6167	pub id: String,
6168	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr") )]
6169	pub issr: String,
6170	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6171	pub schme_nm: Option<String>,
6172}
6173
6174impl GenericIdentification30 {
6175	pub fn validate(&self) -> Result<(), ValidationError> {
6176		let pattern = Regex::new("[a-zA-Z0-9]{4}").unwrap();
6177		if !pattern.is_match(&self.id) {
6178			return Err(ValidationError::new(1005, "id does not match the required pattern".to_string()));
6179		}
6180		if self.issr.chars().count() < 1 {
6181			return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6182		}
6183		if self.issr.chars().count() > 35 {
6184			return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6185		}
6186		if let Some(ref val) = self.schme_nm {
6187			if val.chars().count() < 1 {
6188				return Err(ValidationError::new(1001, "schme_nm is shorter than the minimum length of 1".to_string()));
6189			}
6190			if val.chars().count() > 35 {
6191				return Err(ValidationError::new(1002, "schme_nm exceeds the maximum length of 35".to_string()));
6192			}
6193		}
6194		Ok(())
6195	}
6196}
6197
6198
6199// GenericIdentification32 ...
6200#[cfg_attr(feature = "derive_debug", derive(Debug))]
6201#[cfg_attr(feature = "derive_default", derive(Default))]
6202#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6203#[cfg_attr(feature = "derive_clone", derive(Clone))]
6204#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6205pub struct GenericIdentification32 {
6206	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6207	pub id: String,
6208	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
6209	pub tp: Option<PartyType3Code>,
6210	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6211	pub issr: Option<PartyType4Code>,
6212	#[cfg_attr( feature = "derive_serde", serde(rename = "ShrtNm", skip_serializing_if = "Option::is_none") )]
6213	pub shrt_nm: Option<String>,
6214}
6215
6216impl GenericIdentification32 {
6217	pub fn validate(&self) -> Result<(), ValidationError> {
6218		if self.id.chars().count() < 1 {
6219			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6220		}
6221		if self.id.chars().count() > 35 {
6222			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6223		}
6224		if let Some(ref val) = self.tp { val.validate()? }
6225		if let Some(ref val) = self.issr { val.validate()? }
6226		if let Some(ref val) = self.shrt_nm {
6227			if val.chars().count() < 1 {
6228				return Err(ValidationError::new(1001, "shrt_nm is shorter than the minimum length of 1".to_string()));
6229			}
6230			if val.chars().count() > 35 {
6231				return Err(ValidationError::new(1002, "shrt_nm exceeds the maximum length of 35".to_string()));
6232			}
6233		}
6234		Ok(())
6235	}
6236}
6237
6238
6239// GenericIdentification36 ...
6240#[cfg_attr(feature = "derive_debug", derive(Debug))]
6241#[cfg_attr(feature = "derive_default", derive(Default))]
6242#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6243#[cfg_attr(feature = "derive_clone", derive(Clone))]
6244#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6245pub struct GenericIdentification36 {
6246	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6247	pub id: String,
6248	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr") )]
6249	pub issr: String,
6250	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6251	pub schme_nm: Option<String>,
6252}
6253
6254impl GenericIdentification36 {
6255	pub fn validate(&self) -> Result<(), ValidationError> {
6256		if self.id.chars().count() < 1 {
6257			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6258		}
6259		if self.id.chars().count() > 35 {
6260			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6261		}
6262		if self.issr.chars().count() < 1 {
6263			return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6264		}
6265		if self.issr.chars().count() > 35 {
6266			return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6267		}
6268		if let Some(ref val) = self.schme_nm {
6269			if val.chars().count() < 1 {
6270				return Err(ValidationError::new(1001, "schme_nm is shorter than the minimum length of 1".to_string()));
6271			}
6272			if val.chars().count() > 35 {
6273				return Err(ValidationError::new(1002, "schme_nm exceeds the maximum length of 35".to_string()));
6274			}
6275		}
6276		Ok(())
6277	}
6278}
6279
6280
6281// GenericOrganisationIdentification1 ...
6282#[cfg_attr(feature = "derive_debug", derive(Debug))]
6283#[cfg_attr(feature = "derive_default", derive(Default))]
6284#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6285#[cfg_attr(feature = "derive_clone", derive(Clone))]
6286#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6287pub struct GenericOrganisationIdentification1 {
6288	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6289	pub id: String,
6290	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6291	pub schme_nm: Option<OrganisationIdentificationSchemeName1Choice>,
6292	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6293	pub issr: Option<String>,
6294}
6295
6296impl GenericOrganisationIdentification1 {
6297	pub fn validate(&self) -> Result<(), ValidationError> {
6298		if self.id.chars().count() < 1 {
6299			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6300		}
6301		if self.id.chars().count() > 35 {
6302			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6303		}
6304		if let Some(ref val) = self.schme_nm { val.validate()? }
6305		if let Some(ref val) = self.issr {
6306			if val.chars().count() < 1 {
6307				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6308			}
6309			if val.chars().count() > 35 {
6310				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6311			}
6312		}
6313		Ok(())
6314	}
6315}
6316
6317
6318// GenericPersonIdentification1 ...
6319#[cfg_attr(feature = "derive_debug", derive(Debug))]
6320#[cfg_attr(feature = "derive_default", derive(Default))]
6321#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6322#[cfg_attr(feature = "derive_clone", derive(Clone))]
6323#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6324pub struct GenericPersonIdentification1 {
6325	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6326	pub id: String,
6327	#[cfg_attr( feature = "derive_serde", serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none") )]
6328	pub schme_nm: Option<PersonIdentificationSchemeName1Choice>,
6329	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
6330	pub issr: Option<String>,
6331}
6332
6333impl GenericPersonIdentification1 {
6334	pub fn validate(&self) -> Result<(), ValidationError> {
6335		if self.id.chars().count() < 1 {
6336			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6337		}
6338		if self.id.chars().count() > 35 {
6339			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
6340		}
6341		if let Some(ref val) = self.schme_nm { val.validate()? }
6342		if let Some(ref val) = self.issr {
6343			if val.chars().count() < 1 {
6344				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
6345			}
6346			if val.chars().count() > 35 {
6347				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
6348			}
6349		}
6350		Ok(())
6351	}
6352}
6353
6354
6355// GroupCancellationStatus1Code ...
6356#[cfg_attr(feature = "derive_debug", derive(Debug))]
6357#[cfg_attr(feature = "derive_default", derive(Default))]
6358#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6359#[cfg_attr(feature = "derive_clone", derive(Clone))]
6360#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6361pub enum GroupCancellationStatus1Code {
6362	#[cfg_attr(feature = "derive_default", default)]
6363	#[cfg_attr( feature = "derive_serde", serde(rename = "PACR") )]
6364	CodePACR,
6365	#[cfg_attr( feature = "derive_serde", serde(rename = "RJCR") )]
6366	CodeRJCR,
6367	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCR") )]
6368	CodeACCR,
6369	#[cfg_attr( feature = "derive_serde", serde(rename = "PDCR") )]
6370	CodePDCR,
6371}
6372
6373impl GroupCancellationStatus1Code {
6374	pub fn validate(&self) -> Result<(), ValidationError> {
6375		Ok(())
6376	}
6377}
6378
6379
6380// GroupHeader77 ...
6381#[cfg_attr(feature = "derive_debug", derive(Debug))]
6382#[cfg_attr(feature = "derive_default", derive(Default))]
6383#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6384#[cfg_attr(feature = "derive_clone", derive(Clone))]
6385#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6386pub struct GroupHeader77 {
6387	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6388	pub msg_id: String,
6389	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6390	pub cre_dt_tm: String,
6391	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgSndr", skip_serializing_if = "Option::is_none") )]
6392	pub msg_sndr: Option<Party40Choice>,
6393}
6394
6395impl GroupHeader77 {
6396	pub fn validate(&self) -> Result<(), ValidationError> {
6397		if self.msg_id.chars().count() < 1 {
6398			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6399		}
6400		if self.msg_id.chars().count() > 35 {
6401			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6402		}
6403		if let Some(ref val) = self.msg_sndr { val.validate()? }
6404		Ok(())
6405	}
6406}
6407
6408
6409// GroupHeader78 ...
6410#[cfg_attr(feature = "derive_debug", derive(Debug))]
6411#[cfg_attr(feature = "derive_default", derive(Default))]
6412#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6413#[cfg_attr(feature = "derive_clone", derive(Clone))]
6414#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6415pub struct GroupHeader78 {
6416	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6417	pub msg_id: String,
6418	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6419	pub cre_dt_tm: String,
6420	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs") )]
6421	pub nb_of_txs: String,
6422	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
6423	pub ctrl_sum: Option<f64>,
6424	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty") )]
6425	pub initg_pty: PartyIdentification135,
6426}
6427
6428impl GroupHeader78 {
6429	pub fn validate(&self) -> Result<(), ValidationError> {
6430		if self.msg_id.chars().count() < 1 {
6431			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6432		}
6433		if self.msg_id.chars().count() > 35 {
6434			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6435		}
6436		let pattern = Regex::new("[0-9]{1,15}").unwrap();
6437		if !pattern.is_match(&self.nb_of_txs) {
6438			return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
6439		}
6440		self.initg_pty.validate()?;
6441		Ok(())
6442	}
6443}
6444
6445
6446// GroupHeader81 ...
6447#[cfg_attr(feature = "derive_debug", derive(Debug))]
6448#[cfg_attr(feature = "derive_default", derive(Default))]
6449#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6450#[cfg_attr(feature = "derive_clone", derive(Clone))]
6451#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6452pub struct GroupHeader81 {
6453	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6454	pub msg_id: String,
6455	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6456	pub cre_dt_tm: String,
6457	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgRcpt", skip_serializing_if = "Option::is_none") )]
6458	pub msg_rcpt: Option<PartyIdentification135>,
6459	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgPgntn", skip_serializing_if = "Option::is_none") )]
6460	pub msg_pgntn: Option<Pagination1>,
6461	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlBizQry", skip_serializing_if = "Option::is_none") )]
6462	pub orgnl_biz_qry: Option<OriginalBusinessQuery1>,
6463	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
6464	pub addtl_inf: Option<String>,
6465}
6466
6467impl GroupHeader81 {
6468	pub fn validate(&self) -> Result<(), ValidationError> {
6469		if self.msg_id.chars().count() < 1 {
6470			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6471		}
6472		if self.msg_id.chars().count() > 35 {
6473			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6474		}
6475		if let Some(ref val) = self.msg_rcpt { val.validate()? }
6476		if let Some(ref val) = self.msg_pgntn { val.validate()? }
6477		if let Some(ref val) = self.orgnl_biz_qry { val.validate()? }
6478		if let Some(ref val) = self.addtl_inf {
6479			if val.chars().count() < 1 {
6480				return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
6481			}
6482			if val.chars().count() > 500 {
6483				return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 500".to_string()));
6484			}
6485		}
6486		Ok(())
6487	}
6488}
6489
6490
6491// GroupHeader87 ...
6492#[cfg_attr(feature = "derive_debug", derive(Debug))]
6493#[cfg_attr(feature = "derive_default", derive(Default))]
6494#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6495#[cfg_attr(feature = "derive_clone", derive(Clone))]
6496#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6497pub struct GroupHeader87 {
6498	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6499	pub msg_id: String,
6500	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6501	pub cre_dt_tm: String,
6502	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty") )]
6503	pub initg_pty: PartyIdentification135,
6504	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
6505	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6506	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
6507	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6508}
6509
6510impl GroupHeader87 {
6511	pub fn validate(&self) -> Result<(), ValidationError> {
6512		if self.msg_id.chars().count() < 1 {
6513			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6514		}
6515		if self.msg_id.chars().count() > 35 {
6516			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6517		}
6518		self.initg_pty.validate()?;
6519		if let Some(ref val) = self.dbtr_agt { val.validate()? }
6520		if let Some(ref val) = self.cdtr_agt { val.validate()? }
6521		Ok(())
6522	}
6523}
6524
6525
6526// GroupHeader90 ...
6527#[cfg_attr(feature = "derive_debug", derive(Debug))]
6528#[cfg_attr(feature = "derive_default", derive(Default))]
6529#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6530#[cfg_attr(feature = "derive_clone", derive(Clone))]
6531#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6532pub struct GroupHeader90 {
6533	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6534	pub msg_id: String,
6535	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6536	pub cre_dt_tm: String,
6537	#[cfg_attr( feature = "derive_serde", serde(rename = "Authstn", skip_serializing_if = "Option::is_none") )]
6538	pub authstn: Option<Vec<Authorisation1Choice>>,
6539	#[cfg_attr( feature = "derive_serde", serde(rename = "BtchBookg", skip_serializing_if = "Option::is_none") )]
6540	pub btch_bookg: Option<bool>,
6541	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs") )]
6542	pub nb_of_txs: String,
6543	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
6544	pub ctrl_sum: Option<f64>,
6545	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpRtr", skip_serializing_if = "Option::is_none") )]
6546	pub grp_rtr: Option<bool>,
6547	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlRtrdIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
6548	pub ttl_rtrd_intr_bk_sttlm_amt: Option<ActiveCurrencyAndAmount>,
6549	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
6550	pub intr_bk_sttlm_dt: Option<String>,
6551	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf") )]
6552	pub sttlm_inf: SettlementInstruction7,
6553	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
6554	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6555	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
6556	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6557}
6558
6559impl GroupHeader90 {
6560	pub fn validate(&self) -> Result<(), ValidationError> {
6561		if self.msg_id.chars().count() < 1 {
6562			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6563		}
6564		if self.msg_id.chars().count() > 35 {
6565			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6566		}
6567		if let Some(ref vec) = self.authstn { for item in vec { item.validate()? } }
6568		let pattern = Regex::new("[0-9]{1,15}").unwrap();
6569		if !pattern.is_match(&self.nb_of_txs) {
6570			return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
6571		}
6572		if let Some(ref val) = self.ttl_rtrd_intr_bk_sttlm_amt { val.validate()? }
6573		self.sttlm_inf.validate()?;
6574		if let Some(ref val) = self.instg_agt { val.validate()? }
6575		if let Some(ref val) = self.instd_agt { val.validate()? }
6576		Ok(())
6577	}
6578}
6579
6580
6581// GroupHeader91 ...
6582#[cfg_attr(feature = "derive_debug", derive(Debug))]
6583#[cfg_attr(feature = "derive_default", derive(Default))]
6584#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6585#[cfg_attr(feature = "derive_clone", derive(Clone))]
6586#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6587pub struct GroupHeader91 {
6588	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6589	pub msg_id: String,
6590	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6591	pub cre_dt_tm: String,
6592	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
6593	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6594	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
6595	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6596}
6597
6598impl GroupHeader91 {
6599	pub fn validate(&self) -> Result<(), ValidationError> {
6600		if self.msg_id.chars().count() < 1 {
6601			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6602		}
6603		if self.msg_id.chars().count() > 35 {
6604			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6605		}
6606		if let Some(ref val) = self.instg_agt { val.validate()? }
6607		if let Some(ref val) = self.instd_agt { val.validate()? }
6608		Ok(())
6609	}
6610}
6611
6612
6613// GroupHeader93 ...
6614#[cfg_attr(feature = "derive_debug", derive(Debug))]
6615#[cfg_attr(feature = "derive_default", derive(Default))]
6616#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6617#[cfg_attr(feature = "derive_clone", derive(Clone))]
6618#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6619pub struct GroupHeader93 {
6620	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
6621	pub msg_id: String,
6622	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm") )]
6623	pub cre_dt_tm: String,
6624	#[cfg_attr( feature = "derive_serde", serde(rename = "BtchBookg", skip_serializing_if = "Option::is_none") )]
6625	pub btch_bookg: Option<bool>,
6626	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs") )]
6627	pub nb_of_txs: String,
6628	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
6629	pub ctrl_sum: Option<f64>,
6630	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
6631	pub ttl_intr_bk_sttlm_amt: Option<ActiveCurrencyAndAmount>,
6632	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
6633	pub intr_bk_sttlm_dt: Option<String>,
6634	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf") )]
6635	pub sttlm_inf: SettlementInstruction7,
6636	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
6637	pub pmt_tp_inf: Option<PaymentTypeInformation28>,
6638	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
6639	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6640	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
6641	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
6642}
6643
6644impl GroupHeader93 {
6645	pub fn validate(&self) -> Result<(), ValidationError> {
6646		if self.msg_id.chars().count() < 1 {
6647			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
6648		}
6649		if self.msg_id.chars().count() > 35 {
6650			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
6651		}
6652		let pattern = Regex::new("[0-9]{1,15}").unwrap();
6653		if !pattern.is_match(&self.nb_of_txs) {
6654			return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
6655		}
6656		if let Some(ref val) = self.ttl_intr_bk_sttlm_amt { val.validate()? }
6657		self.sttlm_inf.validate()?;
6658		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
6659		if let Some(ref val) = self.instg_agt { val.validate()? }
6660		if let Some(ref val) = self.instd_agt { val.validate()? }
6661		Ok(())
6662	}
6663}
6664
6665
6666// IdentificationSource3Choice ...
6667#[cfg_attr(feature = "derive_debug", derive(Debug))]
6668#[cfg_attr(feature = "derive_default", derive(Default))]
6669#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6670#[cfg_attr(feature = "derive_clone", derive(Clone))]
6671#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6672pub struct IdentificationSource3Choice {
6673	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
6674	pub cd: Option<String>,
6675	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
6676	pub prtry: Option<String>,
6677}
6678
6679impl IdentificationSource3Choice {
6680	pub fn validate(&self) -> Result<(), ValidationError> {
6681		if let Some(ref val) = self.cd {
6682			if val.chars().count() < 1 {
6683				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
6684			}
6685			if val.chars().count() > 4 {
6686				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
6687			}
6688		}
6689		if let Some(ref val) = self.prtry {
6690			if val.chars().count() < 1 {
6691				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
6692			}
6693			if val.chars().count() > 35 {
6694				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
6695			}
6696		}
6697		Ok(())
6698	}
6699}
6700
6701
6702// ImplementationSpecification1 ...
6703#[cfg_attr(feature = "derive_debug", derive(Debug))]
6704#[cfg_attr(feature = "derive_default", derive(Default))]
6705#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6706#[cfg_attr(feature = "derive_clone", derive(Clone))]
6707#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6708pub struct ImplementationSpecification1 {
6709	#[cfg_attr( feature = "derive_serde", serde(rename = "Regy") )]
6710	pub regy: String,
6711	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
6712	pub id: String,
6713}
6714
6715impl ImplementationSpecification1 {
6716	pub fn validate(&self) -> Result<(), ValidationError> {
6717		if self.regy.chars().count() < 1 {
6718			return Err(ValidationError::new(1001, "regy is shorter than the minimum length of 1".to_string()));
6719		}
6720		if self.regy.chars().count() > 350 {
6721			return Err(ValidationError::new(1002, "regy exceeds the maximum length of 350".to_string()));
6722		}
6723		if self.id.chars().count() < 1 {
6724			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
6725		}
6726		if self.id.chars().count() > 2048 {
6727			return Err(ValidationError::new(1002, "id exceeds the maximum length of 2048".to_string()));
6728		}
6729		Ok(())
6730	}
6731}
6732
6733
6734// ImpliedCurrencyAmountRange1Choice ...
6735#[cfg_attr(feature = "derive_debug", derive(Debug))]
6736#[cfg_attr(feature = "derive_default", derive(Default))]
6737#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6738#[cfg_attr(feature = "derive_clone", derive(Clone))]
6739#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6740pub struct ImpliedCurrencyAmountRange1Choice {
6741	#[cfg_attr( feature = "derive_serde", serde(rename = "FrAmt", skip_serializing_if = "Option::is_none") )]
6742	pub fr_amt: Option<AmountRangeBoundary1>,
6743	#[cfg_attr( feature = "derive_serde", serde(rename = "ToAmt", skip_serializing_if = "Option::is_none") )]
6744	pub to_amt: Option<AmountRangeBoundary1>,
6745	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToAmt", skip_serializing_if = "Option::is_none") )]
6746	pub fr_to_amt: Option<FromToAmountRange1>,
6747	#[cfg_attr( feature = "derive_serde", serde(rename = "EQAmt", skip_serializing_if = "Option::is_none") )]
6748	pub eq_amt: Option<f64>,
6749	#[cfg_attr( feature = "derive_serde", serde(rename = "NEQAmt", skip_serializing_if = "Option::is_none") )]
6750	pub neq_amt: Option<f64>,
6751}
6752
6753impl ImpliedCurrencyAmountRange1Choice {
6754	pub fn validate(&self) -> Result<(), ValidationError> {
6755		if let Some(ref val) = self.fr_amt { val.validate()? }
6756		if let Some(ref val) = self.to_amt { val.validate()? }
6757		if let Some(ref val) = self.fr_to_amt { val.validate()? }
6758		if let Some(ref val) = self.eq_amt {
6759			if *val < 0.000000 {
6760				return Err(ValidationError::new(1003, "eq_amt is less than the minimum value of 0.000000".to_string()));
6761			}
6762		}
6763		if let Some(ref val) = self.neq_amt {
6764			if *val < 0.000000 {
6765				return Err(ValidationError::new(1003, "neq_amt is less than the minimum value of 0.000000".to_string()));
6766			}
6767		}
6768		Ok(())
6769	}
6770}
6771
6772
6773// Instruction3Code ...
6774#[cfg_attr(feature = "derive_debug", derive(Debug))]
6775#[cfg_attr(feature = "derive_default", derive(Default))]
6776#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6777#[cfg_attr(feature = "derive_clone", derive(Clone))]
6778#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6779pub enum Instruction3Code {
6780	#[cfg_attr(feature = "derive_default", default)]
6781	#[cfg_attr( feature = "derive_serde", serde(rename = "CHQB") )]
6782	CodeCHQB,
6783	#[cfg_attr( feature = "derive_serde", serde(rename = "HOLD") )]
6784	CodeHOLD,
6785	#[cfg_attr( feature = "derive_serde", serde(rename = "PHOB") )]
6786	CodePHOB,
6787	#[cfg_attr( feature = "derive_serde", serde(rename = "TELB") )]
6788	CodeTELB,
6789}
6790
6791impl Instruction3Code {
6792	pub fn validate(&self) -> Result<(), ValidationError> {
6793		Ok(())
6794	}
6795}
6796
6797
6798// Instruction4Code ...
6799#[cfg_attr(feature = "derive_debug", derive(Debug))]
6800#[cfg_attr(feature = "derive_default", derive(Default))]
6801#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6802#[cfg_attr(feature = "derive_clone", derive(Clone))]
6803#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6804pub enum Instruction4Code {
6805	#[cfg_attr(feature = "derive_default", default)]
6806	#[cfg_attr( feature = "derive_serde", serde(rename = "PHOA") )]
6807	CodePHOA,
6808	#[cfg_attr( feature = "derive_serde", serde(rename = "TELA") )]
6809	CodeTELA,
6810}
6811
6812impl Instruction4Code {
6813	pub fn validate(&self) -> Result<(), ValidationError> {
6814		Ok(())
6815	}
6816}
6817
6818
6819// Instruction5Code ...
6820#[cfg_attr(feature = "derive_debug", derive(Debug))]
6821#[cfg_attr(feature = "derive_default", derive(Default))]
6822#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6823#[cfg_attr(feature = "derive_clone", derive(Clone))]
6824#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6825pub enum Instruction5Code {
6826	#[cfg_attr(feature = "derive_default", default)]
6827	#[cfg_attr( feature = "derive_serde", serde(rename = "PHOB") )]
6828	CodePHOB,
6829	#[cfg_attr( feature = "derive_serde", serde(rename = "TELB") )]
6830	CodeTELB,
6831}
6832
6833impl Instruction5Code {
6834	pub fn validate(&self) -> Result<(), ValidationError> {
6835		Ok(())
6836	}
6837}
6838
6839
6840// InstructionForCreditorAgent1 ...
6841#[cfg_attr(feature = "derive_debug", derive(Debug))]
6842#[cfg_attr(feature = "derive_default", derive(Default))]
6843#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6844#[cfg_attr(feature = "derive_clone", derive(Clone))]
6845#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6846pub struct InstructionForCreditorAgent1 {
6847	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
6848	pub cd: Option<Instruction3Code>,
6849	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrInf", skip_serializing_if = "Option::is_none") )]
6850	pub instr_inf: Option<String>,
6851}
6852
6853impl InstructionForCreditorAgent1 {
6854	pub fn validate(&self) -> Result<(), ValidationError> {
6855		if let Some(ref val) = self.cd { val.validate()? }
6856		if let Some(ref val) = self.instr_inf {
6857			if val.chars().count() < 1 {
6858				return Err(ValidationError::new(1001, "instr_inf is shorter than the minimum length of 1".to_string()));
6859			}
6860			if val.chars().count() > 140 {
6861				return Err(ValidationError::new(1002, "instr_inf exceeds the maximum length of 140".to_string()));
6862			}
6863		}
6864		Ok(())
6865	}
6866}
6867
6868
6869// InstructionForCreditorAgent2 ...
6870#[cfg_attr(feature = "derive_debug", derive(Debug))]
6871#[cfg_attr(feature = "derive_default", derive(Default))]
6872#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6873#[cfg_attr(feature = "derive_clone", derive(Clone))]
6874#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6875pub struct InstructionForCreditorAgent2 {
6876	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
6877	pub cd: Option<Instruction5Code>,
6878	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrInf", skip_serializing_if = "Option::is_none") )]
6879	pub instr_inf: Option<String>,
6880}
6881
6882impl InstructionForCreditorAgent2 {
6883	pub fn validate(&self) -> Result<(), ValidationError> {
6884		if let Some(ref val) = self.cd { val.validate()? }
6885		if let Some(ref val) = self.instr_inf {
6886			if val.chars().count() < 1 {
6887				return Err(ValidationError::new(1001, "instr_inf is shorter than the minimum length of 1".to_string()));
6888			}
6889			if val.chars().count() > 140 {
6890				return Err(ValidationError::new(1002, "instr_inf exceeds the maximum length of 140".to_string()));
6891			}
6892		}
6893		Ok(())
6894	}
6895}
6896
6897
6898// InstructionForCreditorAgent3 ...
6899#[cfg_attr(feature = "derive_debug", derive(Debug))]
6900#[cfg_attr(feature = "derive_default", derive(Default))]
6901#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6902#[cfg_attr(feature = "derive_clone", derive(Clone))]
6903#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6904pub struct InstructionForCreditorAgent3 {
6905	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
6906	pub cd: Option<String>,
6907	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrInf", skip_serializing_if = "Option::is_none") )]
6908	pub instr_inf: Option<String>,
6909}
6910
6911impl InstructionForCreditorAgent3 {
6912	pub fn validate(&self) -> Result<(), ValidationError> {
6913		if let Some(ref val) = self.cd {
6914			if val.chars().count() < 1 {
6915				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
6916			}
6917			if val.chars().count() > 4 {
6918				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
6919			}
6920		}
6921		if let Some(ref val) = self.instr_inf {
6922			if val.chars().count() < 1 {
6923				return Err(ValidationError::new(1001, "instr_inf is shorter than the minimum length of 1".to_string()));
6924			}
6925			if val.chars().count() > 140 {
6926				return Err(ValidationError::new(1002, "instr_inf exceeds the maximum length of 140".to_string()));
6927			}
6928		}
6929		Ok(())
6930	}
6931}
6932
6933
6934// InstructionForNextAgent1 ...
6935#[cfg_attr(feature = "derive_debug", derive(Debug))]
6936#[cfg_attr(feature = "derive_default", derive(Default))]
6937#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6938#[cfg_attr(feature = "derive_clone", derive(Clone))]
6939#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6940pub struct InstructionForNextAgent1 {
6941	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
6942	pub cd: Option<Instruction4Code>,
6943	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrInf", skip_serializing_if = "Option::is_none") )]
6944	pub instr_inf: Option<String>,
6945}
6946
6947impl InstructionForNextAgent1 {
6948	pub fn validate(&self) -> Result<(), ValidationError> {
6949		if let Some(ref val) = self.cd { val.validate()? }
6950		if let Some(ref val) = self.instr_inf {
6951			if val.chars().count() < 1 {
6952				return Err(ValidationError::new(1001, "instr_inf is shorter than the minimum length of 1".to_string()));
6953			}
6954			if val.chars().count() > 140 {
6955				return Err(ValidationError::new(1002, "instr_inf exceeds the maximum length of 140".to_string()));
6956			}
6957		}
6958		Ok(())
6959	}
6960}
6961
6962
6963// InterestRecord2 ...
6964#[cfg_attr(feature = "derive_debug", derive(Debug))]
6965#[cfg_attr(feature = "derive_default", derive(Default))]
6966#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
6967#[cfg_attr(feature = "derive_clone", derive(Clone))]
6968#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
6969pub struct InterestRecord2 {
6970	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
6971	pub amt: ActiveOrHistoricCurrencyAndAmount,
6972	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
6973	pub cdt_dbt_ind: CreditDebitCode,
6974	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
6975	pub tp: Option<InterestType1Choice>,
6976	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
6977	pub rate: Option<Rate4>,
6978	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt", skip_serializing_if = "Option::is_none") )]
6979	pub fr_to_dt: Option<DateTimePeriod1>,
6980	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
6981	pub rsn: Option<String>,
6982	#[cfg_attr( feature = "derive_serde", serde(rename = "Tax", skip_serializing_if = "Option::is_none") )]
6983	pub tax: Option<TaxCharges2>,
6984}
6985
6986impl InterestRecord2 {
6987	pub fn validate(&self) -> Result<(), ValidationError> {
6988		self.amt.validate()?;
6989		self.cdt_dbt_ind.validate()?;
6990		if let Some(ref val) = self.tp { val.validate()? }
6991		if let Some(ref val) = self.rate { val.validate()? }
6992		if let Some(ref val) = self.fr_to_dt { val.validate()? }
6993		if let Some(ref val) = self.rsn {
6994			if val.chars().count() < 1 {
6995				return Err(ValidationError::new(1001, "rsn is shorter than the minimum length of 1".to_string()));
6996			}
6997			if val.chars().count() > 35 {
6998				return Err(ValidationError::new(1002, "rsn exceeds the maximum length of 35".to_string()));
6999			}
7000		}
7001		if let Some(ref val) = self.tax { val.validate()? }
7002		Ok(())
7003	}
7004}
7005
7006
7007// InterestType1Choice ...
7008#[cfg_attr(feature = "derive_debug", derive(Debug))]
7009#[cfg_attr(feature = "derive_default", derive(Default))]
7010#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7011#[cfg_attr(feature = "derive_clone", derive(Clone))]
7012#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7013pub struct InterestType1Choice {
7014	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7015	pub cd: Option<InterestType1Code>,
7016	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7017	pub prtry: Option<String>,
7018}
7019
7020impl InterestType1Choice {
7021	pub fn validate(&self) -> Result<(), ValidationError> {
7022		if let Some(ref val) = self.cd { val.validate()? }
7023		if let Some(ref val) = self.prtry {
7024			if val.chars().count() < 1 {
7025				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7026			}
7027			if val.chars().count() > 35 {
7028				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
7029			}
7030		}
7031		Ok(())
7032	}
7033}
7034
7035
7036// InterestType1Code ...
7037#[cfg_attr(feature = "derive_debug", derive(Debug))]
7038#[cfg_attr(feature = "derive_default", derive(Default))]
7039#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7040#[cfg_attr(feature = "derive_clone", derive(Clone))]
7041#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7042pub enum InterestType1Code {
7043	#[cfg_attr(feature = "derive_default", default)]
7044	#[cfg_attr( feature = "derive_serde", serde(rename = "INDY") )]
7045	CodeINDY,
7046	#[cfg_attr( feature = "derive_serde", serde(rename = "OVRN") )]
7047	CodeOVRN,
7048}
7049
7050impl InterestType1Code {
7051	pub fn validate(&self) -> Result<(), ValidationError> {
7052		Ok(())
7053	}
7054}
7055
7056
7057// InvestigationStatus5Choice ...
7058#[cfg_attr(feature = "derive_debug", derive(Debug))]
7059#[cfg_attr(feature = "derive_default", derive(Default))]
7060#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7061#[cfg_attr(feature = "derive_clone", derive(Clone))]
7062#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7063pub struct InvestigationStatus5Choice {
7064	#[cfg_attr( feature = "derive_serde", serde(rename = "Conf", skip_serializing_if = "Option::is_none") )]
7065	pub conf: Option<String>,
7066	#[cfg_attr( feature = "derive_serde", serde(rename = "RjctdMod", skip_serializing_if = "Option::is_none") )]
7067	pub rjctd_mod: Option<Vec<ModificationStatusReason1Choice>>,
7068	#[cfg_attr( feature = "derive_serde", serde(rename = "DplctOf", skip_serializing_if = "Option::is_none") )]
7069	pub dplct_of: Option<Case5>,
7070	#[cfg_attr( feature = "derive_serde", serde(rename = "AssgnmtCxlConf", skip_serializing_if = "Option::is_none") )]
7071	pub assgnmt_cxl_conf: Option<bool>,
7072}
7073
7074impl InvestigationStatus5Choice {
7075	pub fn validate(&self) -> Result<(), ValidationError> {
7076		if let Some(ref val) = self.conf {
7077			if val.chars().count() < 1 {
7078				return Err(ValidationError::new(1001, "conf is shorter than the minimum length of 1".to_string()));
7079			}
7080			if val.chars().count() > 4 {
7081				return Err(ValidationError::new(1002, "conf exceeds the maximum length of 4".to_string()));
7082			}
7083		}
7084		if let Some(ref vec) = self.rjctd_mod { for item in vec { item.validate()? } }
7085		if let Some(ref val) = self.dplct_of { val.validate()? }
7086		Ok(())
7087	}
7088}
7089
7090
7091// Limit2 ...
7092#[cfg_attr(feature = "derive_debug", derive(Debug))]
7093#[cfg_attr(feature = "derive_default", derive(Default))]
7094#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7095#[cfg_attr(feature = "derive_clone", derive(Clone))]
7096#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7097pub struct Limit2 {
7098	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
7099	pub amt: ActiveOrHistoricCurrencyAndAmount,
7100	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
7101	pub cdt_dbt_ind: FloorLimitType1Code,
7102}
7103
7104impl Limit2 {
7105	pub fn validate(&self) -> Result<(), ValidationError> {
7106		self.amt.validate()?;
7107		self.cdt_dbt_ind.validate()?;
7108		Ok(())
7109	}
7110}
7111
7112
7113// LocalInstrument2Choice ...
7114#[cfg_attr(feature = "derive_debug", derive(Debug))]
7115#[cfg_attr(feature = "derive_default", derive(Default))]
7116#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7117#[cfg_attr(feature = "derive_clone", derive(Clone))]
7118#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7119pub struct LocalInstrument2Choice {
7120	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7121	pub cd: Option<String>,
7122	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7123	pub prtry: Option<String>,
7124}
7125
7126impl LocalInstrument2Choice {
7127	pub fn validate(&self) -> Result<(), ValidationError> {
7128		if let Some(ref val) = self.cd {
7129			if val.chars().count() < 1 {
7130				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
7131			}
7132			if val.chars().count() > 35 {
7133				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 35".to_string()));
7134			}
7135		}
7136		if let Some(ref val) = self.prtry {
7137			if val.chars().count() < 1 {
7138				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7139			}
7140			if val.chars().count() > 35 {
7141				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
7142			}
7143		}
7144		Ok(())
7145	}
7146}
7147
7148
7149// MandateClassification1Choice ...
7150#[cfg_attr(feature = "derive_debug", derive(Debug))]
7151#[cfg_attr(feature = "derive_default", derive(Default))]
7152#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7153#[cfg_attr(feature = "derive_clone", derive(Clone))]
7154#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7155pub struct MandateClassification1Choice {
7156	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7157	pub cd: Option<MandateClassification1Code>,
7158	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7159	pub prtry: Option<String>,
7160}
7161
7162impl MandateClassification1Choice {
7163	pub fn validate(&self) -> Result<(), ValidationError> {
7164		if let Some(ref val) = self.cd { val.validate()? }
7165		if let Some(ref val) = self.prtry {
7166			if val.chars().count() < 1 {
7167				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7168			}
7169			if val.chars().count() > 35 {
7170				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
7171			}
7172		}
7173		Ok(())
7174	}
7175}
7176
7177
7178// MandateClassification1Code ...
7179#[cfg_attr(feature = "derive_debug", derive(Debug))]
7180#[cfg_attr(feature = "derive_default", derive(Default))]
7181#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7182#[cfg_attr(feature = "derive_clone", derive(Clone))]
7183#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7184pub enum MandateClassification1Code {
7185	#[cfg_attr(feature = "derive_default", default)]
7186	#[cfg_attr( feature = "derive_serde", serde(rename = "FIXE") )]
7187	CodeFIXE,
7188	#[cfg_attr( feature = "derive_serde", serde(rename = "USGB") )]
7189	CodeUSGB,
7190	#[cfg_attr( feature = "derive_serde", serde(rename = "VARI") )]
7191	CodeVARI,
7192}
7193
7194impl MandateClassification1Code {
7195	pub fn validate(&self) -> Result<(), ValidationError> {
7196		Ok(())
7197	}
7198}
7199
7200
7201// MandateRelatedData1Choice ...
7202#[cfg_attr(feature = "derive_debug", derive(Debug))]
7203#[cfg_attr(feature = "derive_default", derive(Default))]
7204#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7205#[cfg_attr(feature = "derive_clone", derive(Clone))]
7206#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7207pub struct MandateRelatedData1Choice {
7208	#[cfg_attr( feature = "derive_serde", serde(rename = "DrctDbtMndt", skip_serializing_if = "Option::is_none") )]
7209	pub drct_dbt_mndt: Option<MandateRelatedInformation14>,
7210	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtTrfMndt", skip_serializing_if = "Option::is_none") )]
7211	pub cdt_trf_mndt: Option<CreditTransferMandateData1>,
7212}
7213
7214impl MandateRelatedData1Choice {
7215	pub fn validate(&self) -> Result<(), ValidationError> {
7216		if let Some(ref val) = self.drct_dbt_mndt { val.validate()? }
7217		if let Some(ref val) = self.cdt_trf_mndt { val.validate()? }
7218		Ok(())
7219	}
7220}
7221
7222
7223// MandateRelatedInformation14 ...
7224#[cfg_attr(feature = "derive_debug", derive(Debug))]
7225#[cfg_attr(feature = "derive_default", derive(Default))]
7226#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7227#[cfg_attr(feature = "derive_clone", derive(Clone))]
7228#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7229pub struct MandateRelatedInformation14 {
7230	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtId", skip_serializing_if = "Option::is_none") )]
7231	pub mndt_id: Option<String>,
7232	#[cfg_attr( feature = "derive_serde", serde(rename = "DtOfSgntr", skip_serializing_if = "Option::is_none") )]
7233	pub dt_of_sgntr: Option<String>,
7234	#[cfg_attr( feature = "derive_serde", serde(rename = "AmdmntInd", skip_serializing_if = "Option::is_none") )]
7235	pub amdmnt_ind: Option<bool>,
7236	#[cfg_attr( feature = "derive_serde", serde(rename = "AmdmntInfDtls", skip_serializing_if = "Option::is_none") )]
7237	pub amdmnt_inf_dtls: Option<AmendmentInformationDetails13>,
7238	#[cfg_attr( feature = "derive_serde", serde(rename = "ElctrncSgntr", skip_serializing_if = "Option::is_none") )]
7239	pub elctrnc_sgntr: Option<String>,
7240	#[cfg_attr( feature = "derive_serde", serde(rename = "FrstColltnDt", skip_serializing_if = "Option::is_none") )]
7241	pub frst_colltn_dt: Option<String>,
7242	#[cfg_attr( feature = "derive_serde", serde(rename = "FnlColltnDt", skip_serializing_if = "Option::is_none") )]
7243	pub fnl_colltn_dt: Option<String>,
7244	#[cfg_attr( feature = "derive_serde", serde(rename = "Frqcy", skip_serializing_if = "Option::is_none") )]
7245	pub frqcy: Option<Frequency36Choice>,
7246	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
7247	pub rsn: Option<MandateSetupReason1Choice>,
7248	#[cfg_attr( feature = "derive_serde", serde(rename = "TrckgDays", skip_serializing_if = "Option::is_none") )]
7249	pub trckg_days: Option<String>,
7250}
7251
7252impl MandateRelatedInformation14 {
7253	pub fn validate(&self) -> Result<(), ValidationError> {
7254		if let Some(ref val) = self.mndt_id {
7255			if val.chars().count() < 1 {
7256				return Err(ValidationError::new(1001, "mndt_id is shorter than the minimum length of 1".to_string()));
7257			}
7258			if val.chars().count() > 35 {
7259				return Err(ValidationError::new(1002, "mndt_id exceeds the maximum length of 35".to_string()));
7260			}
7261		}
7262		if let Some(ref val) = self.amdmnt_inf_dtls { val.validate()? }
7263		if let Some(ref val) = self.elctrnc_sgntr {
7264			if val.chars().count() < 1 {
7265				return Err(ValidationError::new(1001, "elctrnc_sgntr is shorter than the minimum length of 1".to_string()));
7266			}
7267			if val.chars().count() > 1025 {
7268				return Err(ValidationError::new(1002, "elctrnc_sgntr exceeds the maximum length of 1025".to_string()));
7269			}
7270		}
7271		if let Some(ref val) = self.frqcy { val.validate()? }
7272		if let Some(ref val) = self.rsn { val.validate()? }
7273		if let Some(ref val) = self.trckg_days {
7274			let pattern = Regex::new("[0-9]{2}").unwrap();
7275			if !pattern.is_match(val) {
7276				return Err(ValidationError::new(1005, "trckg_days does not match the required pattern".to_string()));
7277			}
7278		}
7279		Ok(())
7280	}
7281}
7282
7283
7284// MandateSetupReason1Choice ...
7285#[cfg_attr(feature = "derive_debug", derive(Debug))]
7286#[cfg_attr(feature = "derive_default", derive(Default))]
7287#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7288#[cfg_attr(feature = "derive_clone", derive(Clone))]
7289#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7290pub struct MandateSetupReason1Choice {
7291	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7292	pub cd: Option<String>,
7293	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7294	pub prtry: Option<String>,
7295}
7296
7297impl MandateSetupReason1Choice {
7298	pub fn validate(&self) -> Result<(), ValidationError> {
7299		if let Some(ref val) = self.cd {
7300			if val.chars().count() < 1 {
7301				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
7302			}
7303			if val.chars().count() > 4 {
7304				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
7305			}
7306		}
7307		if let Some(ref val) = self.prtry {
7308			if val.chars().count() < 1 {
7309				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7310			}
7311			if val.chars().count() > 70 {
7312				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 70".to_string()));
7313			}
7314		}
7315		Ok(())
7316	}
7317}
7318
7319
7320// MandateTypeInformation2 ...
7321#[cfg_attr(feature = "derive_debug", derive(Debug))]
7322#[cfg_attr(feature = "derive_default", derive(Default))]
7323#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7324#[cfg_attr(feature = "derive_clone", derive(Clone))]
7325#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7326pub struct MandateTypeInformation2 {
7327	#[cfg_attr( feature = "derive_serde", serde(rename = "SvcLvl", skip_serializing_if = "Option::is_none") )]
7328	pub svc_lvl: Option<ServiceLevel8Choice>,
7329	#[cfg_attr( feature = "derive_serde", serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none") )]
7330	pub lcl_instrm: Option<LocalInstrument2Choice>,
7331	#[cfg_attr( feature = "derive_serde", serde(rename = "CtgyPurp", skip_serializing_if = "Option::is_none") )]
7332	pub ctgy_purp: Option<CategoryPurpose1Choice>,
7333	#[cfg_attr( feature = "derive_serde", serde(rename = "Clssfctn", skip_serializing_if = "Option::is_none") )]
7334	pub clssfctn: Option<MandateClassification1Choice>,
7335}
7336
7337impl MandateTypeInformation2 {
7338	pub fn validate(&self) -> Result<(), ValidationError> {
7339		if let Some(ref val) = self.svc_lvl { val.validate()? }
7340		if let Some(ref val) = self.lcl_instrm { val.validate()? }
7341		if let Some(ref val) = self.ctgy_purp { val.validate()? }
7342		if let Some(ref val) = self.clssfctn { val.validate()? }
7343		Ok(())
7344	}
7345}
7346
7347
7348// MessageHeader10 ...
7349#[cfg_attr(feature = "derive_debug", derive(Debug))]
7350#[cfg_attr(feature = "derive_default", derive(Default))]
7351#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7352#[cfg_attr(feature = "derive_clone", derive(Clone))]
7353#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7354pub struct MessageHeader10 {
7355	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
7356	pub msg_id: String,
7357	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
7358	pub cre_dt_tm: Option<String>,
7359	#[cfg_attr( feature = "derive_serde", serde(rename = "QryNm", skip_serializing_if = "Option::is_none") )]
7360	pub qry_nm: Option<String>,
7361}
7362
7363impl MessageHeader10 {
7364	pub fn validate(&self) -> Result<(), ValidationError> {
7365		if self.msg_id.chars().count() < 1 {
7366			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
7367		}
7368		if self.msg_id.chars().count() > 35 {
7369			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
7370		}
7371		if let Some(ref val) = self.qry_nm {
7372			if val.chars().count() < 1 {
7373				return Err(ValidationError::new(1001, "qry_nm is shorter than the minimum length of 1".to_string()));
7374			}
7375			if val.chars().count() > 35 {
7376				return Err(ValidationError::new(1002, "qry_nm exceeds the maximum length of 35".to_string()));
7377			}
7378		}
7379		Ok(())
7380	}
7381}
7382
7383
7384// MessageHeader7 ...
7385#[cfg_attr(feature = "derive_debug", derive(Debug))]
7386#[cfg_attr(feature = "derive_default", derive(Default))]
7387#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7388#[cfg_attr(feature = "derive_clone", derive(Clone))]
7389#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7390pub struct MessageHeader7 {
7391	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
7392	pub msg_id: String,
7393	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
7394	pub cre_dt_tm: Option<String>,
7395	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqTp", skip_serializing_if = "Option::is_none") )]
7396	pub req_tp: Option<RequestType4Choice>,
7397	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlBizQry", skip_serializing_if = "Option::is_none") )]
7398	pub orgnl_biz_qry: Option<OriginalBusinessQuery1>,
7399	#[cfg_attr( feature = "derive_serde", serde(rename = "QryNm", skip_serializing_if = "Option::is_none") )]
7400	pub qry_nm: Option<String>,
7401}
7402
7403impl MessageHeader7 {
7404	pub fn validate(&self) -> Result<(), ValidationError> {
7405		if self.msg_id.chars().count() < 1 {
7406			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
7407		}
7408		if self.msg_id.chars().count() > 35 {
7409			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
7410		}
7411		if let Some(ref val) = self.req_tp { val.validate()? }
7412		if let Some(ref val) = self.orgnl_biz_qry { val.validate()? }
7413		if let Some(ref val) = self.qry_nm {
7414			if val.chars().count() < 1 {
7415				return Err(ValidationError::new(1001, "qry_nm is shorter than the minimum length of 1".to_string()));
7416			}
7417			if val.chars().count() > 35 {
7418				return Err(ValidationError::new(1002, "qry_nm exceeds the maximum length of 35".to_string()));
7419			}
7420		}
7421		Ok(())
7422	}
7423}
7424
7425
7426// MessageIdentification2 ...
7427#[cfg_attr(feature = "derive_debug", derive(Debug))]
7428#[cfg_attr(feature = "derive_default", derive(Default))]
7429#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7430#[cfg_attr(feature = "derive_clone", derive(Clone))]
7431#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7432pub struct MessageIdentification2 {
7433	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgNmId", skip_serializing_if = "Option::is_none") )]
7434	pub msg_nm_id: Option<String>,
7435	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId", skip_serializing_if = "Option::is_none") )]
7436	pub msg_id: Option<String>,
7437}
7438
7439impl MessageIdentification2 {
7440	pub fn validate(&self) -> Result<(), ValidationError> {
7441		if let Some(ref val) = self.msg_nm_id {
7442			if val.chars().count() < 1 {
7443				return Err(ValidationError::new(1001, "msg_nm_id is shorter than the minimum length of 1".to_string()));
7444			}
7445			if val.chars().count() > 35 {
7446				return Err(ValidationError::new(1002, "msg_nm_id exceeds the maximum length of 35".to_string()));
7447			}
7448		}
7449		if let Some(ref val) = self.msg_id {
7450			if val.chars().count() < 1 {
7451				return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
7452			}
7453			if val.chars().count() > 35 {
7454				return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
7455			}
7456		}
7457		Ok(())
7458	}
7459}
7460
7461
7462// MessageReference ...
7463#[cfg_attr(feature = "derive_debug", derive(Debug))]
7464#[cfg_attr(feature = "derive_default", derive(Default))]
7465#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7466#[cfg_attr(feature = "derive_clone", derive(Clone))]
7467#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7468pub struct MessageReference {
7469	#[cfg_attr( feature = "derive_serde", serde(rename = "Ref") )]
7470	pub ref_attr: String,
7471}
7472
7473impl MessageReference {
7474	pub fn validate(&self) -> Result<(), ValidationError> {
7475		if self.ref_attr.chars().count() < 1 {
7476			return Err(ValidationError::new(1001, "ref_attr is shorter than the minimum length of 1".to_string()));
7477		}
7478		if self.ref_attr.chars().count() > 35 {
7479			return Err(ValidationError::new(1002, "ref_attr exceeds the maximum length of 35".to_string()));
7480		}
7481		Ok(())
7482	}
7483}
7484
7485
7486// MessageReference1 ...
7487#[cfg_attr(feature = "derive_debug", derive(Debug))]
7488#[cfg_attr(feature = "derive_default", derive(Default))]
7489#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7490#[cfg_attr(feature = "derive_clone", derive(Clone))]
7491#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7492pub struct MessageReference1 {
7493	#[cfg_attr( feature = "derive_serde", serde(rename = "Ref") )]
7494	pub ref_attr: String,
7495	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgNm", skip_serializing_if = "Option::is_none") )]
7496	pub msg_nm: Option<String>,
7497	#[cfg_attr( feature = "derive_serde", serde(rename = "RefIssr", skip_serializing_if = "Option::is_none") )]
7498	pub ref_issr: Option<PartyIdentification136>,
7499}
7500
7501impl MessageReference1 {
7502	pub fn validate(&self) -> Result<(), ValidationError> {
7503		if self.ref_attr.chars().count() < 1 {
7504			return Err(ValidationError::new(1001, "ref_attr is shorter than the minimum length of 1".to_string()));
7505		}
7506		if self.ref_attr.chars().count() > 35 {
7507			return Err(ValidationError::new(1002, "ref_attr exceeds the maximum length of 35".to_string()));
7508		}
7509		if let Some(ref val) = self.msg_nm {
7510			if val.chars().count() < 1 {
7511				return Err(ValidationError::new(1001, "msg_nm is shorter than the minimum length of 1".to_string()));
7512			}
7513			if val.chars().count() > 35 {
7514				return Err(ValidationError::new(1002, "msg_nm exceeds the maximum length of 35".to_string()));
7515			}
7516		}
7517		if let Some(ref val) = self.ref_issr { val.validate()? }
7518		Ok(())
7519	}
7520}
7521
7522
7523// MissingOrIncorrectInformation3 ...
7524#[cfg_attr(feature = "derive_debug", derive(Debug))]
7525#[cfg_attr(feature = "derive_default", derive(Default))]
7526#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7527#[cfg_attr(feature = "derive_clone", derive(Clone))]
7528#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7529pub struct MissingOrIncorrectInformation3 {
7530	#[cfg_attr( feature = "derive_serde", serde(rename = "AMLReq", skip_serializing_if = "Option::is_none") )]
7531	pub aml_req: Option<bool>,
7532	#[cfg_attr( feature = "derive_serde", serde(rename = "MssngInf", skip_serializing_if = "Option::is_none") )]
7533	pub mssng_inf: Option<Vec<UnableToApplyMissing1>>,
7534	#[cfg_attr( feature = "derive_serde", serde(rename = "IncrrctInf", skip_serializing_if = "Option::is_none") )]
7535	pub incrrct_inf: Option<Vec<UnableToApplyIncorrect1>>,
7536}
7537
7538impl MissingOrIncorrectInformation3 {
7539	pub fn validate(&self) -> Result<(), ValidationError> {
7540		if let Some(ref vec) = self.mssng_inf { for item in vec { item.validate()? } }
7541		if let Some(ref vec) = self.incrrct_inf { for item in vec { item.validate()? } }
7542		Ok(())
7543	}
7544}
7545
7546
7547// ModificationStatusReason1Choice ...
7548#[cfg_attr(feature = "derive_debug", derive(Debug))]
7549#[cfg_attr(feature = "derive_default", derive(Default))]
7550#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7551#[cfg_attr(feature = "derive_clone", derive(Clone))]
7552#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7553pub struct ModificationStatusReason1Choice {
7554	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7555	pub cd: Option<String>,
7556	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7557	pub prtry: Option<String>,
7558}
7559
7560impl ModificationStatusReason1Choice {
7561	pub fn validate(&self) -> Result<(), ValidationError> {
7562		if let Some(ref val) = self.cd {
7563			if val.chars().count() < 1 {
7564				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
7565			}
7566			if val.chars().count() > 4 {
7567				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
7568			}
7569		}
7570		if let Some(ref val) = self.prtry {
7571			if val.chars().count() < 1 {
7572				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7573			}
7574			if val.chars().count() > 35 {
7575				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
7576			}
7577		}
7578		Ok(())
7579	}
7580}
7581
7582
7583// ModificationStatusReason2 ...
7584#[cfg_attr(feature = "derive_debug", derive(Debug))]
7585#[cfg_attr(feature = "derive_default", derive(Default))]
7586#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7587#[cfg_attr(feature = "derive_clone", derive(Clone))]
7588#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7589pub struct ModificationStatusReason2 {
7590	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
7591	pub orgtr: Option<PartyIdentification135>,
7592	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
7593	pub rsn: Option<ModificationStatusReason1Choice>,
7594	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
7595	pub addtl_inf: Option<Vec<String>>,
7596}
7597
7598impl ModificationStatusReason2 {
7599	pub fn validate(&self) -> Result<(), ValidationError> {
7600		if let Some(ref val) = self.orgtr { val.validate()? }
7601		if let Some(ref val) = self.rsn { val.validate()? }
7602		if let Some(ref vec) = self.addtl_inf {
7603			for item in vec {
7604				if item.chars().count() < 1 {
7605					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
7606				}
7607				if item.chars().count() > 105 {
7608					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
7609				}
7610			}
7611		}
7612		Ok(())
7613	}
7614}
7615
7616
7617// NameAndAddress16 ...
7618#[cfg_attr(feature = "derive_debug", derive(Debug))]
7619#[cfg_attr(feature = "derive_default", derive(Default))]
7620#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7621#[cfg_attr(feature = "derive_clone", derive(Clone))]
7622#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7623pub struct NameAndAddress16 {
7624	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm") )]
7625	pub nm: String,
7626	#[cfg_attr( feature = "derive_serde", serde(rename = "Adr") )]
7627	pub adr: PostalAddress24,
7628}
7629
7630impl NameAndAddress16 {
7631	pub fn validate(&self) -> Result<(), ValidationError> {
7632		if self.nm.chars().count() < 1 {
7633			return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
7634		}
7635		if self.nm.chars().count() > 140 {
7636			return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
7637		}
7638		self.adr.validate()?;
7639		Ok(())
7640	}
7641}
7642
7643
7644// NameAndAddress5 ...
7645#[cfg_attr(feature = "derive_debug", derive(Debug))]
7646#[cfg_attr(feature = "derive_default", derive(Default))]
7647#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7648#[cfg_attr(feature = "derive_clone", derive(Clone))]
7649#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7650pub struct NameAndAddress5 {
7651	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm") )]
7652	pub nm: String,
7653	#[cfg_attr( feature = "derive_serde", serde(rename = "Adr", skip_serializing_if = "Option::is_none") )]
7654	pub adr: Option<PostalAddress1>,
7655}
7656
7657impl NameAndAddress5 {
7658	pub fn validate(&self) -> Result<(), ValidationError> {
7659		if self.nm.chars().count() < 1 {
7660			return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
7661		}
7662		if self.nm.chars().count() > 350 {
7663			return Err(ValidationError::new(1002, "nm exceeds the maximum length of 350".to_string()));
7664		}
7665		if let Some(ref val) = self.adr { val.validate()? }
7666		Ok(())
7667	}
7668}
7669
7670
7671// NamePrefix2Code ...
7672#[cfg_attr(feature = "derive_debug", derive(Debug))]
7673#[cfg_attr(feature = "derive_default", derive(Default))]
7674#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7675#[cfg_attr(feature = "derive_clone", derive(Clone))]
7676#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7677pub enum NamePrefix2Code {
7678	#[cfg_attr(feature = "derive_default", default)]
7679	#[cfg_attr( feature = "derive_serde", serde(rename = "DOCT") )]
7680	CodeDOCT,
7681	#[cfg_attr( feature = "derive_serde", serde(rename = "MADM") )]
7682	CodeMADM,
7683	#[cfg_attr( feature = "derive_serde", serde(rename = "MISS") )]
7684	CodeMISS,
7685	#[cfg_attr( feature = "derive_serde", serde(rename = "MIST") )]
7686	CodeMIST,
7687	#[cfg_attr( feature = "derive_serde", serde(rename = "MIKS") )]
7688	CodeMIKS,
7689}
7690
7691impl NamePrefix2Code {
7692	pub fn validate(&self) -> Result<(), ValidationError> {
7693		Ok(())
7694	}
7695}
7696
7697
7698// NumberAndSumOfTransactions1 ...
7699#[cfg_attr(feature = "derive_debug", derive(Debug))]
7700#[cfg_attr(feature = "derive_default", derive(Default))]
7701#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7702#[cfg_attr(feature = "derive_clone", derive(Clone))]
7703#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7704pub struct NumberAndSumOfTransactions1 {
7705	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfNtries", skip_serializing_if = "Option::is_none") )]
7706	pub nb_of_ntries: Option<String>,
7707	#[cfg_attr( feature = "derive_serde", serde(rename = "Sum", skip_serializing_if = "Option::is_none") )]
7708	pub sum: Option<f64>,
7709}
7710
7711impl NumberAndSumOfTransactions1 {
7712	pub fn validate(&self) -> Result<(), ValidationError> {
7713		if let Some(ref val) = self.nb_of_ntries {
7714			let pattern = Regex::new("[0-9]{1,15}").unwrap();
7715			if !pattern.is_match(val) {
7716				return Err(ValidationError::new(1005, "nb_of_ntries does not match the required pattern".to_string()));
7717			}
7718		}
7719		Ok(())
7720	}
7721}
7722
7723
7724// NumberAndSumOfTransactions4 ...
7725#[cfg_attr(feature = "derive_debug", derive(Debug))]
7726#[cfg_attr(feature = "derive_default", derive(Default))]
7727#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7728#[cfg_attr(feature = "derive_clone", derive(Clone))]
7729#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7730pub struct NumberAndSumOfTransactions4 {
7731	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfNtries", skip_serializing_if = "Option::is_none") )]
7732	pub nb_of_ntries: Option<String>,
7733	#[cfg_attr( feature = "derive_serde", serde(rename = "Sum", skip_serializing_if = "Option::is_none") )]
7734	pub sum: Option<f64>,
7735	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlNetNtry", skip_serializing_if = "Option::is_none") )]
7736	pub ttl_net_ntry: Option<AmountAndDirection35>,
7737}
7738
7739impl NumberAndSumOfTransactions4 {
7740	pub fn validate(&self) -> Result<(), ValidationError> {
7741		if let Some(ref val) = self.nb_of_ntries {
7742			let pattern = Regex::new("[0-9]{1,15}").unwrap();
7743			if !pattern.is_match(val) {
7744				return Err(ValidationError::new(1005, "nb_of_ntries does not match the required pattern".to_string()));
7745			}
7746		}
7747		if let Some(ref val) = self.ttl_net_ntry { val.validate()? }
7748		Ok(())
7749	}
7750}
7751
7752
7753// NumberOfCancellationsPerStatus1 ...
7754#[cfg_attr(feature = "derive_debug", derive(Debug))]
7755#[cfg_attr(feature = "derive_default", derive(Default))]
7756#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7757#[cfg_attr(feature = "derive_clone", derive(Clone))]
7758#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7759pub struct NumberOfCancellationsPerStatus1 {
7760	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldNbOfTxs") )]
7761	pub dtld_nb_of_txs: String,
7762	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldSts") )]
7763	pub dtld_sts: CancellationIndividualStatus1Code,
7764	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldCtrlSum", skip_serializing_if = "Option::is_none") )]
7765	pub dtld_ctrl_sum: Option<f64>,
7766}
7767
7768impl NumberOfCancellationsPerStatus1 {
7769	pub fn validate(&self) -> Result<(), ValidationError> {
7770		let pattern = Regex::new("[0-9]{1,15}").unwrap();
7771		if !pattern.is_match(&self.dtld_nb_of_txs) {
7772			return Err(ValidationError::new(1005, "dtld_nb_of_txs does not match the required pattern".to_string()));
7773		}
7774		self.dtld_sts.validate()?;
7775		Ok(())
7776	}
7777}
7778
7779
7780// NumberOfTransactionsPerStatus1 ...
7781#[cfg_attr(feature = "derive_debug", derive(Debug))]
7782#[cfg_attr(feature = "derive_default", derive(Default))]
7783#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7784#[cfg_attr(feature = "derive_clone", derive(Clone))]
7785#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7786pub struct NumberOfTransactionsPerStatus1 {
7787	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldNbOfTxs") )]
7788	pub dtld_nb_of_txs: String,
7789	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldSts") )]
7790	pub dtld_sts: TransactionIndividualStatus1Code,
7791	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldCtrlSum", skip_serializing_if = "Option::is_none") )]
7792	pub dtld_ctrl_sum: Option<f64>,
7793}
7794
7795impl NumberOfTransactionsPerStatus1 {
7796	pub fn validate(&self) -> Result<(), ValidationError> {
7797		let pattern = Regex::new("[0-9]{1,15}").unwrap();
7798		if !pattern.is_match(&self.dtld_nb_of_txs) {
7799			return Err(ValidationError::new(1005, "dtld_nb_of_txs does not match the required pattern".to_string()));
7800		}
7801		self.dtld_sts.validate()?;
7802		Ok(())
7803	}
7804}
7805
7806
7807// NumberOfTransactionsPerStatus5 ...
7808#[cfg_attr(feature = "derive_debug", derive(Debug))]
7809#[cfg_attr(feature = "derive_default", derive(Default))]
7810#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7811#[cfg_attr(feature = "derive_clone", derive(Clone))]
7812#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7813pub struct NumberOfTransactionsPerStatus5 {
7814	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldNbOfTxs") )]
7815	pub dtld_nb_of_txs: String,
7816	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldSts") )]
7817	pub dtld_sts: String,
7818	#[cfg_attr( feature = "derive_serde", serde(rename = "DtldCtrlSum", skip_serializing_if = "Option::is_none") )]
7819	pub dtld_ctrl_sum: Option<f64>,
7820}
7821
7822impl NumberOfTransactionsPerStatus5 {
7823	pub fn validate(&self) -> Result<(), ValidationError> {
7824		let pattern = Regex::new("[0-9]{1,15}").unwrap();
7825		if !pattern.is_match(&self.dtld_nb_of_txs) {
7826			return Err(ValidationError::new(1005, "dtld_nb_of_txs does not match the required pattern".to_string()));
7827		}
7828		if self.dtld_sts.chars().count() < 1 {
7829			return Err(ValidationError::new(1001, "dtld_sts is shorter than the minimum length of 1".to_string()));
7830		}
7831		if self.dtld_sts.chars().count() > 4 {
7832			return Err(ValidationError::new(1002, "dtld_sts exceeds the maximum length of 4".to_string()));
7833		}
7834		Ok(())
7835	}
7836}
7837
7838
7839// OnLineCapability1Code ...
7840#[cfg_attr(feature = "derive_debug", derive(Debug))]
7841#[cfg_attr(feature = "derive_default", derive(Default))]
7842#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7843#[cfg_attr(feature = "derive_clone", derive(Clone))]
7844#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7845pub enum OnLineCapability1Code {
7846	#[cfg_attr(feature = "derive_default", default)]
7847	#[cfg_attr( feature = "derive_serde", serde(rename = "OFLN") )]
7848	CodeOFLN,
7849	#[cfg_attr( feature = "derive_serde", serde(rename = "ONLN") )]
7850	CodeONLN,
7851	#[cfg_attr( feature = "derive_serde", serde(rename = "SMON") )]
7852	CodeSMON,
7853}
7854
7855impl OnLineCapability1Code {
7856	pub fn validate(&self) -> Result<(), ValidationError> {
7857		Ok(())
7858	}
7859}
7860
7861
7862// OrganisationIdentification29 ...
7863#[cfg_attr(feature = "derive_debug", derive(Debug))]
7864#[cfg_attr(feature = "derive_default", derive(Default))]
7865#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7866#[cfg_attr(feature = "derive_clone", derive(Clone))]
7867#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7868pub struct OrganisationIdentification29 {
7869	#[cfg_attr( feature = "derive_serde", serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none") )]
7870	pub any_bic: Option<String>,
7871	#[cfg_attr( feature = "derive_serde", serde(rename = "LEI", skip_serializing_if = "Option::is_none") )]
7872	pub lei: Option<String>,
7873	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
7874	pub othr: Option<Vec<GenericOrganisationIdentification1>>,
7875}
7876
7877impl OrganisationIdentification29 {
7878	pub fn validate(&self) -> Result<(), ValidationError> {
7879		if let Some(ref val) = self.any_bic {
7880			let pattern = Regex::new("[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}").unwrap();
7881			if !pattern.is_match(val) {
7882				return Err(ValidationError::new(1005, "any_bic does not match the required pattern".to_string()));
7883			}
7884		}
7885		if let Some(ref val) = self.lei {
7886			let pattern = Regex::new("[A-Z0-9]{18,18}[0-9]{2,2}").unwrap();
7887			if !pattern.is_match(val) {
7888				return Err(ValidationError::new(1005, "lei does not match the required pattern".to_string()));
7889			}
7890		}
7891		if let Some(ref vec) = self.othr { for item in vec { item.validate()? } }
7892		Ok(())
7893	}
7894}
7895
7896
7897// OrganisationIdentificationSchemeName1Choice ...
7898#[cfg_attr(feature = "derive_debug", derive(Debug))]
7899#[cfg_attr(feature = "derive_default", derive(Default))]
7900#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7901#[cfg_attr(feature = "derive_clone", derive(Clone))]
7902#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7903pub struct OrganisationIdentificationSchemeName1Choice {
7904	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
7905	pub cd: Option<String>,
7906	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
7907	pub prtry: Option<String>,
7908}
7909
7910impl OrganisationIdentificationSchemeName1Choice {
7911	pub fn validate(&self) -> Result<(), ValidationError> {
7912		if let Some(ref val) = self.cd {
7913			if val.chars().count() < 1 {
7914				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
7915			}
7916			if val.chars().count() > 4 {
7917				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
7918			}
7919		}
7920		if let Some(ref val) = self.prtry {
7921			if val.chars().count() < 1 {
7922				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
7923			}
7924			if val.chars().count() > 35 {
7925				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
7926			}
7927		}
7928		Ok(())
7929	}
7930}
7931
7932
7933// OriginalAndCurrentQuantities1 ...
7934#[cfg_attr(feature = "derive_debug", derive(Debug))]
7935#[cfg_attr(feature = "derive_default", derive(Default))]
7936#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7937#[cfg_attr(feature = "derive_clone", derive(Clone))]
7938#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7939pub struct OriginalAndCurrentQuantities1 {
7940	#[cfg_attr( feature = "derive_serde", serde(rename = "FaceAmt") )]
7941	pub face_amt: f64,
7942	#[cfg_attr( feature = "derive_serde", serde(rename = "AmtsdVal") )]
7943	pub amtsd_val: f64,
7944}
7945
7946impl OriginalAndCurrentQuantities1 {
7947	pub fn validate(&self) -> Result<(), ValidationError> {
7948		Ok(())
7949	}
7950}
7951
7952
7953// OriginalBusinessQuery1 ...
7954#[cfg_attr(feature = "derive_debug", derive(Debug))]
7955#[cfg_attr(feature = "derive_default", derive(Default))]
7956#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7957#[cfg_attr(feature = "derive_clone", derive(Clone))]
7958#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7959pub struct OriginalBusinessQuery1 {
7960	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId") )]
7961	pub msg_id: String,
7962	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgNmId", skip_serializing_if = "Option::is_none") )]
7963	pub msg_nm_id: Option<String>,
7964	#[cfg_attr( feature = "derive_serde", serde(rename = "CreDtTm", skip_serializing_if = "Option::is_none") )]
7965	pub cre_dt_tm: Option<String>,
7966}
7967
7968impl OriginalBusinessQuery1 {
7969	pub fn validate(&self) -> Result<(), ValidationError> {
7970		if self.msg_id.chars().count() < 1 {
7971			return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
7972		}
7973		if self.msg_id.chars().count() > 35 {
7974			return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
7975		}
7976		if let Some(ref val) = self.msg_nm_id {
7977			if val.chars().count() < 1 {
7978				return Err(ValidationError::new(1001, "msg_nm_id is shorter than the minimum length of 1".to_string()));
7979			}
7980			if val.chars().count() > 35 {
7981				return Err(ValidationError::new(1002, "msg_nm_id exceeds the maximum length of 35".to_string()));
7982			}
7983		}
7984		Ok(())
7985	}
7986}
7987
7988
7989// OriginalGroupHeader14 ...
7990#[cfg_attr(feature = "derive_debug", derive(Debug))]
7991#[cfg_attr(feature = "derive_default", derive(Default))]
7992#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
7993#[cfg_attr(feature = "derive_clone", derive(Clone))]
7994#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
7995pub struct OriginalGroupHeader14 {
7996	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpCxlId", skip_serializing_if = "Option::is_none") )]
7997	pub orgnl_grp_cxl_id: Option<String>,
7998	#[cfg_attr( feature = "derive_serde", serde(rename = "RslvdCase", skip_serializing_if = "Option::is_none") )]
7999	pub rslvd_case: Option<Case5>,
8000	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8001	pub orgnl_msg_id: String,
8002	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8003	pub orgnl_msg_nm_id: String,
8004	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8005	pub orgnl_cre_dt_tm: Option<String>,
8006	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8007	pub orgnl_nb_of_txs: Option<String>,
8008	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8009	pub orgnl_ctrl_sum: Option<f64>,
8010	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpCxlSts", skip_serializing_if = "Option::is_none") )]
8011	pub grp_cxl_sts: Option<GroupCancellationStatus1Code>,
8012	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsRsnInf", skip_serializing_if = "Option::is_none") )]
8013	pub cxl_sts_rsn_inf: Option<Vec<CancellationStatusReason4>>,
8014	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxsPerCxlSts", skip_serializing_if = "Option::is_none") )]
8015	pub nb_of_txs_per_cxl_sts: Option<Vec<NumberOfTransactionsPerStatus1>>,
8016}
8017
8018impl OriginalGroupHeader14 {
8019	pub fn validate(&self) -> Result<(), ValidationError> {
8020		if let Some(ref val) = self.orgnl_grp_cxl_id {
8021			if val.chars().count() < 1 {
8022				return Err(ValidationError::new(1001, "orgnl_grp_cxl_id is shorter than the minimum length of 1".to_string()));
8023			}
8024			if val.chars().count() > 35 {
8025				return Err(ValidationError::new(1002, "orgnl_grp_cxl_id exceeds the maximum length of 35".to_string()));
8026			}
8027		}
8028		if let Some(ref val) = self.rslvd_case { val.validate()? }
8029		if self.orgnl_msg_id.chars().count() < 1 {
8030			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8031		}
8032		if self.orgnl_msg_id.chars().count() > 35 {
8033			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8034		}
8035		if self.orgnl_msg_nm_id.chars().count() < 1 {
8036			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8037		}
8038		if self.orgnl_msg_nm_id.chars().count() > 35 {
8039			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8040		}
8041		if let Some(ref val) = self.orgnl_nb_of_txs {
8042			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8043			if !pattern.is_match(val) {
8044				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8045			}
8046		}
8047		if let Some(ref val) = self.grp_cxl_sts { val.validate()? }
8048		if let Some(ref vec) = self.cxl_sts_rsn_inf { for item in vec { item.validate()? } }
8049		if let Some(ref vec) = self.nb_of_txs_per_cxl_sts { for item in vec { item.validate()? } }
8050		Ok(())
8051	}
8052}
8053
8054
8055// OriginalGroupHeader15 ...
8056#[cfg_attr(feature = "derive_debug", derive(Debug))]
8057#[cfg_attr(feature = "derive_default", derive(Default))]
8058#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8059#[cfg_attr(feature = "derive_clone", derive(Clone))]
8060#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8061pub struct OriginalGroupHeader15 {
8062	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpCxlId", skip_serializing_if = "Option::is_none") )]
8063	pub grp_cxl_id: Option<String>,
8064	#[cfg_attr( feature = "derive_serde", serde(rename = "Case", skip_serializing_if = "Option::is_none") )]
8065	pub case: Option<Case5>,
8066	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8067	pub orgnl_msg_id: String,
8068	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8069	pub orgnl_msg_nm_id: String,
8070	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8071	pub orgnl_cre_dt_tm: Option<String>,
8072	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs", skip_serializing_if = "Option::is_none") )]
8073	pub nb_of_txs: Option<String>,
8074	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
8075	pub ctrl_sum: Option<f64>,
8076	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpCxl", skip_serializing_if = "Option::is_none") )]
8077	pub grp_cxl: Option<bool>,
8078	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlRsnInf", skip_serializing_if = "Option::is_none") )]
8079	pub cxl_rsn_inf: Option<Vec<PaymentCancellationReason5>>,
8080}
8081
8082impl OriginalGroupHeader15 {
8083	pub fn validate(&self) -> Result<(), ValidationError> {
8084		if let Some(ref val) = self.grp_cxl_id {
8085			if val.chars().count() < 1 {
8086				return Err(ValidationError::new(1001, "grp_cxl_id is shorter than the minimum length of 1".to_string()));
8087			}
8088			if val.chars().count() > 35 {
8089				return Err(ValidationError::new(1002, "grp_cxl_id exceeds the maximum length of 35".to_string()));
8090			}
8091		}
8092		if let Some(ref val) = self.case { val.validate()? }
8093		if self.orgnl_msg_id.chars().count() < 1 {
8094			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8095		}
8096		if self.orgnl_msg_id.chars().count() > 35 {
8097			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8098		}
8099		if self.orgnl_msg_nm_id.chars().count() < 1 {
8100			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8101		}
8102		if self.orgnl_msg_nm_id.chars().count() > 35 {
8103			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8104		}
8105		if let Some(ref val) = self.nb_of_txs {
8106			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8107			if !pattern.is_match(val) {
8108				return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
8109			}
8110		}
8111		if let Some(ref vec) = self.cxl_rsn_inf { for item in vec { item.validate()? } }
8112		Ok(())
8113	}
8114}
8115
8116
8117// OriginalGroupHeader17 ...
8118#[cfg_attr(feature = "derive_debug", derive(Debug))]
8119#[cfg_attr(feature = "derive_default", derive(Default))]
8120#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8121#[cfg_attr(feature = "derive_clone", derive(Clone))]
8122#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8123pub struct OriginalGroupHeader17 {
8124	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8125	pub orgnl_msg_id: String,
8126	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8127	pub orgnl_msg_nm_id: String,
8128	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8129	pub orgnl_cre_dt_tm: Option<String>,
8130	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8131	pub orgnl_nb_of_txs: Option<String>,
8132	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8133	pub orgnl_ctrl_sum: Option<f64>,
8134	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpSts", skip_serializing_if = "Option::is_none") )]
8135	pub grp_sts: Option<String>,
8136	#[cfg_attr( feature = "derive_serde", serde(rename = "StsRsnInf", skip_serializing_if = "Option::is_none") )]
8137	pub sts_rsn_inf: Option<Vec<StatusReasonInformation12>>,
8138	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxsPerSts", skip_serializing_if = "Option::is_none") )]
8139	pub nb_of_txs_per_sts: Option<Vec<NumberOfTransactionsPerStatus5>>,
8140}
8141
8142impl OriginalGroupHeader17 {
8143	pub fn validate(&self) -> Result<(), ValidationError> {
8144		if self.orgnl_msg_id.chars().count() < 1 {
8145			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8146		}
8147		if self.orgnl_msg_id.chars().count() > 35 {
8148			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8149		}
8150		if self.orgnl_msg_nm_id.chars().count() < 1 {
8151			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8152		}
8153		if self.orgnl_msg_nm_id.chars().count() > 35 {
8154			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8155		}
8156		if let Some(ref val) = self.orgnl_nb_of_txs {
8157			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8158			if !pattern.is_match(val) {
8159				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8160			}
8161		}
8162		if let Some(ref val) = self.grp_sts {
8163			if val.chars().count() < 1 {
8164				return Err(ValidationError::new(1001, "grp_sts is shorter than the minimum length of 1".to_string()));
8165			}
8166			if val.chars().count() > 4 {
8167				return Err(ValidationError::new(1002, "grp_sts exceeds the maximum length of 4".to_string()));
8168			}
8169		}
8170		if let Some(ref vec) = self.sts_rsn_inf { for item in vec { item.validate()? } }
8171		if let Some(ref vec) = self.nb_of_txs_per_sts { for item in vec { item.validate()? } }
8172		Ok(())
8173	}
8174}
8175
8176
8177// OriginalGroupHeader18 ...
8178#[cfg_attr(feature = "derive_debug", derive(Debug))]
8179#[cfg_attr(feature = "derive_default", derive(Default))]
8180#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8181#[cfg_attr(feature = "derive_clone", derive(Clone))]
8182#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8183pub struct OriginalGroupHeader18 {
8184	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8185	pub orgnl_msg_id: String,
8186	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8187	pub orgnl_msg_nm_id: String,
8188	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8189	pub orgnl_cre_dt_tm: Option<String>,
8190	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrRsnInf", skip_serializing_if = "Option::is_none") )]
8191	pub rtr_rsn_inf: Option<Vec<PaymentReturnReason6>>,
8192}
8193
8194impl OriginalGroupHeader18 {
8195	pub fn validate(&self) -> Result<(), ValidationError> {
8196		if self.orgnl_msg_id.chars().count() < 1 {
8197			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8198		}
8199		if self.orgnl_msg_id.chars().count() > 35 {
8200			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8201		}
8202		if self.orgnl_msg_nm_id.chars().count() < 1 {
8203			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8204		}
8205		if self.orgnl_msg_nm_id.chars().count() > 35 {
8206			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8207		}
8208		if let Some(ref vec) = self.rtr_rsn_inf { for item in vec { item.validate()? } }
8209		Ok(())
8210	}
8211}
8212
8213
8214// OriginalGroupInformation27 ...
8215#[cfg_attr(feature = "derive_debug", derive(Debug))]
8216#[cfg_attr(feature = "derive_default", derive(Default))]
8217#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8218#[cfg_attr(feature = "derive_clone", derive(Clone))]
8219#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8220pub struct OriginalGroupInformation27 {
8221	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8222	pub orgnl_msg_id: String,
8223	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8224	pub orgnl_msg_nm_id: String,
8225	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8226	pub orgnl_cre_dt_tm: Option<String>,
8227	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8228	pub orgnl_nb_of_txs: Option<String>,
8229	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8230	pub orgnl_ctrl_sum: Option<f64>,
8231}
8232
8233impl OriginalGroupInformation27 {
8234	pub fn validate(&self) -> Result<(), ValidationError> {
8235		if self.orgnl_msg_id.chars().count() < 1 {
8236			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8237		}
8238		if self.orgnl_msg_id.chars().count() > 35 {
8239			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8240		}
8241		if self.orgnl_msg_nm_id.chars().count() < 1 {
8242			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8243		}
8244		if self.orgnl_msg_nm_id.chars().count() > 35 {
8245			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8246		}
8247		if let Some(ref val) = self.orgnl_nb_of_txs {
8248			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8249			if !pattern.is_match(val) {
8250				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8251			}
8252		}
8253		Ok(())
8254	}
8255}
8256
8257
8258// OriginalGroupInformation29 ...
8259#[cfg_attr(feature = "derive_debug", derive(Debug))]
8260#[cfg_attr(feature = "derive_default", derive(Default))]
8261#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8262#[cfg_attr(feature = "derive_clone", derive(Clone))]
8263#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8264pub struct OriginalGroupInformation29 {
8265	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8266	pub orgnl_msg_id: String,
8267	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8268	pub orgnl_msg_nm_id: String,
8269	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8270	pub orgnl_cre_dt_tm: Option<String>,
8271}
8272
8273impl OriginalGroupInformation29 {
8274	pub fn validate(&self) -> Result<(), ValidationError> {
8275		if self.orgnl_msg_id.chars().count() < 1 {
8276			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8277		}
8278		if self.orgnl_msg_id.chars().count() > 35 {
8279			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8280		}
8281		if self.orgnl_msg_nm_id.chars().count() < 1 {
8282			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8283		}
8284		if self.orgnl_msg_nm_id.chars().count() > 35 {
8285			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8286		}
8287		Ok(())
8288	}
8289}
8290
8291
8292// OriginalGroupInformation30 ...
8293#[cfg_attr(feature = "derive_debug", derive(Debug))]
8294#[cfg_attr(feature = "derive_default", derive(Default))]
8295#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8296#[cfg_attr(feature = "derive_clone", derive(Clone))]
8297#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8298pub struct OriginalGroupInformation30 {
8299	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
8300	pub orgnl_msg_id: String,
8301	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
8302	pub orgnl_msg_nm_id: String,
8303	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
8304	pub orgnl_cre_dt_tm: Option<String>,
8305	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8306	pub orgnl_nb_of_txs: Option<String>,
8307	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8308	pub orgnl_ctrl_sum: Option<f64>,
8309	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpSts", skip_serializing_if = "Option::is_none") )]
8310	pub grp_sts: Option<String>,
8311	#[cfg_attr( feature = "derive_serde", serde(rename = "StsRsnInf", skip_serializing_if = "Option::is_none") )]
8312	pub sts_rsn_inf: Option<Vec<StatusReasonInformation12>>,
8313	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxsPerSts", skip_serializing_if = "Option::is_none") )]
8314	pub nb_of_txs_per_sts: Option<Vec<NumberOfTransactionsPerStatus5>>,
8315}
8316
8317impl OriginalGroupInformation30 {
8318	pub fn validate(&self) -> Result<(), ValidationError> {
8319		if self.orgnl_msg_id.chars().count() < 1 {
8320			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
8321		}
8322		if self.orgnl_msg_id.chars().count() > 35 {
8323			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
8324		}
8325		if self.orgnl_msg_nm_id.chars().count() < 1 {
8326			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
8327		}
8328		if self.orgnl_msg_nm_id.chars().count() > 35 {
8329			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
8330		}
8331		if let Some(ref val) = self.orgnl_nb_of_txs {
8332			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8333			if !pattern.is_match(val) {
8334				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8335			}
8336		}
8337		if let Some(ref val) = self.grp_sts {
8338			if val.chars().count() < 1 {
8339				return Err(ValidationError::new(1001, "grp_sts is shorter than the minimum length of 1".to_string()));
8340			}
8341			if val.chars().count() > 4 {
8342				return Err(ValidationError::new(1002, "grp_sts exceeds the maximum length of 4".to_string()));
8343			}
8344		}
8345		if let Some(ref vec) = self.sts_rsn_inf { for item in vec { item.validate()? } }
8346		if let Some(ref vec) = self.nb_of_txs_per_sts { for item in vec { item.validate()? } }
8347		Ok(())
8348	}
8349}
8350
8351
8352// OriginalPaymentInstruction30 ...
8353#[cfg_attr(feature = "derive_debug", derive(Debug))]
8354#[cfg_attr(feature = "derive_default", derive(Default))]
8355#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8356#[cfg_attr(feature = "derive_clone", derive(Clone))]
8357#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8358pub struct OriginalPaymentInstruction30 {
8359	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfCxlId", skip_serializing_if = "Option::is_none") )]
8360	pub orgnl_pmt_inf_cxl_id: Option<String>,
8361	#[cfg_attr( feature = "derive_serde", serde(rename = "RslvdCase", skip_serializing_if = "Option::is_none") )]
8362	pub rslvd_case: Option<Case5>,
8363	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfId") )]
8364	pub orgnl_pmt_inf_id: String,
8365	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
8366	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
8367	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8368	pub orgnl_nb_of_txs: Option<String>,
8369	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8370	pub orgnl_ctrl_sum: Option<f64>,
8371	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfCxlSts", skip_serializing_if = "Option::is_none") )]
8372	pub pmt_inf_cxl_sts: Option<GroupCancellationStatus1Code>,
8373	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsRsnInf", skip_serializing_if = "Option::is_none") )]
8374	pub cxl_sts_rsn_inf: Option<Vec<CancellationStatusReason4>>,
8375	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxsPerCxlSts", skip_serializing_if = "Option::is_none") )]
8376	pub nb_of_txs_per_cxl_sts: Option<Vec<NumberOfCancellationsPerStatus1>>,
8377	#[cfg_attr( feature = "derive_serde", serde(rename = "TxInfAndSts", skip_serializing_if = "Option::is_none") )]
8378	pub tx_inf_and_sts: Option<Vec<PaymentTransaction103>>,
8379}
8380
8381impl OriginalPaymentInstruction30 {
8382	pub fn validate(&self) -> Result<(), ValidationError> {
8383		if let Some(ref val) = self.orgnl_pmt_inf_cxl_id {
8384			if val.chars().count() < 1 {
8385				return Err(ValidationError::new(1001, "orgnl_pmt_inf_cxl_id is shorter than the minimum length of 1".to_string()));
8386			}
8387			if val.chars().count() > 35 {
8388				return Err(ValidationError::new(1002, "orgnl_pmt_inf_cxl_id exceeds the maximum length of 35".to_string()));
8389			}
8390		}
8391		if let Some(ref val) = self.rslvd_case { val.validate()? }
8392		if self.orgnl_pmt_inf_id.chars().count() < 1 {
8393			return Err(ValidationError::new(1001, "orgnl_pmt_inf_id is shorter than the minimum length of 1".to_string()));
8394		}
8395		if self.orgnl_pmt_inf_id.chars().count() > 35 {
8396			return Err(ValidationError::new(1002, "orgnl_pmt_inf_id exceeds the maximum length of 35".to_string()));
8397		}
8398		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
8399		if let Some(ref val) = self.orgnl_nb_of_txs {
8400			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8401			if !pattern.is_match(val) {
8402				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8403			}
8404		}
8405		if let Some(ref val) = self.pmt_inf_cxl_sts { val.validate()? }
8406		if let Some(ref vec) = self.cxl_sts_rsn_inf { for item in vec { item.validate()? } }
8407		if let Some(ref vec) = self.nb_of_txs_per_cxl_sts { for item in vec { item.validate()? } }
8408		if let Some(ref vec) = self.tx_inf_and_sts { for item in vec { item.validate()? } }
8409		Ok(())
8410	}
8411}
8412
8413
8414// OriginalPaymentInstruction31 ...
8415#[cfg_attr(feature = "derive_debug", derive(Debug))]
8416#[cfg_attr(feature = "derive_default", derive(Default))]
8417#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8418#[cfg_attr(feature = "derive_clone", derive(Clone))]
8419#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8420pub struct OriginalPaymentInstruction31 {
8421	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfId") )]
8422	pub orgnl_pmt_inf_id: String,
8423	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNbOfTxs", skip_serializing_if = "Option::is_none") )]
8424	pub orgnl_nb_of_txs: Option<String>,
8425	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCtrlSum", skip_serializing_if = "Option::is_none") )]
8426	pub orgnl_ctrl_sum: Option<f64>,
8427	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfSts", skip_serializing_if = "Option::is_none") )]
8428	pub pmt_inf_sts: Option<String>,
8429	#[cfg_attr( feature = "derive_serde", serde(rename = "StsRsnInf", skip_serializing_if = "Option::is_none") )]
8430	pub sts_rsn_inf: Option<Vec<StatusReasonInformation12>>,
8431	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxsPerSts", skip_serializing_if = "Option::is_none") )]
8432	pub nb_of_txs_per_sts: Option<Vec<NumberOfTransactionsPerStatus5>>,
8433	#[cfg_attr( feature = "derive_serde", serde(rename = "TxInfAndSts", skip_serializing_if = "Option::is_none") )]
8434	pub tx_inf_and_sts: Option<Vec<PaymentTransaction104>>,
8435}
8436
8437impl OriginalPaymentInstruction31 {
8438	pub fn validate(&self) -> Result<(), ValidationError> {
8439		if self.orgnl_pmt_inf_id.chars().count() < 1 {
8440			return Err(ValidationError::new(1001, "orgnl_pmt_inf_id is shorter than the minimum length of 1".to_string()));
8441		}
8442		if self.orgnl_pmt_inf_id.chars().count() > 35 {
8443			return Err(ValidationError::new(1002, "orgnl_pmt_inf_id exceeds the maximum length of 35".to_string()));
8444		}
8445		if let Some(ref val) = self.orgnl_nb_of_txs {
8446			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8447			if !pattern.is_match(val) {
8448				return Err(ValidationError::new(1005, "orgnl_nb_of_txs does not match the required pattern".to_string()));
8449			}
8450		}
8451		if let Some(ref val) = self.pmt_inf_sts {
8452			if val.chars().count() < 1 {
8453				return Err(ValidationError::new(1001, "pmt_inf_sts is shorter than the minimum length of 1".to_string()));
8454			}
8455			if val.chars().count() > 4 {
8456				return Err(ValidationError::new(1002, "pmt_inf_sts exceeds the maximum length of 4".to_string()));
8457			}
8458		}
8459		if let Some(ref vec) = self.sts_rsn_inf { for item in vec { item.validate()? } }
8460		if let Some(ref vec) = self.nb_of_txs_per_sts { for item in vec { item.validate()? } }
8461		if let Some(ref vec) = self.tx_inf_and_sts { for item in vec { item.validate()? } }
8462		Ok(())
8463	}
8464}
8465
8466
8467// OriginalPaymentInstruction36 ...
8468#[cfg_attr(feature = "derive_debug", derive(Debug))]
8469#[cfg_attr(feature = "derive_default", derive(Default))]
8470#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8471#[cfg_attr(feature = "derive_clone", derive(Clone))]
8472#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8473pub struct OriginalPaymentInstruction36 {
8474	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCxlId", skip_serializing_if = "Option::is_none") )]
8475	pub pmt_cxl_id: Option<String>,
8476	#[cfg_attr( feature = "derive_serde", serde(rename = "Case", skip_serializing_if = "Option::is_none") )]
8477	pub case: Option<Case5>,
8478	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfId") )]
8479	pub orgnl_pmt_inf_id: String,
8480	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
8481	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
8482	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfTxs", skip_serializing_if = "Option::is_none") )]
8483	pub nb_of_txs: Option<String>,
8484	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrlSum", skip_serializing_if = "Option::is_none") )]
8485	pub ctrl_sum: Option<f64>,
8486	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfCxl", skip_serializing_if = "Option::is_none") )]
8487	pub pmt_inf_cxl: Option<bool>,
8488	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlRsnInf", skip_serializing_if = "Option::is_none") )]
8489	pub cxl_rsn_inf: Option<Vec<PaymentCancellationReason5>>,
8490	#[cfg_attr( feature = "derive_serde", serde(rename = "TxInf", skip_serializing_if = "Option::is_none") )]
8491	pub tx_inf: Option<Vec<PaymentTransaction124>>,
8492}
8493
8494impl OriginalPaymentInstruction36 {
8495	pub fn validate(&self) -> Result<(), ValidationError> {
8496		if let Some(ref val) = self.pmt_cxl_id {
8497			if val.chars().count() < 1 {
8498				return Err(ValidationError::new(1001, "pmt_cxl_id is shorter than the minimum length of 1".to_string()));
8499			}
8500			if val.chars().count() > 35 {
8501				return Err(ValidationError::new(1002, "pmt_cxl_id exceeds the maximum length of 35".to_string()));
8502			}
8503		}
8504		if let Some(ref val) = self.case { val.validate()? }
8505		if self.orgnl_pmt_inf_id.chars().count() < 1 {
8506			return Err(ValidationError::new(1001, "orgnl_pmt_inf_id is shorter than the minimum length of 1".to_string()));
8507		}
8508		if self.orgnl_pmt_inf_id.chars().count() > 35 {
8509			return Err(ValidationError::new(1002, "orgnl_pmt_inf_id exceeds the maximum length of 35".to_string()));
8510		}
8511		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
8512		if let Some(ref val) = self.nb_of_txs {
8513			let pattern = Regex::new("[0-9]{1,15}").unwrap();
8514			if !pattern.is_match(val) {
8515				return Err(ValidationError::new(1005, "nb_of_txs does not match the required pattern".to_string()));
8516			}
8517		}
8518		if let Some(ref vec) = self.cxl_rsn_inf { for item in vec { item.validate()? } }
8519		if let Some(ref vec) = self.tx_inf { for item in vec { item.validate()? } }
8520		Ok(())
8521	}
8522}
8523
8524
8525// OriginalTransactionReference28 ...
8526#[cfg_attr(feature = "derive_debug", derive(Debug))]
8527#[cfg_attr(feature = "derive_default", derive(Default))]
8528#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8529#[cfg_attr(feature = "derive_clone", derive(Clone))]
8530#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8531pub struct OriginalTransactionReference28 {
8532	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
8533	pub intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
8534	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
8535	pub amt: Option<AmountType4Choice>,
8536	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
8537	pub intr_bk_sttlm_dt: Option<String>,
8538	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
8539	pub reqd_colltn_dt: Option<String>,
8540	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
8541	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
8542	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrSchmeId", skip_serializing_if = "Option::is_none") )]
8543	pub cdtr_schme_id: Option<PartyIdentification135>,
8544	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf", skip_serializing_if = "Option::is_none") )]
8545	pub sttlm_inf: Option<SettlementInstruction7>,
8546	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
8547	pub pmt_tp_inf: Option<PaymentTypeInformation27>,
8548	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtMtd", skip_serializing_if = "Option::is_none") )]
8549	pub pmt_mtd: Option<PaymentMethod4Code>,
8550	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtRltdInf", skip_serializing_if = "Option::is_none") )]
8551	pub mndt_rltd_inf: Option<MandateRelatedInformation14>,
8552	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
8553	pub rmt_inf: Option<RemittanceInformation16>,
8554	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
8555	pub ultmt_dbtr: Option<Party40Choice>,
8556	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
8557	pub dbtr: Option<Party40Choice>,
8558	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
8559	pub dbtr_acct: Option<CashAccount38>,
8560	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
8561	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8562	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8563	pub dbtr_agt_acct: Option<CashAccount38>,
8564	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
8565	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8566	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8567	pub cdtr_agt_acct: Option<CashAccount38>,
8568	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
8569	pub cdtr: Option<Party40Choice>,
8570	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
8571	pub cdtr_acct: Option<CashAccount38>,
8572	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
8573	pub ultmt_cdtr: Option<Party40Choice>,
8574	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
8575	pub purp: Option<Purpose2Choice>,
8576}
8577
8578impl OriginalTransactionReference28 {
8579	pub fn validate(&self) -> Result<(), ValidationError> {
8580		if let Some(ref val) = self.intr_bk_sttlm_amt { val.validate()? }
8581		if let Some(ref val) = self.amt { val.validate()? }
8582		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
8583		if let Some(ref val) = self.cdtr_schme_id { val.validate()? }
8584		if let Some(ref val) = self.sttlm_inf { val.validate()? }
8585		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
8586		if let Some(ref val) = self.pmt_mtd { val.validate()? }
8587		if let Some(ref val) = self.mndt_rltd_inf { val.validate()? }
8588		if let Some(ref val) = self.rmt_inf { val.validate()? }
8589		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
8590		if let Some(ref val) = self.dbtr { val.validate()? }
8591		if let Some(ref val) = self.dbtr_acct { val.validate()? }
8592		if let Some(ref val) = self.dbtr_agt { val.validate()? }
8593		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
8594		if let Some(ref val) = self.cdtr_agt { val.validate()? }
8595		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
8596		if let Some(ref val) = self.cdtr { val.validate()? }
8597		if let Some(ref val) = self.cdtr_acct { val.validate()? }
8598		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
8599		if let Some(ref val) = self.purp { val.validate()? }
8600		Ok(())
8601	}
8602}
8603
8604
8605// OriginalTransactionReference29 ...
8606#[cfg_attr(feature = "derive_debug", derive(Debug))]
8607#[cfg_attr(feature = "derive_default", derive(Default))]
8608#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8609#[cfg_attr(feature = "derive_clone", derive(Clone))]
8610#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8611pub struct OriginalTransactionReference29 {
8612	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
8613	pub amt: Option<AmountType4Choice>,
8614	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
8615	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
8616	#[cfg_attr( feature = "derive_serde", serde(rename = "XpryDt", skip_serializing_if = "Option::is_none") )]
8617	pub xpry_dt: Option<DateAndDateTime2Choice>,
8618	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCond", skip_serializing_if = "Option::is_none") )]
8619	pub pmt_cond: Option<PaymentCondition1>,
8620	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
8621	pub pmt_tp_inf: Option<PaymentTypeInformation26>,
8622	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtMtd", skip_serializing_if = "Option::is_none") )]
8623	pub pmt_mtd: Option<PaymentMethod4Code>,
8624	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
8625	pub rmt_inf: Option<RemittanceInformation16>,
8626	#[cfg_attr( feature = "derive_serde", serde(rename = "NclsdFile", skip_serializing_if = "Option::is_none") )]
8627	pub nclsd_file: Option<Vec<Document12>>,
8628	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
8629	pub ultmt_dbtr: Option<PartyIdentification135>,
8630	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
8631	pub dbtr: Option<PartyIdentification135>,
8632	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
8633	pub dbtr_acct: Option<CashAccount38>,
8634	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
8635	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8636	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt") )]
8637	pub cdtr_agt: BranchAndFinancialInstitutionIdentification6,
8638	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
8639	pub cdtr: PartyIdentification135,
8640	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
8641	pub cdtr_acct: Option<CashAccount38>,
8642	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
8643	pub ultmt_cdtr: Option<PartyIdentification135>,
8644}
8645
8646impl OriginalTransactionReference29 {
8647	pub fn validate(&self) -> Result<(), ValidationError> {
8648		if let Some(ref val) = self.amt { val.validate()? }
8649		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
8650		if let Some(ref val) = self.xpry_dt { val.validate()? }
8651		if let Some(ref val) = self.pmt_cond { val.validate()? }
8652		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
8653		if let Some(ref val) = self.pmt_mtd { val.validate()? }
8654		if let Some(ref val) = self.rmt_inf { val.validate()? }
8655		if let Some(ref vec) = self.nclsd_file { for item in vec { item.validate()? } }
8656		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
8657		if let Some(ref val) = self.dbtr { val.validate()? }
8658		if let Some(ref val) = self.dbtr_acct { val.validate()? }
8659		if let Some(ref val) = self.dbtr_agt { val.validate()? }
8660		self.cdtr_agt.validate()?;
8661		self.cdtr.validate()?;
8662		if let Some(ref val) = self.cdtr_acct { val.validate()? }
8663		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
8664		Ok(())
8665	}
8666}
8667
8668
8669// OriginalTransactionReference31 ...
8670#[cfg_attr(feature = "derive_debug", derive(Debug))]
8671#[cfg_attr(feature = "derive_default", derive(Default))]
8672#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8673#[cfg_attr(feature = "derive_clone", derive(Clone))]
8674#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8675pub struct OriginalTransactionReference31 {
8676	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
8677	pub intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
8678	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
8679	pub amt: Option<AmountType4Choice>,
8680	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
8681	pub intr_bk_sttlm_dt: Option<String>,
8682	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
8683	pub reqd_colltn_dt: Option<String>,
8684	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
8685	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
8686	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrSchmeId", skip_serializing_if = "Option::is_none") )]
8687	pub cdtr_schme_id: Option<PartyIdentification135>,
8688	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf", skip_serializing_if = "Option::is_none") )]
8689	pub sttlm_inf: Option<SettlementInstruction7>,
8690	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
8691	pub pmt_tp_inf: Option<PaymentTypeInformation27>,
8692	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtMtd", skip_serializing_if = "Option::is_none") )]
8693	pub pmt_mtd: Option<PaymentMethod4Code>,
8694	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtRltdInf", skip_serializing_if = "Option::is_none") )]
8695	pub mndt_rltd_inf: Option<MandateRelatedData1Choice>,
8696	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
8697	pub rmt_inf: Option<RemittanceInformation16>,
8698	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
8699	pub ultmt_dbtr: Option<Party40Choice>,
8700	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
8701	pub dbtr: Option<Party40Choice>,
8702	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
8703	pub dbtr_acct: Option<CashAccount38>,
8704	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
8705	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8706	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8707	pub dbtr_agt_acct: Option<CashAccount38>,
8708	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
8709	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8710	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8711	pub cdtr_agt_acct: Option<CashAccount38>,
8712	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
8713	pub cdtr: Option<Party40Choice>,
8714	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
8715	pub cdtr_acct: Option<CashAccount38>,
8716	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
8717	pub ultmt_cdtr: Option<Party40Choice>,
8718	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
8719	pub purp: Option<Purpose2Choice>,
8720}
8721
8722impl OriginalTransactionReference31 {
8723	pub fn validate(&self) -> Result<(), ValidationError> {
8724		if let Some(ref val) = self.intr_bk_sttlm_amt { val.validate()? }
8725		if let Some(ref val) = self.amt { val.validate()? }
8726		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
8727		if let Some(ref val) = self.cdtr_schme_id { val.validate()? }
8728		if let Some(ref val) = self.sttlm_inf { val.validate()? }
8729		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
8730		if let Some(ref val) = self.pmt_mtd { val.validate()? }
8731		if let Some(ref val) = self.mndt_rltd_inf { val.validate()? }
8732		if let Some(ref val) = self.rmt_inf { val.validate()? }
8733		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
8734		if let Some(ref val) = self.dbtr { val.validate()? }
8735		if let Some(ref val) = self.dbtr_acct { val.validate()? }
8736		if let Some(ref val) = self.dbtr_agt { val.validate()? }
8737		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
8738		if let Some(ref val) = self.cdtr_agt { val.validate()? }
8739		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
8740		if let Some(ref val) = self.cdtr { val.validate()? }
8741		if let Some(ref val) = self.cdtr_acct { val.validate()? }
8742		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
8743		if let Some(ref val) = self.purp { val.validate()? }
8744		Ok(())
8745	}
8746}
8747
8748
8749// OriginalTransactionReference32 ...
8750#[cfg_attr(feature = "derive_debug", derive(Debug))]
8751#[cfg_attr(feature = "derive_default", derive(Default))]
8752#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8753#[cfg_attr(feature = "derive_clone", derive(Clone))]
8754#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8755pub struct OriginalTransactionReference32 {
8756	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
8757	pub intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
8758	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
8759	pub amt: Option<AmountType4Choice>,
8760	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
8761	pub intr_bk_sttlm_dt: Option<String>,
8762	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
8763	pub reqd_colltn_dt: Option<String>,
8764	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
8765	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
8766	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrSchmeId", skip_serializing_if = "Option::is_none") )]
8767	pub cdtr_schme_id: Option<PartyIdentification135>,
8768	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf", skip_serializing_if = "Option::is_none") )]
8769	pub sttlm_inf: Option<SettlementInstruction7>,
8770	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
8771	pub pmt_tp_inf: Option<PaymentTypeInformation27>,
8772	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtMtd", skip_serializing_if = "Option::is_none") )]
8773	pub pmt_mtd: Option<PaymentMethod4Code>,
8774	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtRltdInf", skip_serializing_if = "Option::is_none") )]
8775	pub mndt_rltd_inf: Option<MandateRelatedData1Choice>,
8776	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
8777	pub rmt_inf: Option<RemittanceInformation16>,
8778	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
8779	pub ultmt_dbtr: Option<Party40Choice>,
8780	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
8781	pub dbtr: Option<Party40Choice>,
8782	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
8783	pub dbtr_acct: Option<CashAccount38>,
8784	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
8785	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8786	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8787	pub dbtr_agt_acct: Option<CashAccount38>,
8788	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
8789	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
8790	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
8791	pub cdtr_agt_acct: Option<CashAccount38>,
8792	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
8793	pub cdtr: Option<Party40Choice>,
8794	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
8795	pub cdtr_acct: Option<CashAccount38>,
8796	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
8797	pub ultmt_cdtr: Option<Party40Choice>,
8798	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
8799	pub purp: Option<Purpose2Choice>,
8800	#[cfg_attr( feature = "derive_serde", serde(rename = "UndrlygCstmrCdtTrf", skip_serializing_if = "Option::is_none") )]
8801	pub undrlyg_cstmr_cdt_trf: Option<CreditTransferTransaction45>,
8802}
8803
8804impl OriginalTransactionReference32 {
8805	pub fn validate(&self) -> Result<(), ValidationError> {
8806		if let Some(ref val) = self.intr_bk_sttlm_amt { val.validate()? }
8807		if let Some(ref val) = self.amt { val.validate()? }
8808		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
8809		if let Some(ref val) = self.cdtr_schme_id { val.validate()? }
8810		if let Some(ref val) = self.sttlm_inf { val.validate()? }
8811		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
8812		if let Some(ref val) = self.pmt_mtd { val.validate()? }
8813		if let Some(ref val) = self.mndt_rltd_inf { val.validate()? }
8814		if let Some(ref val) = self.rmt_inf { val.validate()? }
8815		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
8816		if let Some(ref val) = self.dbtr { val.validate()? }
8817		if let Some(ref val) = self.dbtr_acct { val.validate()? }
8818		if let Some(ref val) = self.dbtr_agt { val.validate()? }
8819		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
8820		if let Some(ref val) = self.cdtr_agt { val.validate()? }
8821		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
8822		if let Some(ref val) = self.cdtr { val.validate()? }
8823		if let Some(ref val) = self.cdtr_acct { val.validate()? }
8824		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
8825		if let Some(ref val) = self.purp { val.validate()? }
8826		if let Some(ref val) = self.undrlyg_cstmr_cdt_trf { val.validate()? }
8827		Ok(())
8828	}
8829}
8830
8831
8832// OtherContact1 ...
8833#[cfg_attr(feature = "derive_debug", derive(Debug))]
8834#[cfg_attr(feature = "derive_default", derive(Default))]
8835#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8836#[cfg_attr(feature = "derive_clone", derive(Clone))]
8837#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8838pub struct OtherContact1 {
8839	#[cfg_attr( feature = "derive_serde", serde(rename = "ChanlTp") )]
8840	pub chanl_tp: String,
8841	#[cfg_attr( feature = "derive_serde", serde(rename = "Id", skip_serializing_if = "Option::is_none") )]
8842	pub id: Option<String>,
8843}
8844
8845impl OtherContact1 {
8846	pub fn validate(&self) -> Result<(), ValidationError> {
8847		if self.chanl_tp.chars().count() < 1 {
8848			return Err(ValidationError::new(1001, "chanl_tp is shorter than the minimum length of 1".to_string()));
8849		}
8850		if self.chanl_tp.chars().count() > 4 {
8851			return Err(ValidationError::new(1002, "chanl_tp exceeds the maximum length of 4".to_string()));
8852		}
8853		if let Some(ref val) = self.id {
8854			if val.chars().count() < 1 {
8855				return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
8856			}
8857			if val.chars().count() > 128 {
8858				return Err(ValidationError::new(1002, "id exceeds the maximum length of 128".to_string()));
8859			}
8860		}
8861		Ok(())
8862	}
8863}
8864
8865
8866// OtherIdentification1 ...
8867#[cfg_attr(feature = "derive_debug", derive(Debug))]
8868#[cfg_attr(feature = "derive_default", derive(Default))]
8869#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8870#[cfg_attr(feature = "derive_clone", derive(Clone))]
8871#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8872pub struct OtherIdentification1 {
8873	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
8874	pub id: String,
8875	#[cfg_attr( feature = "derive_serde", serde(rename = "Sfx", skip_serializing_if = "Option::is_none") )]
8876	pub sfx: Option<String>,
8877	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
8878	pub tp: IdentificationSource3Choice,
8879}
8880
8881impl OtherIdentification1 {
8882	pub fn validate(&self) -> Result<(), ValidationError> {
8883		if self.id.chars().count() < 1 {
8884			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
8885		}
8886		if self.id.chars().count() > 35 {
8887			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
8888		}
8889		if let Some(ref val) = self.sfx {
8890			if val.chars().count() < 1 {
8891				return Err(ValidationError::new(1001, "sfx is shorter than the minimum length of 1".to_string()));
8892			}
8893			if val.chars().count() > 16 {
8894				return Err(ValidationError::new(1002, "sfx exceeds the maximum length of 16".to_string()));
8895			}
8896		}
8897		self.tp.validate()?;
8898		Ok(())
8899	}
8900}
8901
8902
8903// POIComponentType1Code ...
8904#[cfg_attr(feature = "derive_debug", derive(Debug))]
8905#[cfg_attr(feature = "derive_default", derive(Default))]
8906#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8907#[cfg_attr(feature = "derive_clone", derive(Clone))]
8908#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8909pub enum POIComponentType1Code {
8910	#[cfg_attr(feature = "derive_default", default)]
8911	#[cfg_attr( feature = "derive_serde", serde(rename = "SOFT") )]
8912	CodeSOFT,
8913	#[cfg_attr( feature = "derive_serde", serde(rename = "EMVK") )]
8914	CodeEMVK,
8915	#[cfg_attr( feature = "derive_serde", serde(rename = "EMVO") )]
8916	CodeEMVO,
8917	#[cfg_attr( feature = "derive_serde", serde(rename = "MRIT") )]
8918	CodeMRIT,
8919	#[cfg_attr( feature = "derive_serde", serde(rename = "CHIT") )]
8920	CodeCHIT,
8921	#[cfg_attr( feature = "derive_serde", serde(rename = "SECM") )]
8922	CodeSECM,
8923	#[cfg_attr( feature = "derive_serde", serde(rename = "PEDV") )]
8924	CodePEDV,
8925}
8926
8927impl POIComponentType1Code {
8928	pub fn validate(&self) -> Result<(), ValidationError> {
8929		Ok(())
8930	}
8931}
8932
8933
8934// Pagination1 ...
8935#[cfg_attr(feature = "derive_debug", derive(Debug))]
8936#[cfg_attr(feature = "derive_default", derive(Default))]
8937#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8938#[cfg_attr(feature = "derive_clone", derive(Clone))]
8939#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8940pub struct Pagination1 {
8941	#[cfg_attr( feature = "derive_serde", serde(rename = "PgNb") )]
8942	pub pg_nb: String,
8943	#[cfg_attr( feature = "derive_serde", serde(rename = "LastPgInd") )]
8944	pub last_pg_ind: bool,
8945}
8946
8947impl Pagination1 {
8948	pub fn validate(&self) -> Result<(), ValidationError> {
8949		let pattern = Regex::new("[0-9]{1,5}").unwrap();
8950		if !pattern.is_match(&self.pg_nb) {
8951			return Err(ValidationError::new(1005, "pg_nb does not match the required pattern".to_string()));
8952		}
8953		Ok(())
8954	}
8955}
8956
8957
8958// Party38Choice ...
8959#[cfg_attr(feature = "derive_debug", derive(Debug))]
8960#[cfg_attr(feature = "derive_default", derive(Default))]
8961#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8962#[cfg_attr(feature = "derive_clone", derive(Clone))]
8963#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8964pub struct Party38Choice {
8965	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgId", skip_serializing_if = "Option::is_none") )]
8966	pub org_id: Option<OrganisationIdentification29>,
8967	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvtId", skip_serializing_if = "Option::is_none") )]
8968	pub prvt_id: Option<PersonIdentification13>,
8969}
8970
8971impl Party38Choice {
8972	pub fn validate(&self) -> Result<(), ValidationError> {
8973		if let Some(ref val) = self.org_id { val.validate()? }
8974		if let Some(ref val) = self.prvt_id { val.validate()? }
8975		Ok(())
8976	}
8977}
8978
8979
8980// Party40Choice ...
8981#[cfg_attr(feature = "derive_debug", derive(Debug))]
8982#[cfg_attr(feature = "derive_default", derive(Default))]
8983#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
8984#[cfg_attr(feature = "derive_clone", derive(Clone))]
8985#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
8986pub struct Party40Choice {
8987	#[cfg_attr( feature = "derive_serde", serde(rename = "Pty", skip_serializing_if = "Option::is_none") )]
8988	pub pty: Option<PartyIdentification135>,
8989	#[cfg_attr( feature = "derive_serde", serde(rename = "Agt", skip_serializing_if = "Option::is_none") )]
8990	pub agt: Option<BranchAndFinancialInstitutionIdentification6>,
8991}
8992
8993impl Party40Choice {
8994	pub fn validate(&self) -> Result<(), ValidationError> {
8995		if let Some(ref val) = self.pty { val.validate()? }
8996		if let Some(ref val) = self.agt { val.validate()? }
8997		Ok(())
8998	}
8999}
9000
9001
9002// Party44Choice ...
9003#[cfg_attr(feature = "derive_debug", derive(Debug))]
9004#[cfg_attr(feature = "derive_default", derive(Default))]
9005#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9006#[cfg_attr(feature = "derive_clone", derive(Clone))]
9007#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9008pub struct Party44Choice {
9009	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgId", skip_serializing_if = "Option::is_none") )]
9010	pub org_id: Option<PartyIdentification135>,
9011	#[cfg_attr( feature = "derive_serde", serde(rename = "FIId", skip_serializing_if = "Option::is_none") )]
9012	pub fi_id: Option<BranchAndFinancialInstitutionIdentification6>,
9013}
9014
9015impl Party44Choice {
9016	pub fn validate(&self) -> Result<(), ValidationError> {
9017		if let Some(ref val) = self.org_id { val.validate()? }
9018		if let Some(ref val) = self.fi_id { val.validate()? }
9019		Ok(())
9020	}
9021}
9022
9023
9024// PartyAndSignature3 ...
9025#[cfg_attr(feature = "derive_debug", derive(Debug))]
9026#[cfg_attr(feature = "derive_default", derive(Default))]
9027#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9028#[cfg_attr(feature = "derive_clone", derive(Clone))]
9029#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9030pub struct PartyAndSignature3 {
9031	#[cfg_attr( feature = "derive_serde", serde(rename = "Pty") )]
9032	pub pty: PartyIdentification135,
9033	#[cfg_attr( feature = "derive_serde", serde(rename = "Sgntr") )]
9034	pub sgntr: SkipPayload,
9035}
9036
9037impl PartyAndSignature3 {
9038	pub fn validate(&self) -> Result<(), ValidationError> {
9039		self.pty.validate()?;
9040		self.sgntr.validate()?;
9041		Ok(())
9042	}
9043}
9044
9045
9046// PartyIdentification120Choice ...
9047#[cfg_attr(feature = "derive_debug", derive(Debug))]
9048#[cfg_attr(feature = "derive_default", derive(Default))]
9049#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9050#[cfg_attr(feature = "derive_clone", derive(Clone))]
9051#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9052pub struct PartyIdentification120Choice {
9053	#[cfg_attr( feature = "derive_serde", serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none") )]
9054	pub any_bic: Option<String>,
9055	#[cfg_attr( feature = "derive_serde", serde(rename = "PrtryId", skip_serializing_if = "Option::is_none") )]
9056	pub prtry_id: Option<GenericIdentification36>,
9057	#[cfg_attr( feature = "derive_serde", serde(rename = "NmAndAdr", skip_serializing_if = "Option::is_none") )]
9058	pub nm_and_adr: Option<NameAndAddress5>,
9059}
9060
9061impl PartyIdentification120Choice {
9062	pub fn validate(&self) -> Result<(), ValidationError> {
9063		if let Some(ref val) = self.any_bic {
9064			let pattern = Regex::new("[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}").unwrap();
9065			if !pattern.is_match(val) {
9066				return Err(ValidationError::new(1005, "any_bic does not match the required pattern".to_string()));
9067			}
9068		}
9069		if let Some(ref val) = self.prtry_id { val.validate()? }
9070		if let Some(ref val) = self.nm_and_adr { val.validate()? }
9071		Ok(())
9072	}
9073}
9074
9075
9076// PartyIdentification135 ...
9077#[cfg_attr(feature = "derive_debug", derive(Debug))]
9078#[cfg_attr(feature = "derive_default", derive(Default))]
9079#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9080#[cfg_attr(feature = "derive_clone", derive(Clone))]
9081#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9082pub struct PartyIdentification135 {
9083	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
9084	pub nm: Option<String>,
9085	#[cfg_attr( feature = "derive_serde", serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none") )]
9086	pub pstl_adr: Option<PostalAddress24>,
9087	#[cfg_attr( feature = "derive_serde", serde(rename = "Id", skip_serializing_if = "Option::is_none") )]
9088	pub id: Option<Party38Choice>,
9089	#[cfg_attr( feature = "derive_serde", serde(rename = "CtryOfRes", skip_serializing_if = "Option::is_none") )]
9090	pub ctry_of_res: Option<String>,
9091	#[cfg_attr( feature = "derive_serde", serde(rename = "CtctDtls", skip_serializing_if = "Option::is_none") )]
9092	pub ctct_dtls: Option<Contact4>,
9093}
9094
9095impl PartyIdentification135 {
9096	pub fn validate(&self) -> Result<(), ValidationError> {
9097		if let Some(ref val) = self.nm {
9098			if val.chars().count() < 1 {
9099				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
9100			}
9101			if val.chars().count() > 140 {
9102				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
9103			}
9104		}
9105		if let Some(ref val) = self.pstl_adr { val.validate()? }
9106		if let Some(ref val) = self.id { val.validate()? }
9107		if let Some(ref val) = self.ctry_of_res {
9108			let pattern = Regex::new("[A-Z]{2,2}").unwrap();
9109			if !pattern.is_match(val) {
9110				return Err(ValidationError::new(1005, "ctry_of_res does not match the required pattern".to_string()));
9111			}
9112		}
9113		if let Some(ref val) = self.ctct_dtls { val.validate()? }
9114		Ok(())
9115	}
9116}
9117
9118
9119// PartyIdentification136 ...
9120#[cfg_attr(feature = "derive_debug", derive(Debug))]
9121#[cfg_attr(feature = "derive_default", derive(Default))]
9122#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9123#[cfg_attr(feature = "derive_clone", derive(Clone))]
9124#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9125pub struct PartyIdentification136 {
9126	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
9127	pub id: PartyIdentification120Choice,
9128	#[cfg_attr( feature = "derive_serde", serde(rename = "LEI", skip_serializing_if = "Option::is_none") )]
9129	pub lei: Option<String>,
9130}
9131
9132impl PartyIdentification136 {
9133	pub fn validate(&self) -> Result<(), ValidationError> {
9134		self.id.validate()?;
9135		if let Some(ref val) = self.lei {
9136			let pattern = Regex::new("[A-Z0-9]{18,18}[0-9]{2,2}").unwrap();
9137			if !pattern.is_match(val) {
9138				return Err(ValidationError::new(1005, "lei does not match the required pattern".to_string()));
9139			}
9140		}
9141		Ok(())
9142	}
9143}
9144
9145
9146// PartyType3Code ...
9147#[cfg_attr(feature = "derive_debug", derive(Debug))]
9148#[cfg_attr(feature = "derive_default", derive(Default))]
9149#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9150#[cfg_attr(feature = "derive_clone", derive(Clone))]
9151#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9152pub enum PartyType3Code {
9153	#[cfg_attr(feature = "derive_default", default)]
9154	#[cfg_attr( feature = "derive_serde", serde(rename = "OPOI") )]
9155	CodeOPOI,
9156	#[cfg_attr( feature = "derive_serde", serde(rename = "MERC") )]
9157	CodeMERC,
9158	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCP") )]
9159	CodeACCP,
9160	#[cfg_attr( feature = "derive_serde", serde(rename = "ITAG") )]
9161	CodeITAG,
9162	#[cfg_attr( feature = "derive_serde", serde(rename = "ACQR") )]
9163	CodeACQR,
9164	#[cfg_attr( feature = "derive_serde", serde(rename = "CISS") )]
9165	CodeCISS,
9166	#[cfg_attr( feature = "derive_serde", serde(rename = "DLIS") )]
9167	CodeDLIS,
9168}
9169
9170impl PartyType3Code {
9171	pub fn validate(&self) -> Result<(), ValidationError> {
9172		Ok(())
9173	}
9174}
9175
9176
9177// PartyType4Code ...
9178#[cfg_attr(feature = "derive_debug", derive(Debug))]
9179#[cfg_attr(feature = "derive_default", derive(Default))]
9180#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9181#[cfg_attr(feature = "derive_clone", derive(Clone))]
9182#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9183pub enum PartyType4Code {
9184	#[cfg_attr(feature = "derive_default", default)]
9185	#[cfg_attr( feature = "derive_serde", serde(rename = "MERC") )]
9186	CodeMERC,
9187	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCP") )]
9188	CodeACCP,
9189	#[cfg_attr( feature = "derive_serde", serde(rename = "ITAG") )]
9190	CodeITAG,
9191	#[cfg_attr( feature = "derive_serde", serde(rename = "ACQR") )]
9192	CodeACQR,
9193	#[cfg_attr( feature = "derive_serde", serde(rename = "CISS") )]
9194	CodeCISS,
9195	#[cfg_attr( feature = "derive_serde", serde(rename = "TAXH") )]
9196	CodeTAXH,
9197}
9198
9199impl PartyType4Code {
9200	pub fn validate(&self) -> Result<(), ValidationError> {
9201		Ok(())
9202	}
9203}
9204
9205
9206// PaymentCancellationReason5 ...
9207#[cfg_attr(feature = "derive_debug", derive(Debug))]
9208#[cfg_attr(feature = "derive_default", derive(Default))]
9209#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9210#[cfg_attr(feature = "derive_clone", derive(Clone))]
9211#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9212pub struct PaymentCancellationReason5 {
9213	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
9214	pub orgtr: Option<PartyIdentification135>,
9215	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
9216	pub rsn: Option<CancellationReason33Choice>,
9217	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
9218	pub addtl_inf: Option<Vec<String>>,
9219}
9220
9221impl PaymentCancellationReason5 {
9222	pub fn validate(&self) -> Result<(), ValidationError> {
9223		if let Some(ref val) = self.orgtr { val.validate()? }
9224		if let Some(ref val) = self.rsn { val.validate()? }
9225		if let Some(ref vec) = self.addtl_inf {
9226			for item in vec {
9227				if item.chars().count() < 1 {
9228					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
9229				}
9230				if item.chars().count() > 105 {
9231					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
9232				}
9233			}
9234		}
9235		Ok(())
9236	}
9237}
9238
9239
9240// PaymentCard4 ...
9241#[cfg_attr(feature = "derive_debug", derive(Debug))]
9242#[cfg_attr(feature = "derive_default", derive(Default))]
9243#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9244#[cfg_attr(feature = "derive_clone", derive(Clone))]
9245#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9246pub struct PaymentCard4 {
9247	#[cfg_attr( feature = "derive_serde", serde(rename = "PlainCardData", skip_serializing_if = "Option::is_none") )]
9248	pub plain_card_data: Option<PlainCardData1>,
9249	#[cfg_attr( feature = "derive_serde", serde(rename = "CardCtryCd", skip_serializing_if = "Option::is_none") )]
9250	pub card_ctry_cd: Option<String>,
9251	#[cfg_attr( feature = "derive_serde", serde(rename = "CardBrnd", skip_serializing_if = "Option::is_none") )]
9252	pub card_brnd: Option<GenericIdentification1>,
9253	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlCardData", skip_serializing_if = "Option::is_none") )]
9254	pub addtl_card_data: Option<String>,
9255}
9256
9257impl PaymentCard4 {
9258	pub fn validate(&self) -> Result<(), ValidationError> {
9259		if let Some(ref val) = self.plain_card_data { val.validate()? }
9260		if let Some(ref val) = self.card_ctry_cd {
9261			let pattern = Regex::new("[0-9]{3}").unwrap();
9262			if !pattern.is_match(val) {
9263				return Err(ValidationError::new(1005, "card_ctry_cd does not match the required pattern".to_string()));
9264			}
9265		}
9266		if let Some(ref val) = self.card_brnd { val.validate()? }
9267		if let Some(ref val) = self.addtl_card_data {
9268			if val.chars().count() < 1 {
9269				return Err(ValidationError::new(1001, "addtl_card_data is shorter than the minimum length of 1".to_string()));
9270			}
9271			if val.chars().count() > 70 {
9272				return Err(ValidationError::new(1002, "addtl_card_data exceeds the maximum length of 70".to_string()));
9273			}
9274		}
9275		Ok(())
9276	}
9277}
9278
9279
9280// PaymentComplementaryInformation8 ...
9281#[cfg_attr(feature = "derive_debug", derive(Debug))]
9282#[cfg_attr(feature = "derive_default", derive(Default))]
9283#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9284#[cfg_attr(feature = "derive_clone", derive(Clone))]
9285#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9286pub struct PaymentComplementaryInformation8 {
9287	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
9288	pub instr_id: Option<String>,
9289	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none") )]
9290	pub end_to_end_id: Option<String>,
9291	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
9292	pub tx_id: Option<String>,
9293	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
9294	pub pmt_tp_inf: Option<PaymentTypeInformation27>,
9295	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
9296	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
9297	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
9298	pub reqd_colltn_dt: Option<String>,
9299	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
9300	pub intr_bk_sttlm_dt: Option<String>,
9301	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
9302	pub amt: Option<AmountType4Choice>,
9303	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
9304	pub intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
9305	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgBr", skip_serializing_if = "Option::is_none") )]
9306	pub chrg_br: Option<ChargeBearerType1Code>,
9307	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
9308	pub ultmt_dbtr: Option<PartyIdentification135>,
9309	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
9310	pub dbtr: Option<PartyIdentification135>,
9311	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
9312	pub dbtr_acct: Option<CashAccount38>,
9313	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
9314	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
9315	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
9316	pub dbtr_agt_acct: Option<CashAccount38>,
9317	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmInf", skip_serializing_if = "Option::is_none") )]
9318	pub sttlm_inf: Option<SettlementInstruction7>,
9319	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
9320	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
9321	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
9322	pub intrmy_agt1_acct: Option<CashAccount38>,
9323	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
9324	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
9325	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
9326	pub intrmy_agt2_acct: Option<CashAccount38>,
9327	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
9328	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
9329	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
9330	pub intrmy_agt3_acct: Option<CashAccount38>,
9331	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
9332	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
9333	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
9334	pub cdtr_agt_acct: Option<CashAccount38>,
9335	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
9336	pub cdtr: Option<PartyIdentification135>,
9337	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
9338	pub cdtr_acct: Option<CashAccount38>,
9339	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
9340	pub ultmt_cdtr: Option<PartyIdentification135>,
9341	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
9342	pub purp: Option<Purpose2Choice>,
9343	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForDbtrAgt", skip_serializing_if = "Option::is_none") )]
9344	pub instr_for_dbtr_agt: Option<String>,
9345	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
9346	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
9347	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
9348	pub prvs_instg_agt1_acct: Option<CashAccount38>,
9349	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
9350	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
9351	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
9352	pub prvs_instg_agt2_acct: Option<CashAccount38>,
9353	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
9354	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
9355	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
9356	pub prvs_instg_agt3_acct: Option<CashAccount38>,
9357	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForNxtAgt", skip_serializing_if = "Option::is_none") )]
9358	pub instr_for_nxt_agt: Option<Vec<InstructionForNextAgent1>>,
9359	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrForCdtrAgt", skip_serializing_if = "Option::is_none") )]
9360	pub instr_for_cdtr_agt: Option<Vec<InstructionForCreditorAgent1>>,
9361	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtInf", skip_serializing_if = "Option::is_none") )]
9362	pub rmt_inf: Option<RemittanceInformation16>,
9363}
9364
9365impl PaymentComplementaryInformation8 {
9366	pub fn validate(&self) -> Result<(), ValidationError> {
9367		if let Some(ref val) = self.instr_id {
9368			if val.chars().count() < 1 {
9369				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
9370			}
9371			if val.chars().count() > 35 {
9372				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
9373			}
9374		}
9375		if let Some(ref val) = self.end_to_end_id {
9376			if val.chars().count() < 1 {
9377				return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
9378			}
9379			if val.chars().count() > 35 {
9380				return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
9381			}
9382		}
9383		if let Some(ref val) = self.tx_id {
9384			if val.chars().count() < 1 {
9385				return Err(ValidationError::new(1001, "tx_id is shorter than the minimum length of 1".to_string()));
9386			}
9387			if val.chars().count() > 35 {
9388				return Err(ValidationError::new(1002, "tx_id exceeds the maximum length of 35".to_string()));
9389			}
9390		}
9391		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
9392		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
9393		if let Some(ref val) = self.amt { val.validate()? }
9394		if let Some(ref val) = self.intr_bk_sttlm_amt { val.validate()? }
9395		if let Some(ref val) = self.chrg_br { val.validate()? }
9396		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
9397		if let Some(ref val) = self.dbtr { val.validate()? }
9398		if let Some(ref val) = self.dbtr_acct { val.validate()? }
9399		if let Some(ref val) = self.dbtr_agt { val.validate()? }
9400		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
9401		if let Some(ref val) = self.sttlm_inf { val.validate()? }
9402		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
9403		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
9404		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
9405		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
9406		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
9407		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
9408		if let Some(ref val) = self.cdtr_agt { val.validate()? }
9409		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
9410		if let Some(ref val) = self.cdtr { val.validate()? }
9411		if let Some(ref val) = self.cdtr_acct { val.validate()? }
9412		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
9413		if let Some(ref val) = self.purp { val.validate()? }
9414		if let Some(ref val) = self.instr_for_dbtr_agt {
9415			if val.chars().count() < 1 {
9416				return Err(ValidationError::new(1001, "instr_for_dbtr_agt is shorter than the minimum length of 1".to_string()));
9417			}
9418			if val.chars().count() > 140 {
9419				return Err(ValidationError::new(1002, "instr_for_dbtr_agt exceeds the maximum length of 140".to_string()));
9420			}
9421		}
9422		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
9423		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
9424		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
9425		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
9426		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
9427		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
9428		if let Some(ref vec) = self.instr_for_nxt_agt { for item in vec { item.validate()? } }
9429		if let Some(ref vec) = self.instr_for_cdtr_agt { for item in vec { item.validate()? } }
9430		if let Some(ref val) = self.rmt_inf { val.validate()? }
9431		Ok(())
9432	}
9433}
9434
9435
9436// PaymentCondition1 ...
9437#[cfg_attr(feature = "derive_debug", derive(Debug))]
9438#[cfg_attr(feature = "derive_default", derive(Default))]
9439#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9440#[cfg_attr(feature = "derive_clone", derive(Clone))]
9441#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9442pub struct PaymentCondition1 {
9443	#[cfg_attr( feature = "derive_serde", serde(rename = "AmtModAllwd") )]
9444	pub amt_mod_allwd: bool,
9445	#[cfg_attr( feature = "derive_serde", serde(rename = "EarlyPmtAllwd") )]
9446	pub early_pmt_allwd: bool,
9447	#[cfg_attr( feature = "derive_serde", serde(rename = "DelyPnlty", skip_serializing_if = "Option::is_none") )]
9448	pub dely_pnlty: Option<String>,
9449	#[cfg_attr( feature = "derive_serde", serde(rename = "ImdtPmtRbt", skip_serializing_if = "Option::is_none") )]
9450	pub imdt_pmt_rbt: Option<AmountOrRate1Choice>,
9451	#[cfg_attr( feature = "derive_serde", serde(rename = "GrntedPmtReqd") )]
9452	pub grnted_pmt_reqd: bool,
9453}
9454
9455impl PaymentCondition1 {
9456	pub fn validate(&self) -> Result<(), ValidationError> {
9457		if let Some(ref val) = self.dely_pnlty {
9458			if val.chars().count() < 1 {
9459				return Err(ValidationError::new(1001, "dely_pnlty is shorter than the minimum length of 1".to_string()));
9460			}
9461			if val.chars().count() > 140 {
9462				return Err(ValidationError::new(1002, "dely_pnlty exceeds the maximum length of 140".to_string()));
9463			}
9464		}
9465		if let Some(ref val) = self.imdt_pmt_rbt { val.validate()? }
9466		Ok(())
9467	}
9468}
9469
9470
9471// PaymentConditionStatus1 ...
9472#[cfg_attr(feature = "derive_debug", derive(Debug))]
9473#[cfg_attr(feature = "derive_default", derive(Default))]
9474#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9475#[cfg_attr(feature = "derive_clone", derive(Clone))]
9476#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9477pub struct PaymentConditionStatus1 {
9478	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptdAmt", skip_serializing_if = "Option::is_none") )]
9479	pub accptd_amt: Option<ActiveCurrencyAndAmount>,
9480	#[cfg_attr( feature = "derive_serde", serde(rename = "GrntedPmt") )]
9481	pub grnted_pmt: bool,
9482	#[cfg_attr( feature = "derive_serde", serde(rename = "EarlyPmt") )]
9483	pub early_pmt: bool,
9484}
9485
9486impl PaymentConditionStatus1 {
9487	pub fn validate(&self) -> Result<(), ValidationError> {
9488		if let Some(ref val) = self.accptd_amt { val.validate()? }
9489		Ok(())
9490	}
9491}
9492
9493
9494// PaymentContext3 ...
9495#[cfg_attr(feature = "derive_debug", derive(Debug))]
9496#[cfg_attr(feature = "derive_default", derive(Default))]
9497#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9498#[cfg_attr(feature = "derive_clone", derive(Clone))]
9499#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9500pub struct PaymentContext3 {
9501	#[cfg_attr( feature = "derive_serde", serde(rename = "CardPres", skip_serializing_if = "Option::is_none") )]
9502	pub card_pres: Option<bool>,
9503	#[cfg_attr( feature = "derive_serde", serde(rename = "CrdhldrPres", skip_serializing_if = "Option::is_none") )]
9504	pub crdhldr_pres: Option<bool>,
9505	#[cfg_attr( feature = "derive_serde", serde(rename = "OnLineCntxt", skip_serializing_if = "Option::is_none") )]
9506	pub on_line_cntxt: Option<bool>,
9507	#[cfg_attr( feature = "derive_serde", serde(rename = "AttndncCntxt", skip_serializing_if = "Option::is_none") )]
9508	pub attndnc_cntxt: Option<AttendanceContext1Code>,
9509	#[cfg_attr( feature = "derive_serde", serde(rename = "TxEnvt", skip_serializing_if = "Option::is_none") )]
9510	pub tx_envt: Option<TransactionEnvironment1Code>,
9511	#[cfg_attr( feature = "derive_serde", serde(rename = "TxChanl", skip_serializing_if = "Option::is_none") )]
9512	pub tx_chanl: Option<TransactionChannel1Code>,
9513	#[cfg_attr( feature = "derive_serde", serde(rename = "AttndntMsgCpbl", skip_serializing_if = "Option::is_none") )]
9514	pub attndnt_msg_cpbl: Option<bool>,
9515	#[cfg_attr( feature = "derive_serde", serde(rename = "AttndntLang", skip_serializing_if = "Option::is_none") )]
9516	pub attndnt_lang: Option<String>,
9517	#[cfg_attr( feature = "derive_serde", serde(rename = "CardDataNtryMd") )]
9518	pub card_data_ntry_md: CardDataReading1Code,
9519	#[cfg_attr( feature = "derive_serde", serde(rename = "FllbckInd", skip_serializing_if = "Option::is_none") )]
9520	pub fllbck_ind: Option<bool>,
9521	#[cfg_attr( feature = "derive_serde", serde(rename = "AuthntcnMtd", skip_serializing_if = "Option::is_none") )]
9522	pub authntcn_mtd: Option<CardholderAuthentication2>,
9523}
9524
9525impl PaymentContext3 {
9526	pub fn validate(&self) -> Result<(), ValidationError> {
9527		if let Some(ref val) = self.attndnc_cntxt { val.validate()? }
9528		if let Some(ref val) = self.tx_envt { val.validate()? }
9529		if let Some(ref val) = self.tx_chanl { val.validate()? }
9530		if let Some(ref val) = self.attndnt_lang {
9531			let pattern = Regex::new("[a-z]{2,2}").unwrap();
9532			if !pattern.is_match(val) {
9533				return Err(ValidationError::new(1005, "attndnt_lang does not match the required pattern".to_string()));
9534			}
9535		}
9536		self.card_data_ntry_md.validate()?;
9537		if let Some(ref val) = self.authntcn_mtd { val.validate()? }
9538		Ok(())
9539	}
9540}
9541
9542
9543// PaymentIdentification6 ...
9544#[cfg_attr(feature = "derive_debug", derive(Debug))]
9545#[cfg_attr(feature = "derive_default", derive(Default))]
9546#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9547#[cfg_attr(feature = "derive_clone", derive(Clone))]
9548#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9549pub struct PaymentIdentification6 {
9550	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
9551	pub instr_id: Option<String>,
9552	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId") )]
9553	pub end_to_end_id: String,
9554	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
9555	pub uetr: Option<String>,
9556}
9557
9558impl PaymentIdentification6 {
9559	pub fn validate(&self) -> Result<(), ValidationError> {
9560		if let Some(ref val) = self.instr_id {
9561			if val.chars().count() < 1 {
9562				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
9563			}
9564			if val.chars().count() > 35 {
9565				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
9566			}
9567		}
9568		if self.end_to_end_id.chars().count() < 1 {
9569			return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
9570		}
9571		if self.end_to_end_id.chars().count() > 35 {
9572			return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
9573		}
9574		if let Some(ref val) = self.uetr {
9575			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
9576			if !pattern.is_match(val) {
9577				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
9578			}
9579		}
9580		Ok(())
9581	}
9582}
9583
9584
9585// PaymentIdentification7 ...
9586#[cfg_attr(feature = "derive_debug", derive(Debug))]
9587#[cfg_attr(feature = "derive_default", derive(Default))]
9588#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9589#[cfg_attr(feature = "derive_clone", derive(Clone))]
9590#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9591pub struct PaymentIdentification7 {
9592	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
9593	pub instr_id: Option<String>,
9594	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId") )]
9595	pub end_to_end_id: String,
9596	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
9597	pub tx_id: Option<String>,
9598	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
9599	pub uetr: Option<String>,
9600	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
9601	pub clr_sys_ref: Option<String>,
9602}
9603
9604impl PaymentIdentification7 {
9605	pub fn validate(&self) -> Result<(), ValidationError> {
9606		if let Some(ref val) = self.instr_id {
9607			if val.chars().count() < 1 {
9608				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
9609			}
9610			if val.chars().count() > 35 {
9611				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
9612			}
9613		}
9614		if self.end_to_end_id.chars().count() < 1 {
9615			return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
9616		}
9617		if self.end_to_end_id.chars().count() > 35 {
9618			return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
9619		}
9620		if let Some(ref val) = self.tx_id {
9621			if val.chars().count() < 1 {
9622				return Err(ValidationError::new(1001, "tx_id is shorter than the minimum length of 1".to_string()));
9623			}
9624			if val.chars().count() > 35 {
9625				return Err(ValidationError::new(1002, "tx_id exceeds the maximum length of 35".to_string()));
9626			}
9627		}
9628		if let Some(ref val) = self.uetr {
9629			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
9630			if !pattern.is_match(val) {
9631				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
9632			}
9633		}
9634		if let Some(ref val) = self.clr_sys_ref {
9635			if val.chars().count() < 1 {
9636				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
9637			}
9638			if val.chars().count() > 35 {
9639				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
9640			}
9641		}
9642		Ok(())
9643	}
9644}
9645
9646
9647// PaymentInstruction31 ...
9648#[cfg_attr(feature = "derive_debug", derive(Debug))]
9649#[cfg_attr(feature = "derive_default", derive(Default))]
9650#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9651#[cfg_attr(feature = "derive_clone", derive(Clone))]
9652#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9653pub struct PaymentInstruction31 {
9654	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none") )]
9655	pub pmt_inf_id: Option<String>,
9656	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtMtd") )]
9657	pub pmt_mtd: PaymentMethod7Code,
9658	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtTpInf", skip_serializing_if = "Option::is_none") )]
9659	pub pmt_tp_inf: Option<PaymentTypeInformation26>,
9660	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt") )]
9661	pub reqd_exctn_dt: DateAndDateTime2Choice,
9662	#[cfg_attr( feature = "derive_serde", serde(rename = "XpryDt", skip_serializing_if = "Option::is_none") )]
9663	pub xpry_dt: Option<DateAndDateTime2Choice>,
9664	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCond", skip_serializing_if = "Option::is_none") )]
9665	pub pmt_cond: Option<PaymentCondition1>,
9666	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
9667	pub dbtr: PartyIdentification135,
9668	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
9669	pub dbtr_acct: Option<CashAccount38>,
9670	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt") )]
9671	pub dbtr_agt: BranchAndFinancialInstitutionIdentification6,
9672	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
9673	pub ultmt_dbtr: Option<PartyIdentification135>,
9674	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgBr", skip_serializing_if = "Option::is_none") )]
9675	pub chrg_br: Option<ChargeBearerType1Code>,
9676	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtTrfTx") )]
9677	pub cdt_trf_tx: Vec<CreditTransferTransaction35>,
9678}
9679
9680impl PaymentInstruction31 {
9681	pub fn validate(&self) -> Result<(), ValidationError> {
9682		if let Some(ref val) = self.pmt_inf_id {
9683			if val.chars().count() < 1 {
9684				return Err(ValidationError::new(1001, "pmt_inf_id is shorter than the minimum length of 1".to_string()));
9685			}
9686			if val.chars().count() > 35 {
9687				return Err(ValidationError::new(1002, "pmt_inf_id exceeds the maximum length of 35".to_string()));
9688			}
9689		}
9690		self.pmt_mtd.validate()?;
9691		if let Some(ref val) = self.pmt_tp_inf { val.validate()? }
9692		self.reqd_exctn_dt.validate()?;
9693		if let Some(ref val) = self.xpry_dt { val.validate()? }
9694		if let Some(ref val) = self.pmt_cond { val.validate()? }
9695		self.dbtr.validate()?;
9696		if let Some(ref val) = self.dbtr_acct { val.validate()? }
9697		self.dbtr_agt.validate()?;
9698		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
9699		if let Some(ref val) = self.chrg_br { val.validate()? }
9700		for item in &self.cdt_trf_tx { item.validate()? }
9701		Ok(())
9702	}
9703}
9704
9705
9706// PaymentMethod4Code ...
9707#[cfg_attr(feature = "derive_debug", derive(Debug))]
9708#[cfg_attr(feature = "derive_default", derive(Default))]
9709#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9710#[cfg_attr(feature = "derive_clone", derive(Clone))]
9711#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9712pub enum PaymentMethod4Code {
9713	#[cfg_attr(feature = "derive_default", default)]
9714	#[cfg_attr( feature = "derive_serde", serde(rename = "CHK") )]
9715	CodeCHK,
9716	#[cfg_attr( feature = "derive_serde", serde(rename = "TRF") )]
9717	CodeTRF,
9718	#[cfg_attr( feature = "derive_serde", serde(rename = "DD") )]
9719	CodeDD,
9720	#[cfg_attr( feature = "derive_serde", serde(rename = "TRA") )]
9721	CodeTRA,
9722}
9723
9724impl PaymentMethod4Code {
9725	pub fn validate(&self) -> Result<(), ValidationError> {
9726		Ok(())
9727	}
9728}
9729
9730
9731// PaymentMethod7Code ...
9732#[cfg_attr(feature = "derive_debug", derive(Debug))]
9733#[cfg_attr(feature = "derive_default", derive(Default))]
9734#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9735#[cfg_attr(feature = "derive_clone", derive(Clone))]
9736#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9737pub enum PaymentMethod7Code {
9738	#[cfg_attr(feature = "derive_default", default)]
9739	#[cfg_attr( feature = "derive_serde", serde(rename = "CHK") )]
9740	CodeCHK,
9741	#[cfg_attr( feature = "derive_serde", serde(rename = "TRF") )]
9742	CodeTRF,
9743}
9744
9745impl PaymentMethod7Code {
9746	pub fn validate(&self) -> Result<(), ValidationError> {
9747		Ok(())
9748	}
9749}
9750
9751
9752// PaymentReturnReason5 ...
9753#[cfg_attr(feature = "derive_debug", derive(Debug))]
9754#[cfg_attr(feature = "derive_default", derive(Default))]
9755#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9756#[cfg_attr(feature = "derive_clone", derive(Clone))]
9757#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9758pub struct PaymentReturnReason5 {
9759	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlBkTxCd", skip_serializing_if = "Option::is_none") )]
9760	pub orgnl_bk_tx_cd: Option<BankTransactionCodeStructure4>,
9761	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
9762	pub orgtr: Option<PartyIdentification135>,
9763	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
9764	pub rsn: Option<ReturnReason5Choice>,
9765	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
9766	pub addtl_inf: Option<Vec<String>>,
9767}
9768
9769impl PaymentReturnReason5 {
9770	pub fn validate(&self) -> Result<(), ValidationError> {
9771		if let Some(ref val) = self.orgnl_bk_tx_cd { val.validate()? }
9772		if let Some(ref val) = self.orgtr { val.validate()? }
9773		if let Some(ref val) = self.rsn { val.validate()? }
9774		if let Some(ref vec) = self.addtl_inf {
9775			for item in vec {
9776				if item.chars().count() < 1 {
9777					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
9778				}
9779				if item.chars().count() > 105 {
9780					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
9781				}
9782			}
9783		}
9784		Ok(())
9785	}
9786}
9787
9788
9789// PaymentReturnReason6 ...
9790#[cfg_attr(feature = "derive_debug", derive(Debug))]
9791#[cfg_attr(feature = "derive_default", derive(Default))]
9792#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9793#[cfg_attr(feature = "derive_clone", derive(Clone))]
9794#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9795pub struct PaymentReturnReason6 {
9796	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
9797	pub orgtr: Option<PartyIdentification135>,
9798	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
9799	pub rsn: Option<ReturnReason5Choice>,
9800	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
9801	pub addtl_inf: Option<Vec<String>>,
9802}
9803
9804impl PaymentReturnReason6 {
9805	pub fn validate(&self) -> Result<(), ValidationError> {
9806		if let Some(ref val) = self.orgtr { val.validate()? }
9807		if let Some(ref val) = self.rsn { val.validate()? }
9808		if let Some(ref vec) = self.addtl_inf {
9809			for item in vec {
9810				if item.chars().count() < 1 {
9811					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
9812				}
9813				if item.chars().count() > 105 {
9814					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
9815				}
9816			}
9817		}
9818		Ok(())
9819	}
9820}
9821
9822
9823// PaymentTransaction102 ...
9824#[cfg_attr(feature = "derive_debug", derive(Debug))]
9825#[cfg_attr(feature = "derive_default", derive(Default))]
9826#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9827#[cfg_attr(feature = "derive_clone", derive(Clone))]
9828#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9829pub struct PaymentTransaction102 {
9830	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsId", skip_serializing_if = "Option::is_none") )]
9831	pub cxl_sts_id: Option<String>,
9832	#[cfg_attr( feature = "derive_serde", serde(rename = "RslvdCase", skip_serializing_if = "Option::is_none") )]
9833	pub rslvd_case: Option<Case5>,
9834	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
9835	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
9836	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
9837	pub orgnl_instr_id: Option<String>,
9838	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
9839	pub orgnl_end_to_end_id: Option<String>,
9840	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
9841	pub orgnl_tx_id: Option<String>,
9842	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlClrSysRef", skip_serializing_if = "Option::is_none") )]
9843	pub orgnl_clr_sys_ref: Option<String>,
9844	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
9845	pub orgnl_uetr: Option<String>,
9846	#[cfg_attr( feature = "derive_serde", serde(rename = "TxCxlSts", skip_serializing_if = "Option::is_none") )]
9847	pub tx_cxl_sts: Option<CancellationIndividualStatus1Code>,
9848	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsRsnInf", skip_serializing_if = "Option::is_none") )]
9849	pub cxl_sts_rsn_inf: Option<Vec<CancellationStatusReason4>>,
9850	#[cfg_attr( feature = "derive_serde", serde(rename = "RsltnRltdInf", skip_serializing_if = "Option::is_none") )]
9851	pub rsltn_rltd_inf: Option<ResolutionData1>,
9852	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
9853	pub orgnl_intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
9854	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
9855	pub orgnl_intr_bk_sttlm_dt: Option<String>,
9856	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgnr", skip_serializing_if = "Option::is_none") )]
9857	pub assgnr: Option<Party40Choice>,
9858	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgne", skip_serializing_if = "Option::is_none") )]
9859	pub assgne: Option<Party40Choice>,
9860	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
9861	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
9862}
9863
9864impl PaymentTransaction102 {
9865	pub fn validate(&self) -> Result<(), ValidationError> {
9866		if let Some(ref val) = self.cxl_sts_id {
9867			if val.chars().count() < 1 {
9868				return Err(ValidationError::new(1001, "cxl_sts_id is shorter than the minimum length of 1".to_string()));
9869			}
9870			if val.chars().count() > 35 {
9871				return Err(ValidationError::new(1002, "cxl_sts_id exceeds the maximum length of 35".to_string()));
9872			}
9873		}
9874		if let Some(ref val) = self.rslvd_case { val.validate()? }
9875		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
9876		if let Some(ref val) = self.orgnl_instr_id {
9877			if val.chars().count() < 1 {
9878				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
9879			}
9880			if val.chars().count() > 35 {
9881				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
9882			}
9883		}
9884		if let Some(ref val) = self.orgnl_end_to_end_id {
9885			if val.chars().count() < 1 {
9886				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
9887			}
9888			if val.chars().count() > 35 {
9889				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
9890			}
9891		}
9892		if let Some(ref val) = self.orgnl_tx_id {
9893			if val.chars().count() < 1 {
9894				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
9895			}
9896			if val.chars().count() > 35 {
9897				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
9898			}
9899		}
9900		if let Some(ref val) = self.orgnl_clr_sys_ref {
9901			if val.chars().count() < 1 {
9902				return Err(ValidationError::new(1001, "orgnl_clr_sys_ref is shorter than the minimum length of 1".to_string()));
9903			}
9904			if val.chars().count() > 35 {
9905				return Err(ValidationError::new(1002, "orgnl_clr_sys_ref exceeds the maximum length of 35".to_string()));
9906			}
9907		}
9908		if let Some(ref val) = self.orgnl_uetr {
9909			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
9910			if !pattern.is_match(val) {
9911				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
9912			}
9913		}
9914		if let Some(ref val) = self.tx_cxl_sts { val.validate()? }
9915		if let Some(ref vec) = self.cxl_sts_rsn_inf { for item in vec { item.validate()? } }
9916		if let Some(ref val) = self.rsltn_rltd_inf { val.validate()? }
9917		if let Some(ref val) = self.orgnl_intr_bk_sttlm_amt { val.validate()? }
9918		if let Some(ref val) = self.assgnr { val.validate()? }
9919		if let Some(ref val) = self.assgne { val.validate()? }
9920		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
9921		Ok(())
9922	}
9923}
9924
9925
9926// PaymentTransaction103 ...
9927#[cfg_attr(feature = "derive_debug", derive(Debug))]
9928#[cfg_attr(feature = "derive_default", derive(Default))]
9929#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
9930#[cfg_attr(feature = "derive_clone", derive(Clone))]
9931#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
9932pub struct PaymentTransaction103 {
9933	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsId", skip_serializing_if = "Option::is_none") )]
9934	pub cxl_sts_id: Option<String>,
9935	#[cfg_attr( feature = "derive_serde", serde(rename = "RslvdCase", skip_serializing_if = "Option::is_none") )]
9936	pub rslvd_case: Option<Case5>,
9937	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
9938	pub orgnl_instr_id: Option<String>,
9939	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
9940	pub orgnl_end_to_end_id: Option<String>,
9941	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
9942	pub uetr: Option<String>,
9943	#[cfg_attr( feature = "derive_serde", serde(rename = "TxCxlSts", skip_serializing_if = "Option::is_none") )]
9944	pub tx_cxl_sts: Option<CancellationIndividualStatus1Code>,
9945	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlStsRsnInf", skip_serializing_if = "Option::is_none") )]
9946	pub cxl_sts_rsn_inf: Option<Vec<CancellationStatusReason4>>,
9947	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstdAmt", skip_serializing_if = "Option::is_none") )]
9948	pub orgnl_instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
9949	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlReqdExctnDt", skip_serializing_if = "Option::is_none") )]
9950	pub orgnl_reqd_exctn_dt: Option<DateAndDateTime2Choice>,
9951	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlReqdColltnDt", skip_serializing_if = "Option::is_none") )]
9952	pub orgnl_reqd_colltn_dt: Option<String>,
9953	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
9954	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
9955}
9956
9957impl PaymentTransaction103 {
9958	pub fn validate(&self) -> Result<(), ValidationError> {
9959		if let Some(ref val) = self.cxl_sts_id {
9960			if val.chars().count() < 1 {
9961				return Err(ValidationError::new(1001, "cxl_sts_id is shorter than the minimum length of 1".to_string()));
9962			}
9963			if val.chars().count() > 35 {
9964				return Err(ValidationError::new(1002, "cxl_sts_id exceeds the maximum length of 35".to_string()));
9965			}
9966		}
9967		if let Some(ref val) = self.rslvd_case { val.validate()? }
9968		if let Some(ref val) = self.orgnl_instr_id {
9969			if val.chars().count() < 1 {
9970				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
9971			}
9972			if val.chars().count() > 35 {
9973				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
9974			}
9975		}
9976		if let Some(ref val) = self.orgnl_end_to_end_id {
9977			if val.chars().count() < 1 {
9978				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
9979			}
9980			if val.chars().count() > 35 {
9981				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
9982			}
9983		}
9984		if let Some(ref val) = self.uetr {
9985			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
9986			if !pattern.is_match(val) {
9987				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
9988			}
9989		}
9990		if let Some(ref val) = self.tx_cxl_sts { val.validate()? }
9991		if let Some(ref vec) = self.cxl_sts_rsn_inf { for item in vec { item.validate()? } }
9992		if let Some(ref val) = self.orgnl_instd_amt { val.validate()? }
9993		if let Some(ref val) = self.orgnl_reqd_exctn_dt { val.validate()? }
9994		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
9995		Ok(())
9996	}
9997}
9998
9999
10000// PaymentTransaction104 ...
10001#[cfg_attr(feature = "derive_debug", derive(Debug))]
10002#[cfg_attr(feature = "derive_default", derive(Default))]
10003#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10004#[cfg_attr(feature = "derive_clone", derive(Clone))]
10005#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10006pub struct PaymentTransaction104 {
10007	#[cfg_attr( feature = "derive_serde", serde(rename = "StsId", skip_serializing_if = "Option::is_none") )]
10008	pub sts_id: Option<String>,
10009	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10010	pub orgnl_instr_id: Option<String>,
10011	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10012	pub orgnl_end_to_end_id: Option<String>,
10013	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10014	pub orgnl_uetr: Option<String>,
10015	#[cfg_attr( feature = "derive_serde", serde(rename = "TxSts", skip_serializing_if = "Option::is_none") )]
10016	pub tx_sts: Option<String>,
10017	#[cfg_attr( feature = "derive_serde", serde(rename = "StsRsnInf", skip_serializing_if = "Option::is_none") )]
10018	pub sts_rsn_inf: Option<Vec<StatusReasonInformation12>>,
10019	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCondSts", skip_serializing_if = "Option::is_none") )]
10020	pub pmt_cond_sts: Option<PaymentConditionStatus1>,
10021	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgsInf", skip_serializing_if = "Option::is_none") )]
10022	pub chrgs_inf: Option<Vec<Charges7>>,
10023	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrDcsnDtTm", skip_serializing_if = "Option::is_none") )]
10024	pub dbtr_dcsn_dt_tm: Option<String>,
10025	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptncDtTm", skip_serializing_if = "Option::is_none") )]
10026	pub accptnc_dt_tm: Option<String>,
10027	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none") )]
10028	pub acct_svcr_ref: Option<String>,
10029	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
10030	pub clr_sys_ref: Option<String>,
10031	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10032	pub orgnl_tx_ref: Option<OriginalTransactionReference29>,
10033	#[cfg_attr( feature = "derive_serde", serde(rename = "NclsdFile", skip_serializing_if = "Option::is_none") )]
10034	pub nclsd_file: Option<Vec<Document12>>,
10035	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10036	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10037}
10038
10039impl PaymentTransaction104 {
10040	pub fn validate(&self) -> Result<(), ValidationError> {
10041		if let Some(ref val) = self.sts_id {
10042			if val.chars().count() < 1 {
10043				return Err(ValidationError::new(1001, "sts_id is shorter than the minimum length of 1".to_string()));
10044			}
10045			if val.chars().count() > 35 {
10046				return Err(ValidationError::new(1002, "sts_id exceeds the maximum length of 35".to_string()));
10047			}
10048		}
10049		if let Some(ref val) = self.orgnl_instr_id {
10050			if val.chars().count() < 1 {
10051				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10052			}
10053			if val.chars().count() > 35 {
10054				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10055			}
10056		}
10057		if let Some(ref val) = self.orgnl_end_to_end_id {
10058			if val.chars().count() < 1 {
10059				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10060			}
10061			if val.chars().count() > 35 {
10062				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10063			}
10064		}
10065		if let Some(ref val) = self.orgnl_uetr {
10066			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10067			if !pattern.is_match(val) {
10068				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10069			}
10070		}
10071		if let Some(ref val) = self.tx_sts {
10072			if val.chars().count() < 1 {
10073				return Err(ValidationError::new(1001, "tx_sts is shorter than the minimum length of 1".to_string()));
10074			}
10075			if val.chars().count() > 4 {
10076				return Err(ValidationError::new(1002, "tx_sts exceeds the maximum length of 4".to_string()));
10077			}
10078		}
10079		if let Some(ref vec) = self.sts_rsn_inf { for item in vec { item.validate()? } }
10080		if let Some(ref val) = self.pmt_cond_sts { val.validate()? }
10081		if let Some(ref vec) = self.chrgs_inf { for item in vec { item.validate()? } }
10082		if let Some(ref val) = self.acct_svcr_ref {
10083			if val.chars().count() < 1 {
10084				return Err(ValidationError::new(1001, "acct_svcr_ref is shorter than the minimum length of 1".to_string()));
10085			}
10086			if val.chars().count() > 35 {
10087				return Err(ValidationError::new(1002, "acct_svcr_ref exceeds the maximum length of 35".to_string()));
10088			}
10089		}
10090		if let Some(ref val) = self.clr_sys_ref {
10091			if val.chars().count() < 1 {
10092				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
10093			}
10094			if val.chars().count() > 35 {
10095				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
10096			}
10097		}
10098		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10099		if let Some(ref vec) = self.nclsd_file { for item in vec { item.validate()? } }
10100		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10101		Ok(())
10102	}
10103}
10104
10105
10106// PaymentTransaction106 ...
10107#[cfg_attr(feature = "derive_debug", derive(Debug))]
10108#[cfg_attr(feature = "derive_default", derive(Default))]
10109#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10110#[cfg_attr(feature = "derive_clone", derive(Clone))]
10111#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10112pub struct PaymentTransaction106 {
10113	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlId", skip_serializing_if = "Option::is_none") )]
10114	pub cxl_id: Option<String>,
10115	#[cfg_attr( feature = "derive_serde", serde(rename = "Case", skip_serializing_if = "Option::is_none") )]
10116	pub case: Option<Case5>,
10117	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
10118	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
10119	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10120	pub orgnl_instr_id: Option<String>,
10121	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10122	pub orgnl_end_to_end_id: Option<String>,
10123	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
10124	pub orgnl_tx_id: Option<String>,
10125	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10126	pub orgnl_uetr: Option<String>,
10127	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlClrSysRef", skip_serializing_if = "Option::is_none") )]
10128	pub orgnl_clr_sys_ref: Option<String>,
10129	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
10130	pub orgnl_intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10131	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
10132	pub orgnl_intr_bk_sttlm_dt: Option<String>,
10133	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgnr", skip_serializing_if = "Option::is_none") )]
10134	pub assgnr: Option<BranchAndFinancialInstitutionIdentification6>,
10135	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgne", skip_serializing_if = "Option::is_none") )]
10136	pub assgne: Option<BranchAndFinancialInstitutionIdentification6>,
10137	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlRsnInf", skip_serializing_if = "Option::is_none") )]
10138	pub cxl_rsn_inf: Option<Vec<PaymentCancellationReason5>>,
10139	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10140	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
10141	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10142	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10143}
10144
10145impl PaymentTransaction106 {
10146	pub fn validate(&self) -> Result<(), ValidationError> {
10147		if let Some(ref val) = self.cxl_id {
10148			if val.chars().count() < 1 {
10149				return Err(ValidationError::new(1001, "cxl_id is shorter than the minimum length of 1".to_string()));
10150			}
10151			if val.chars().count() > 35 {
10152				return Err(ValidationError::new(1002, "cxl_id exceeds the maximum length of 35".to_string()));
10153			}
10154		}
10155		if let Some(ref val) = self.case { val.validate()? }
10156		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
10157		if let Some(ref val) = self.orgnl_instr_id {
10158			if val.chars().count() < 1 {
10159				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10160			}
10161			if val.chars().count() > 35 {
10162				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10163			}
10164		}
10165		if let Some(ref val) = self.orgnl_end_to_end_id {
10166			if val.chars().count() < 1 {
10167				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10168			}
10169			if val.chars().count() > 35 {
10170				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10171			}
10172		}
10173		if let Some(ref val) = self.orgnl_tx_id {
10174			if val.chars().count() < 1 {
10175				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
10176			}
10177			if val.chars().count() > 35 {
10178				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
10179			}
10180		}
10181		if let Some(ref val) = self.orgnl_uetr {
10182			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10183			if !pattern.is_match(val) {
10184				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10185			}
10186		}
10187		if let Some(ref val) = self.orgnl_clr_sys_ref {
10188			if val.chars().count() < 1 {
10189				return Err(ValidationError::new(1001, "orgnl_clr_sys_ref is shorter than the minimum length of 1".to_string()));
10190			}
10191			if val.chars().count() > 35 {
10192				return Err(ValidationError::new(1002, "orgnl_clr_sys_ref exceeds the maximum length of 35".to_string()));
10193			}
10194		}
10195		if let Some(ref val) = self.orgnl_intr_bk_sttlm_amt { val.validate()? }
10196		if let Some(ref val) = self.assgnr { val.validate()? }
10197		if let Some(ref val) = self.assgne { val.validate()? }
10198		if let Some(ref vec) = self.cxl_rsn_inf { for item in vec { item.validate()? } }
10199		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10200		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10201		Ok(())
10202	}
10203}
10204
10205
10206// PaymentTransaction107 ...
10207#[cfg_attr(feature = "derive_debug", derive(Debug))]
10208#[cfg_attr(feature = "derive_default", derive(Default))]
10209#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10210#[cfg_attr(feature = "derive_clone", derive(Clone))]
10211#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10212pub struct PaymentTransaction107 {
10213	#[cfg_attr( feature = "derive_serde", serde(rename = "ModStsId", skip_serializing_if = "Option::is_none") )]
10214	pub mod_sts_id: Option<String>,
10215	#[cfg_attr( feature = "derive_serde", serde(rename = "RslvdCase", skip_serializing_if = "Option::is_none") )]
10216	pub rslvd_case: Option<Case5>,
10217	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf") )]
10218	pub orgnl_grp_inf: OriginalGroupInformation29,
10219	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfId", skip_serializing_if = "Option::is_none") )]
10220	pub orgnl_pmt_inf_id: Option<String>,
10221	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10222	pub orgnl_instr_id: Option<String>,
10223	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10224	pub orgnl_end_to_end_id: Option<String>,
10225	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
10226	pub orgnl_tx_id: Option<String>,
10227	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlClrSysRef", skip_serializing_if = "Option::is_none") )]
10228	pub orgnl_clr_sys_ref: Option<String>,
10229	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10230	pub orgnl_uetr: Option<String>,
10231	#[cfg_attr( feature = "derive_serde", serde(rename = "ModStsRsnInf", skip_serializing_if = "Option::is_none") )]
10232	pub mod_sts_rsn_inf: Option<Vec<ModificationStatusReason2>>,
10233	#[cfg_attr( feature = "derive_serde", serde(rename = "RsltnRltdInf", skip_serializing_if = "Option::is_none") )]
10234	pub rsltn_rltd_inf: Option<ResolutionData1>,
10235	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
10236	pub orgnl_intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10237	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
10238	pub orgnl_intr_bk_sttlm_dt: Option<String>,
10239	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgnr", skip_serializing_if = "Option::is_none") )]
10240	pub assgnr: Option<Party40Choice>,
10241	#[cfg_attr( feature = "derive_serde", serde(rename = "Assgne", skip_serializing_if = "Option::is_none") )]
10242	pub assgne: Option<Party40Choice>,
10243	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10244	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
10245}
10246
10247impl PaymentTransaction107 {
10248	pub fn validate(&self) -> Result<(), ValidationError> {
10249		if let Some(ref val) = self.mod_sts_id {
10250			if val.chars().count() < 1 {
10251				return Err(ValidationError::new(1001, "mod_sts_id is shorter than the minimum length of 1".to_string()));
10252			}
10253			if val.chars().count() > 35 {
10254				return Err(ValidationError::new(1002, "mod_sts_id exceeds the maximum length of 35".to_string()));
10255			}
10256		}
10257		if let Some(ref val) = self.rslvd_case { val.validate()? }
10258		self.orgnl_grp_inf.validate()?;
10259		if let Some(ref val) = self.orgnl_pmt_inf_id {
10260			if val.chars().count() < 1 {
10261				return Err(ValidationError::new(1001, "orgnl_pmt_inf_id is shorter than the minimum length of 1".to_string()));
10262			}
10263			if val.chars().count() > 35 {
10264				return Err(ValidationError::new(1002, "orgnl_pmt_inf_id exceeds the maximum length of 35".to_string()));
10265			}
10266		}
10267		if let Some(ref val) = self.orgnl_instr_id {
10268			if val.chars().count() < 1 {
10269				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10270			}
10271			if val.chars().count() > 35 {
10272				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10273			}
10274		}
10275		if let Some(ref val) = self.orgnl_end_to_end_id {
10276			if val.chars().count() < 1 {
10277				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10278			}
10279			if val.chars().count() > 35 {
10280				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10281			}
10282		}
10283		if let Some(ref val) = self.orgnl_tx_id {
10284			if val.chars().count() < 1 {
10285				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
10286			}
10287			if val.chars().count() > 35 {
10288				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
10289			}
10290		}
10291		if let Some(ref val) = self.orgnl_clr_sys_ref {
10292			if val.chars().count() < 1 {
10293				return Err(ValidationError::new(1001, "orgnl_clr_sys_ref is shorter than the minimum length of 1".to_string()));
10294			}
10295			if val.chars().count() > 35 {
10296				return Err(ValidationError::new(1002, "orgnl_clr_sys_ref exceeds the maximum length of 35".to_string()));
10297			}
10298		}
10299		if let Some(ref val) = self.orgnl_uetr {
10300			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10301			if !pattern.is_match(val) {
10302				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10303			}
10304		}
10305		if let Some(ref vec) = self.mod_sts_rsn_inf { for item in vec { item.validate()? } }
10306		if let Some(ref val) = self.rsltn_rltd_inf { val.validate()? }
10307		if let Some(ref val) = self.orgnl_intr_bk_sttlm_amt { val.validate()? }
10308		if let Some(ref val) = self.assgnr { val.validate()? }
10309		if let Some(ref val) = self.assgne { val.validate()? }
10310		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10311		Ok(())
10312	}
10313}
10314
10315
10316// PaymentTransaction110 ...
10317#[cfg_attr(feature = "derive_debug", derive(Debug))]
10318#[cfg_attr(feature = "derive_default", derive(Default))]
10319#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10320#[cfg_attr(feature = "derive_clone", derive(Clone))]
10321#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10322pub struct PaymentTransaction110 {
10323	#[cfg_attr( feature = "derive_serde", serde(rename = "StsId", skip_serializing_if = "Option::is_none") )]
10324	pub sts_id: Option<String>,
10325	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
10326	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
10327	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10328	pub orgnl_instr_id: Option<String>,
10329	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10330	pub orgnl_end_to_end_id: Option<String>,
10331	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
10332	pub orgnl_tx_id: Option<String>,
10333	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10334	pub orgnl_uetr: Option<String>,
10335	#[cfg_attr( feature = "derive_serde", serde(rename = "TxSts", skip_serializing_if = "Option::is_none") )]
10336	pub tx_sts: Option<String>,
10337	#[cfg_attr( feature = "derive_serde", serde(rename = "StsRsnInf", skip_serializing_if = "Option::is_none") )]
10338	pub sts_rsn_inf: Option<Vec<StatusReasonInformation12>>,
10339	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgsInf", skip_serializing_if = "Option::is_none") )]
10340	pub chrgs_inf: Option<Vec<Charges7>>,
10341	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptncDtTm", skip_serializing_if = "Option::is_none") )]
10342	pub accptnc_dt_tm: Option<String>,
10343	#[cfg_attr( feature = "derive_serde", serde(rename = "FctvIntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
10344	pub fctv_intr_bk_sttlm_dt: Option<DateAndDateTime2Choice>,
10345	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none") )]
10346	pub acct_svcr_ref: Option<String>,
10347	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
10348	pub clr_sys_ref: Option<String>,
10349	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
10350	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10351	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
10352	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10353	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10354	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
10355	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10356	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10357}
10358
10359impl PaymentTransaction110 {
10360	pub fn validate(&self) -> Result<(), ValidationError> {
10361		if let Some(ref val) = self.sts_id {
10362			if val.chars().count() < 1 {
10363				return Err(ValidationError::new(1001, "sts_id is shorter than the minimum length of 1".to_string()));
10364			}
10365			if val.chars().count() > 35 {
10366				return Err(ValidationError::new(1002, "sts_id exceeds the maximum length of 35".to_string()));
10367			}
10368		}
10369		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
10370		if let Some(ref val) = self.orgnl_instr_id {
10371			if val.chars().count() < 1 {
10372				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10373			}
10374			if val.chars().count() > 35 {
10375				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10376			}
10377		}
10378		if let Some(ref val) = self.orgnl_end_to_end_id {
10379			if val.chars().count() < 1 {
10380				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10381			}
10382			if val.chars().count() > 35 {
10383				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10384			}
10385		}
10386		if let Some(ref val) = self.orgnl_tx_id {
10387			if val.chars().count() < 1 {
10388				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
10389			}
10390			if val.chars().count() > 35 {
10391				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
10392			}
10393		}
10394		if let Some(ref val) = self.orgnl_uetr {
10395			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10396			if !pattern.is_match(val) {
10397				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10398			}
10399		}
10400		if let Some(ref val) = self.tx_sts {
10401			if val.chars().count() < 1 {
10402				return Err(ValidationError::new(1001, "tx_sts is shorter than the minimum length of 1".to_string()));
10403			}
10404			if val.chars().count() > 4 {
10405				return Err(ValidationError::new(1002, "tx_sts exceeds the maximum length of 4".to_string()));
10406			}
10407		}
10408		if let Some(ref vec) = self.sts_rsn_inf { for item in vec { item.validate()? } }
10409		if let Some(ref vec) = self.chrgs_inf { for item in vec { item.validate()? } }
10410		if let Some(ref val) = self.fctv_intr_bk_sttlm_dt { val.validate()? }
10411		if let Some(ref val) = self.acct_svcr_ref {
10412			if val.chars().count() < 1 {
10413				return Err(ValidationError::new(1001, "acct_svcr_ref is shorter than the minimum length of 1".to_string()));
10414			}
10415			if val.chars().count() > 35 {
10416				return Err(ValidationError::new(1002, "acct_svcr_ref exceeds the maximum length of 35".to_string()));
10417			}
10418		}
10419		if let Some(ref val) = self.clr_sys_ref {
10420			if val.chars().count() < 1 {
10421				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
10422			}
10423			if val.chars().count() > 35 {
10424				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
10425			}
10426		}
10427		if let Some(ref val) = self.instg_agt { val.validate()? }
10428		if let Some(ref val) = self.instd_agt { val.validate()? }
10429		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10430		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10431		Ok(())
10432	}
10433}
10434
10435
10436// PaymentTransaction113 ...
10437#[cfg_attr(feature = "derive_debug", derive(Debug))]
10438#[cfg_attr(feature = "derive_default", derive(Default))]
10439#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10440#[cfg_attr(feature = "derive_clone", derive(Clone))]
10441#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10442pub struct PaymentTransaction113 {
10443	#[cfg_attr( feature = "derive_serde", serde(rename = "StsReqId", skip_serializing_if = "Option::is_none") )]
10444	pub sts_req_id: Option<String>,
10445	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
10446	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
10447	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10448	pub orgnl_instr_id: Option<String>,
10449	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10450	pub orgnl_end_to_end_id: Option<String>,
10451	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
10452	pub orgnl_tx_id: Option<String>,
10453	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10454	pub orgnl_uetr: Option<String>,
10455	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptncDtTm", skip_serializing_if = "Option::is_none") )]
10456	pub accptnc_dt_tm: Option<String>,
10457	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
10458	pub clr_sys_ref: Option<String>,
10459	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
10460	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10461	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
10462	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10463	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10464	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
10465	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10466	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10467}
10468
10469impl PaymentTransaction113 {
10470	pub fn validate(&self) -> Result<(), ValidationError> {
10471		if let Some(ref val) = self.sts_req_id {
10472			if val.chars().count() < 1 {
10473				return Err(ValidationError::new(1001, "sts_req_id is shorter than the minimum length of 1".to_string()));
10474			}
10475			if val.chars().count() > 35 {
10476				return Err(ValidationError::new(1002, "sts_req_id exceeds the maximum length of 35".to_string()));
10477			}
10478		}
10479		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
10480		if let Some(ref val) = self.orgnl_instr_id {
10481			if val.chars().count() < 1 {
10482				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10483			}
10484			if val.chars().count() > 35 {
10485				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10486			}
10487		}
10488		if let Some(ref val) = self.orgnl_end_to_end_id {
10489			if val.chars().count() < 1 {
10490				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10491			}
10492			if val.chars().count() > 35 {
10493				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10494			}
10495		}
10496		if let Some(ref val) = self.orgnl_tx_id {
10497			if val.chars().count() < 1 {
10498				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
10499			}
10500			if val.chars().count() > 35 {
10501				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
10502			}
10503		}
10504		if let Some(ref val) = self.orgnl_uetr {
10505			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10506			if !pattern.is_match(val) {
10507				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10508			}
10509		}
10510		if let Some(ref val) = self.clr_sys_ref {
10511			if val.chars().count() < 1 {
10512				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
10513			}
10514			if val.chars().count() > 35 {
10515				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
10516			}
10517		}
10518		if let Some(ref val) = self.instg_agt { val.validate()? }
10519		if let Some(ref val) = self.instd_agt { val.validate()? }
10520		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10521		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10522		Ok(())
10523	}
10524}
10525
10526
10527// PaymentTransaction118 ...
10528#[cfg_attr(feature = "derive_debug", derive(Debug))]
10529#[cfg_attr(feature = "derive_default", derive(Default))]
10530#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10531#[cfg_attr(feature = "derive_clone", derive(Clone))]
10532#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10533pub struct PaymentTransaction118 {
10534	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrId", skip_serializing_if = "Option::is_none") )]
10535	pub rtr_id: Option<String>,
10536	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
10537	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
10538	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10539	pub orgnl_instr_id: Option<String>,
10540	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10541	pub orgnl_end_to_end_id: Option<String>,
10542	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
10543	pub orgnl_tx_id: Option<String>,
10544	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10545	pub orgnl_uetr: Option<String>,
10546	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlClrSysRef", skip_serializing_if = "Option::is_none") )]
10547	pub orgnl_clr_sys_ref: Option<String>,
10548	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
10549	pub orgnl_intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10550	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
10551	pub orgnl_intr_bk_sttlm_dt: Option<String>,
10552	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrdIntrBkSttlmAmt") )]
10553	pub rtrd_intr_bk_sttlm_amt: ActiveCurrencyAndAmount,
10554	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
10555	pub intr_bk_sttlm_dt: Option<String>,
10556	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmPrty", skip_serializing_if = "Option::is_none") )]
10557	pub sttlm_prty: Option<Priority3Code>,
10558	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmTmIndctn", skip_serializing_if = "Option::is_none") )]
10559	pub sttlm_tm_indctn: Option<SettlementDateTimeIndication1>,
10560	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrdInstdAmt", skip_serializing_if = "Option::is_none") )]
10561	pub rtrd_instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10562	#[cfg_attr( feature = "derive_serde", serde(rename = "XchgRate", skip_serializing_if = "Option::is_none") )]
10563	pub xchg_rate: Option<f64>,
10564	#[cfg_attr( feature = "derive_serde", serde(rename = "CompstnAmt", skip_serializing_if = "Option::is_none") )]
10565	pub compstn_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10566	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgBr", skip_serializing_if = "Option::is_none") )]
10567	pub chrg_br: Option<ChargeBearerType1Code>,
10568	#[cfg_attr( feature = "derive_serde", serde(rename = "ChrgsInf", skip_serializing_if = "Option::is_none") )]
10569	pub chrgs_inf: Option<Vec<Charges7>>,
10570	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
10571	pub clr_sys_ref: Option<String>,
10572	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
10573	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10574	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
10575	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
10576	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrChain", skip_serializing_if = "Option::is_none") )]
10577	pub rtr_chain: Option<TransactionParties8>,
10578	#[cfg_attr( feature = "derive_serde", serde(rename = "RtrRsnInf", skip_serializing_if = "Option::is_none") )]
10579	pub rtr_rsn_inf: Option<Vec<PaymentReturnReason6>>,
10580	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10581	pub orgnl_tx_ref: Option<OriginalTransactionReference32>,
10582	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10583	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10584}
10585
10586impl PaymentTransaction118 {
10587	pub fn validate(&self) -> Result<(), ValidationError> {
10588		if let Some(ref val) = self.rtr_id {
10589			if val.chars().count() < 1 {
10590				return Err(ValidationError::new(1001, "rtr_id is shorter than the minimum length of 1".to_string()));
10591			}
10592			if val.chars().count() > 35 {
10593				return Err(ValidationError::new(1002, "rtr_id exceeds the maximum length of 35".to_string()));
10594			}
10595		}
10596		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
10597		if let Some(ref val) = self.orgnl_instr_id {
10598			if val.chars().count() < 1 {
10599				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10600			}
10601			if val.chars().count() > 35 {
10602				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10603			}
10604		}
10605		if let Some(ref val) = self.orgnl_end_to_end_id {
10606			if val.chars().count() < 1 {
10607				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10608			}
10609			if val.chars().count() > 35 {
10610				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10611			}
10612		}
10613		if let Some(ref val) = self.orgnl_tx_id {
10614			if val.chars().count() < 1 {
10615				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
10616			}
10617			if val.chars().count() > 35 {
10618				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
10619			}
10620		}
10621		if let Some(ref val) = self.orgnl_uetr {
10622			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10623			if !pattern.is_match(val) {
10624				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10625			}
10626		}
10627		if let Some(ref val) = self.orgnl_clr_sys_ref {
10628			if val.chars().count() < 1 {
10629				return Err(ValidationError::new(1001, "orgnl_clr_sys_ref is shorter than the minimum length of 1".to_string()));
10630			}
10631			if val.chars().count() > 35 {
10632				return Err(ValidationError::new(1002, "orgnl_clr_sys_ref exceeds the maximum length of 35".to_string()));
10633			}
10634		}
10635		if let Some(ref val) = self.orgnl_intr_bk_sttlm_amt { val.validate()? }
10636		self.rtrd_intr_bk_sttlm_amt.validate()?;
10637		if let Some(ref val) = self.sttlm_prty { val.validate()? }
10638		if let Some(ref val) = self.sttlm_tm_indctn { val.validate()? }
10639		if let Some(ref val) = self.rtrd_instd_amt { val.validate()? }
10640		if let Some(ref val) = self.compstn_amt { val.validate()? }
10641		if let Some(ref val) = self.chrg_br { val.validate()? }
10642		if let Some(ref vec) = self.chrgs_inf { for item in vec { item.validate()? } }
10643		if let Some(ref val) = self.clr_sys_ref {
10644			if val.chars().count() < 1 {
10645				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
10646			}
10647			if val.chars().count() > 35 {
10648				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
10649			}
10650		}
10651		if let Some(ref val) = self.instg_agt { val.validate()? }
10652		if let Some(ref val) = self.instd_agt { val.validate()? }
10653		if let Some(ref val) = self.rtr_chain { val.validate()? }
10654		if let Some(ref vec) = self.rtr_rsn_inf { for item in vec { item.validate()? } }
10655		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10656		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10657		Ok(())
10658	}
10659}
10660
10661
10662// PaymentTransaction124 ...
10663#[cfg_attr(feature = "derive_debug", derive(Debug))]
10664#[cfg_attr(feature = "derive_default", derive(Default))]
10665#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10666#[cfg_attr(feature = "derive_clone", derive(Clone))]
10667#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10668pub struct PaymentTransaction124 {
10669	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlId", skip_serializing_if = "Option::is_none") )]
10670	pub cxl_id: Option<String>,
10671	#[cfg_attr( feature = "derive_serde", serde(rename = "Case", skip_serializing_if = "Option::is_none") )]
10672	pub case: Option<Case5>,
10673	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
10674	pub orgnl_instr_id: Option<String>,
10675	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
10676	pub orgnl_end_to_end_id: Option<String>,
10677	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
10678	pub orgnl_uetr: Option<String>,
10679	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstdAmt", skip_serializing_if = "Option::is_none") )]
10680	pub orgnl_instd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
10681	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlReqdExctnDt", skip_serializing_if = "Option::is_none") )]
10682	pub orgnl_reqd_exctn_dt: Option<DateAndDateTime2Choice>,
10683	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlReqdColltnDt", skip_serializing_if = "Option::is_none") )]
10684	pub orgnl_reqd_colltn_dt: Option<String>,
10685	#[cfg_attr( feature = "derive_serde", serde(rename = "CxlRsnInf", skip_serializing_if = "Option::is_none") )]
10686	pub cxl_rsn_inf: Option<Vec<PaymentCancellationReason5>>,
10687	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
10688	pub orgnl_tx_ref: Option<OriginalTransactionReference31>,
10689	#[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
10690	pub splmtry_data: Option<Vec<SupplementaryData1>>,
10691}
10692
10693impl PaymentTransaction124 {
10694	pub fn validate(&self) -> Result<(), ValidationError> {
10695		if let Some(ref val) = self.cxl_id {
10696			if val.chars().count() < 1 {
10697				return Err(ValidationError::new(1001, "cxl_id is shorter than the minimum length of 1".to_string()));
10698			}
10699			if val.chars().count() > 35 {
10700				return Err(ValidationError::new(1002, "cxl_id exceeds the maximum length of 35".to_string()));
10701			}
10702		}
10703		if let Some(ref val) = self.case { val.validate()? }
10704		if let Some(ref val) = self.orgnl_instr_id {
10705			if val.chars().count() < 1 {
10706				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
10707			}
10708			if val.chars().count() > 35 {
10709				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
10710			}
10711		}
10712		if let Some(ref val) = self.orgnl_end_to_end_id {
10713			if val.chars().count() < 1 {
10714				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
10715			}
10716			if val.chars().count() > 35 {
10717				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
10718			}
10719		}
10720		if let Some(ref val) = self.orgnl_uetr {
10721			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
10722			if !pattern.is_match(val) {
10723				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
10724			}
10725		}
10726		if let Some(ref val) = self.orgnl_instd_amt { val.validate()? }
10727		if let Some(ref val) = self.orgnl_reqd_exctn_dt { val.validate()? }
10728		if let Some(ref vec) = self.cxl_rsn_inf { for item in vec { item.validate()? } }
10729		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
10730		if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
10731		Ok(())
10732	}
10733}
10734
10735
10736// PaymentTypeInformation26 ...
10737#[cfg_attr(feature = "derive_debug", derive(Debug))]
10738#[cfg_attr(feature = "derive_default", derive(Default))]
10739#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10740#[cfg_attr(feature = "derive_clone", derive(Clone))]
10741#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10742pub struct PaymentTypeInformation26 {
10743	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrPrty", skip_serializing_if = "Option::is_none") )]
10744	pub instr_prty: Option<Priority2Code>,
10745	#[cfg_attr( feature = "derive_serde", serde(rename = "SvcLvl", skip_serializing_if = "Option::is_none") )]
10746	pub svc_lvl: Option<Vec<ServiceLevel8Choice>>,
10747	#[cfg_attr( feature = "derive_serde", serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none") )]
10748	pub lcl_instrm: Option<LocalInstrument2Choice>,
10749	#[cfg_attr( feature = "derive_serde", serde(rename = "CtgyPurp", skip_serializing_if = "Option::is_none") )]
10750	pub ctgy_purp: Option<CategoryPurpose1Choice>,
10751}
10752
10753impl PaymentTypeInformation26 {
10754	pub fn validate(&self) -> Result<(), ValidationError> {
10755		if let Some(ref val) = self.instr_prty { val.validate()? }
10756		if let Some(ref vec) = self.svc_lvl { for item in vec { item.validate()? } }
10757		if let Some(ref val) = self.lcl_instrm { val.validate()? }
10758		if let Some(ref val) = self.ctgy_purp { val.validate()? }
10759		Ok(())
10760	}
10761}
10762
10763
10764// PaymentTypeInformation27 ...
10765#[cfg_attr(feature = "derive_debug", derive(Debug))]
10766#[cfg_attr(feature = "derive_default", derive(Default))]
10767#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10768#[cfg_attr(feature = "derive_clone", derive(Clone))]
10769#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10770pub struct PaymentTypeInformation27 {
10771	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrPrty", skip_serializing_if = "Option::is_none") )]
10772	pub instr_prty: Option<Priority2Code>,
10773	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrChanl", skip_serializing_if = "Option::is_none") )]
10774	pub clr_chanl: Option<ClearingChannel2Code>,
10775	#[cfg_attr( feature = "derive_serde", serde(rename = "SvcLvl", skip_serializing_if = "Option::is_none") )]
10776	pub svc_lvl: Option<Vec<ServiceLevel8Choice>>,
10777	#[cfg_attr( feature = "derive_serde", serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none") )]
10778	pub lcl_instrm: Option<LocalInstrument2Choice>,
10779	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqTp", skip_serializing_if = "Option::is_none") )]
10780	pub seq_tp: Option<SequenceType3Code>,
10781	#[cfg_attr( feature = "derive_serde", serde(rename = "CtgyPurp", skip_serializing_if = "Option::is_none") )]
10782	pub ctgy_purp: Option<CategoryPurpose1Choice>,
10783}
10784
10785impl PaymentTypeInformation27 {
10786	pub fn validate(&self) -> Result<(), ValidationError> {
10787		if let Some(ref val) = self.instr_prty { val.validate()? }
10788		if let Some(ref val) = self.clr_chanl { val.validate()? }
10789		if let Some(ref vec) = self.svc_lvl { for item in vec { item.validate()? } }
10790		if let Some(ref val) = self.lcl_instrm { val.validate()? }
10791		if let Some(ref val) = self.seq_tp { val.validate()? }
10792		if let Some(ref val) = self.ctgy_purp { val.validate()? }
10793		Ok(())
10794	}
10795}
10796
10797
10798// PaymentTypeInformation28 ...
10799#[cfg_attr(feature = "derive_debug", derive(Debug))]
10800#[cfg_attr(feature = "derive_default", derive(Default))]
10801#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10802#[cfg_attr(feature = "derive_clone", derive(Clone))]
10803#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10804pub struct PaymentTypeInformation28 {
10805	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrPrty", skip_serializing_if = "Option::is_none") )]
10806	pub instr_prty: Option<Priority2Code>,
10807	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrChanl", skip_serializing_if = "Option::is_none") )]
10808	pub clr_chanl: Option<ClearingChannel2Code>,
10809	#[cfg_attr( feature = "derive_serde", serde(rename = "SvcLvl", skip_serializing_if = "Option::is_none") )]
10810	pub svc_lvl: Option<Vec<ServiceLevel8Choice>>,
10811	#[cfg_attr( feature = "derive_serde", serde(rename = "LclInstrm", skip_serializing_if = "Option::is_none") )]
10812	pub lcl_instrm: Option<LocalInstrument2Choice>,
10813	#[cfg_attr( feature = "derive_serde", serde(rename = "CtgyPurp", skip_serializing_if = "Option::is_none") )]
10814	pub ctgy_purp: Option<CategoryPurpose1Choice>,
10815}
10816
10817impl PaymentTypeInformation28 {
10818	pub fn validate(&self) -> Result<(), ValidationError> {
10819		if let Some(ref val) = self.instr_prty { val.validate()? }
10820		if let Some(ref val) = self.clr_chanl { val.validate()? }
10821		if let Some(ref vec) = self.svc_lvl { for item in vec { item.validate()? } }
10822		if let Some(ref val) = self.lcl_instrm { val.validate()? }
10823		if let Some(ref val) = self.ctgy_purp { val.validate()? }
10824		Ok(())
10825	}
10826}
10827
10828
10829// PersonIdentification13 ...
10830#[cfg_attr(feature = "derive_debug", derive(Debug))]
10831#[cfg_attr(feature = "derive_default", derive(Default))]
10832#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10833#[cfg_attr(feature = "derive_clone", derive(Clone))]
10834#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10835pub struct PersonIdentification13 {
10836	#[cfg_attr( feature = "derive_serde", serde(rename = "DtAndPlcOfBirth", skip_serializing_if = "Option::is_none") )]
10837	pub dt_and_plc_of_birth: Option<DateAndPlaceOfBirth1>,
10838	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
10839	pub othr: Option<Vec<GenericPersonIdentification1>>,
10840}
10841
10842impl PersonIdentification13 {
10843	pub fn validate(&self) -> Result<(), ValidationError> {
10844		if let Some(ref val) = self.dt_and_plc_of_birth { val.validate()? }
10845		if let Some(ref vec) = self.othr { for item in vec { item.validate()? } }
10846		Ok(())
10847	}
10848}
10849
10850
10851// PersonIdentificationSchemeName1Choice ...
10852#[cfg_attr(feature = "derive_debug", derive(Debug))]
10853#[cfg_attr(feature = "derive_default", derive(Default))]
10854#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10855#[cfg_attr(feature = "derive_clone", derive(Clone))]
10856#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10857pub struct PersonIdentificationSchemeName1Choice {
10858	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
10859	pub cd: Option<String>,
10860	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
10861	pub prtry: Option<String>,
10862}
10863
10864impl PersonIdentificationSchemeName1Choice {
10865	pub fn validate(&self) -> Result<(), ValidationError> {
10866		if let Some(ref val) = self.cd {
10867			if val.chars().count() < 1 {
10868				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
10869			}
10870			if val.chars().count() > 4 {
10871				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
10872			}
10873		}
10874		if let Some(ref val) = self.prtry {
10875			if val.chars().count() < 1 {
10876				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
10877			}
10878			if val.chars().count() > 35 {
10879				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
10880			}
10881		}
10882		Ok(())
10883	}
10884}
10885
10886
10887// PlainCardData1 ...
10888#[cfg_attr(feature = "derive_debug", derive(Debug))]
10889#[cfg_attr(feature = "derive_default", derive(Default))]
10890#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10891#[cfg_attr(feature = "derive_clone", derive(Clone))]
10892#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10893pub struct PlainCardData1 {
10894	#[cfg_attr( feature = "derive_serde", serde(rename = "PAN") )]
10895	pub pan: String,
10896	#[cfg_attr( feature = "derive_serde", serde(rename = "CardSeqNb", skip_serializing_if = "Option::is_none") )]
10897	pub card_seq_nb: Option<String>,
10898	#[cfg_attr( feature = "derive_serde", serde(rename = "FctvDt", skip_serializing_if = "Option::is_none") )]
10899	pub fctv_dt: Option<String>,
10900	#[cfg_attr( feature = "derive_serde", serde(rename = "XpryDt") )]
10901	pub xpry_dt: String,
10902	#[cfg_attr( feature = "derive_serde", serde(rename = "SvcCd", skip_serializing_if = "Option::is_none") )]
10903	pub svc_cd: Option<String>,
10904	#[cfg_attr( feature = "derive_serde", serde(rename = "TrckData", skip_serializing_if = "Option::is_none") )]
10905	pub trck_data: Option<Vec<TrackData1>>,
10906	#[cfg_attr( feature = "derive_serde", serde(rename = "CardSctyCd", skip_serializing_if = "Option::is_none") )]
10907	pub card_scty_cd: Option<CardSecurityInformation1>,
10908}
10909
10910impl PlainCardData1 {
10911	pub fn validate(&self) -> Result<(), ValidationError> {
10912		let pattern = Regex::new("[0-9]{8,28}").unwrap();
10913		if !pattern.is_match(&self.pan) {
10914			return Err(ValidationError::new(1005, "pan does not match the required pattern".to_string()));
10915		}
10916		if let Some(ref val) = self.card_seq_nb {
10917			let pattern = Regex::new("[0-9]{2,3}").unwrap();
10918			if !pattern.is_match(val) {
10919				return Err(ValidationError::new(1005, "card_seq_nb does not match the required pattern".to_string()));
10920			}
10921		}
10922		if let Some(ref val) = self.svc_cd {
10923			let pattern = Regex::new("[0-9]{3}").unwrap();
10924			if !pattern.is_match(val) {
10925				return Err(ValidationError::new(1005, "svc_cd does not match the required pattern".to_string()));
10926			}
10927		}
10928		if let Some(ref vec) = self.trck_data { for item in vec { item.validate()? } }
10929		if let Some(ref val) = self.card_scty_cd { val.validate()? }
10930		Ok(())
10931	}
10932}
10933
10934
10935// PointOfInteraction1 ...
10936#[cfg_attr(feature = "derive_debug", derive(Debug))]
10937#[cfg_attr(feature = "derive_default", derive(Default))]
10938#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10939#[cfg_attr(feature = "derive_clone", derive(Clone))]
10940#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10941pub struct PointOfInteraction1 {
10942	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
10943	pub id: GenericIdentification32,
10944	#[cfg_attr( feature = "derive_serde", serde(rename = "SysNm", skip_serializing_if = "Option::is_none") )]
10945	pub sys_nm: Option<String>,
10946	#[cfg_attr( feature = "derive_serde", serde(rename = "GrpId", skip_serializing_if = "Option::is_none") )]
10947	pub grp_id: Option<String>,
10948	#[cfg_attr( feature = "derive_serde", serde(rename = "Cpblties", skip_serializing_if = "Option::is_none") )]
10949	pub cpblties: Option<PointOfInteractionCapabilities1>,
10950	#[cfg_attr( feature = "derive_serde", serde(rename = "Cmpnt", skip_serializing_if = "Option::is_none") )]
10951	pub cmpnt: Option<Vec<PointOfInteractionComponent1>>,
10952}
10953
10954impl PointOfInteraction1 {
10955	pub fn validate(&self) -> Result<(), ValidationError> {
10956		self.id.validate()?;
10957		if let Some(ref val) = self.sys_nm {
10958			if val.chars().count() < 1 {
10959				return Err(ValidationError::new(1001, "sys_nm is shorter than the minimum length of 1".to_string()));
10960			}
10961			if val.chars().count() > 70 {
10962				return Err(ValidationError::new(1002, "sys_nm exceeds the maximum length of 70".to_string()));
10963			}
10964		}
10965		if let Some(ref val) = self.grp_id {
10966			if val.chars().count() < 1 {
10967				return Err(ValidationError::new(1001, "grp_id is shorter than the minimum length of 1".to_string()));
10968			}
10969			if val.chars().count() > 35 {
10970				return Err(ValidationError::new(1002, "grp_id exceeds the maximum length of 35".to_string()));
10971			}
10972		}
10973		if let Some(ref val) = self.cpblties { val.validate()? }
10974		if let Some(ref vec) = self.cmpnt { for item in vec { item.validate()? } }
10975		Ok(())
10976	}
10977}
10978
10979
10980// PointOfInteractionCapabilities1 ...
10981#[cfg_attr(feature = "derive_debug", derive(Debug))]
10982#[cfg_attr(feature = "derive_default", derive(Default))]
10983#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
10984#[cfg_attr(feature = "derive_clone", derive(Clone))]
10985#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
10986pub struct PointOfInteractionCapabilities1 {
10987	#[cfg_attr( feature = "derive_serde", serde(rename = "CardRdngCpblties", skip_serializing_if = "Option::is_none") )]
10988	pub card_rdng_cpblties: Option<Vec<CardDataReading1Code>>,
10989	#[cfg_attr( feature = "derive_serde", serde(rename = "CrdhldrVrfctnCpblties", skip_serializing_if = "Option::is_none") )]
10990	pub crdhldr_vrfctn_cpblties: Option<Vec<CardholderVerificationCapability1Code>>,
10991	#[cfg_attr( feature = "derive_serde", serde(rename = "OnLineCpblties", skip_serializing_if = "Option::is_none") )]
10992	pub on_line_cpblties: Option<OnLineCapability1Code>,
10993	#[cfg_attr( feature = "derive_serde", serde(rename = "DispCpblties", skip_serializing_if = "Option::is_none") )]
10994	pub disp_cpblties: Option<Vec<DisplayCapabilities1>>,
10995	#[cfg_attr( feature = "derive_serde", serde(rename = "PrtLineWidth", skip_serializing_if = "Option::is_none") )]
10996	pub prt_line_width: Option<String>,
10997}
10998
10999impl PointOfInteractionCapabilities1 {
11000	pub fn validate(&self) -> Result<(), ValidationError> {
11001		if let Some(ref vec) = self.card_rdng_cpblties { for item in vec { item.validate()? } }
11002		if let Some(ref vec) = self.crdhldr_vrfctn_cpblties { for item in vec { item.validate()? } }
11003		if let Some(ref val) = self.on_line_cpblties { val.validate()? }
11004		if let Some(ref vec) = self.disp_cpblties { for item in vec { item.validate()? } }
11005		if let Some(ref val) = self.prt_line_width {
11006			let pattern = Regex::new("[0-9]{1,3}").unwrap();
11007			if !pattern.is_match(val) {
11008				return Err(ValidationError::new(1005, "prt_line_width does not match the required pattern".to_string()));
11009			}
11010		}
11011		Ok(())
11012	}
11013}
11014
11015
11016// PointOfInteractionComponent1 ...
11017#[cfg_attr(feature = "derive_debug", derive(Debug))]
11018#[cfg_attr(feature = "derive_default", derive(Default))]
11019#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11020#[cfg_attr(feature = "derive_clone", derive(Clone))]
11021#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11022pub struct PointOfInteractionComponent1 {
11023	#[cfg_attr( feature = "derive_serde", serde(rename = "POICmpntTp") )]
11024	pub poi_cmpnt_tp: POIComponentType1Code,
11025	#[cfg_attr( feature = "derive_serde", serde(rename = "ManfctrId", skip_serializing_if = "Option::is_none") )]
11026	pub manfctr_id: Option<String>,
11027	#[cfg_attr( feature = "derive_serde", serde(rename = "Mdl", skip_serializing_if = "Option::is_none") )]
11028	pub mdl: Option<String>,
11029	#[cfg_attr( feature = "derive_serde", serde(rename = "VrsnNb", skip_serializing_if = "Option::is_none") )]
11030	pub vrsn_nb: Option<String>,
11031	#[cfg_attr( feature = "derive_serde", serde(rename = "SrlNb", skip_serializing_if = "Option::is_none") )]
11032	pub srl_nb: Option<String>,
11033	#[cfg_attr( feature = "derive_serde", serde(rename = "ApprvlNb", skip_serializing_if = "Option::is_none") )]
11034	pub apprvl_nb: Option<Vec<String>>,
11035}
11036
11037impl PointOfInteractionComponent1 {
11038	pub fn validate(&self) -> Result<(), ValidationError> {
11039		self.poi_cmpnt_tp.validate()?;
11040		if let Some(ref val) = self.manfctr_id {
11041			if val.chars().count() < 1 {
11042				return Err(ValidationError::new(1001, "manfctr_id is shorter than the minimum length of 1".to_string()));
11043			}
11044			if val.chars().count() > 35 {
11045				return Err(ValidationError::new(1002, "manfctr_id exceeds the maximum length of 35".to_string()));
11046			}
11047		}
11048		if let Some(ref val) = self.mdl {
11049			if val.chars().count() < 1 {
11050				return Err(ValidationError::new(1001, "mdl is shorter than the minimum length of 1".to_string()));
11051			}
11052			if val.chars().count() > 35 {
11053				return Err(ValidationError::new(1002, "mdl exceeds the maximum length of 35".to_string()));
11054			}
11055		}
11056		if let Some(ref val) = self.vrsn_nb {
11057			if val.chars().count() < 1 {
11058				return Err(ValidationError::new(1001, "vrsn_nb is shorter than the minimum length of 1".to_string()));
11059			}
11060			if val.chars().count() > 16 {
11061				return Err(ValidationError::new(1002, "vrsn_nb exceeds the maximum length of 16".to_string()));
11062			}
11063		}
11064		if let Some(ref val) = self.srl_nb {
11065			if val.chars().count() < 1 {
11066				return Err(ValidationError::new(1001, "srl_nb is shorter than the minimum length of 1".to_string()));
11067			}
11068			if val.chars().count() > 35 {
11069				return Err(ValidationError::new(1002, "srl_nb exceeds the maximum length of 35".to_string()));
11070			}
11071		}
11072		if let Some(ref vec) = self.apprvl_nb {
11073			for item in vec {
11074				if item.chars().count() < 1 {
11075					return Err(ValidationError::new(1001, "apprvl_nb is shorter than the minimum length of 1".to_string()));
11076				}
11077				if item.chars().count() > 70 {
11078					return Err(ValidationError::new(1002, "apprvl_nb exceeds the maximum length of 70".to_string()));
11079				}
11080			}
11081		}
11082		Ok(())
11083	}
11084}
11085
11086
11087// PostalAddress1 ...
11088#[cfg_attr(feature = "derive_debug", derive(Debug))]
11089#[cfg_attr(feature = "derive_default", derive(Default))]
11090#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11091#[cfg_attr(feature = "derive_clone", derive(Clone))]
11092#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11093pub struct PostalAddress1 {
11094	#[cfg_attr( feature = "derive_serde", serde(rename = "AdrTp", skip_serializing_if = "Option::is_none") )]
11095	pub adr_tp: Option<AddressType2Code>,
11096	#[cfg_attr( feature = "derive_serde", serde(rename = "AdrLine", skip_serializing_if = "Option::is_none") )]
11097	pub adr_line: Option<Vec<String>>,
11098	#[cfg_attr( feature = "derive_serde", serde(rename = "StrtNm", skip_serializing_if = "Option::is_none") )]
11099	pub strt_nm: Option<String>,
11100	#[cfg_attr( feature = "derive_serde", serde(rename = "BldgNb", skip_serializing_if = "Option::is_none") )]
11101	pub bldg_nb: Option<String>,
11102	#[cfg_attr( feature = "derive_serde", serde(rename = "PstCd", skip_serializing_if = "Option::is_none") )]
11103	pub pst_cd: Option<String>,
11104	#[cfg_attr( feature = "derive_serde", serde(rename = "TwnNm", skip_serializing_if = "Option::is_none") )]
11105	pub twn_nm: Option<String>,
11106	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none") )]
11107	pub ctry_sub_dvsn: Option<String>,
11108	#[cfg_attr( feature = "derive_serde", serde(rename = "Ctry") )]
11109	pub ctry: String,
11110}
11111
11112impl PostalAddress1 {
11113	pub fn validate(&self) -> Result<(), ValidationError> {
11114		if let Some(ref val) = self.adr_tp { val.validate()? }
11115		if let Some(ref vec) = self.adr_line {
11116			for item in vec {
11117				if item.chars().count() < 1 {
11118					return Err(ValidationError::new(1001, "adr_line is shorter than the minimum length of 1".to_string()));
11119				}
11120				if item.chars().count() > 70 {
11121					return Err(ValidationError::new(1002, "adr_line exceeds the maximum length of 70".to_string()));
11122				}
11123			}
11124		}
11125		if let Some(ref val) = self.strt_nm {
11126			if val.chars().count() < 1 {
11127				return Err(ValidationError::new(1001, "strt_nm is shorter than the minimum length of 1".to_string()));
11128			}
11129			if val.chars().count() > 70 {
11130				return Err(ValidationError::new(1002, "strt_nm exceeds the maximum length of 70".to_string()));
11131			}
11132		}
11133		if let Some(ref val) = self.bldg_nb {
11134			if val.chars().count() < 1 {
11135				return Err(ValidationError::new(1001, "bldg_nb is shorter than the minimum length of 1".to_string()));
11136			}
11137			if val.chars().count() > 16 {
11138				return Err(ValidationError::new(1002, "bldg_nb exceeds the maximum length of 16".to_string()));
11139			}
11140		}
11141		if let Some(ref val) = self.pst_cd {
11142			if val.chars().count() < 1 {
11143				return Err(ValidationError::new(1001, "pst_cd is shorter than the minimum length of 1".to_string()));
11144			}
11145			if val.chars().count() > 16 {
11146				return Err(ValidationError::new(1002, "pst_cd exceeds the maximum length of 16".to_string()));
11147			}
11148		}
11149		if let Some(ref val) = self.twn_nm {
11150			if val.chars().count() < 1 {
11151				return Err(ValidationError::new(1001, "twn_nm is shorter than the minimum length of 1".to_string()));
11152			}
11153			if val.chars().count() > 35 {
11154				return Err(ValidationError::new(1002, "twn_nm exceeds the maximum length of 35".to_string()));
11155			}
11156		}
11157		if let Some(ref val) = self.ctry_sub_dvsn {
11158			if val.chars().count() < 1 {
11159				return Err(ValidationError::new(1001, "ctry_sub_dvsn is shorter than the minimum length of 1".to_string()));
11160			}
11161			if val.chars().count() > 35 {
11162				return Err(ValidationError::new(1002, "ctry_sub_dvsn exceeds the maximum length of 35".to_string()));
11163			}
11164		}
11165		let pattern = Regex::new("[A-Z]{2,2}").unwrap();
11166		if !pattern.is_match(&self.ctry) {
11167			return Err(ValidationError::new(1005, "ctry does not match the required pattern".to_string()));
11168		}
11169		Ok(())
11170	}
11171}
11172
11173
11174// PostalAddress24 ...
11175#[cfg_attr(feature = "derive_debug", derive(Debug))]
11176#[cfg_attr(feature = "derive_default", derive(Default))]
11177#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11178#[cfg_attr(feature = "derive_clone", derive(Clone))]
11179#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11180pub struct PostalAddress24 {
11181	#[cfg_attr( feature = "derive_serde", serde(rename = "AdrTp", skip_serializing_if = "Option::is_none") )]
11182	pub adr_tp: Option<AddressType3Choice>,
11183	#[cfg_attr( feature = "derive_serde", serde(rename = "Dept", skip_serializing_if = "Option::is_none") )]
11184	pub dept: Option<String>,
11185	#[cfg_attr( feature = "derive_serde", serde(rename = "SubDept", skip_serializing_if = "Option::is_none") )]
11186	pub sub_dept: Option<String>,
11187	#[cfg_attr( feature = "derive_serde", serde(rename = "StrtNm", skip_serializing_if = "Option::is_none") )]
11188	pub strt_nm: Option<String>,
11189	#[cfg_attr( feature = "derive_serde", serde(rename = "BldgNb", skip_serializing_if = "Option::is_none") )]
11190	pub bldg_nb: Option<String>,
11191	#[cfg_attr( feature = "derive_serde", serde(rename = "BldgNm", skip_serializing_if = "Option::is_none") )]
11192	pub bldg_nm: Option<String>,
11193	#[cfg_attr( feature = "derive_serde", serde(rename = "Flr", skip_serializing_if = "Option::is_none") )]
11194	pub flr: Option<String>,
11195	#[cfg_attr( feature = "derive_serde", serde(rename = "PstBx", skip_serializing_if = "Option::is_none") )]
11196	pub pst_bx: Option<String>,
11197	#[cfg_attr( feature = "derive_serde", serde(rename = "Room", skip_serializing_if = "Option::is_none") )]
11198	pub room: Option<String>,
11199	#[cfg_attr( feature = "derive_serde", serde(rename = "PstCd", skip_serializing_if = "Option::is_none") )]
11200	pub pst_cd: Option<String>,
11201	#[cfg_attr( feature = "derive_serde", serde(rename = "TwnNm", skip_serializing_if = "Option::is_none") )]
11202	pub twn_nm: Option<String>,
11203	#[cfg_attr( feature = "derive_serde", serde(rename = "TwnLctnNm", skip_serializing_if = "Option::is_none") )]
11204	pub twn_lctn_nm: Option<String>,
11205	#[cfg_attr( feature = "derive_serde", serde(rename = "DstrctNm", skip_serializing_if = "Option::is_none") )]
11206	pub dstrct_nm: Option<String>,
11207	#[cfg_attr( feature = "derive_serde", serde(rename = "CtrySubDvsn", skip_serializing_if = "Option::is_none") )]
11208	pub ctry_sub_dvsn: Option<String>,
11209	#[cfg_attr( feature = "derive_serde", serde(rename = "Ctry", skip_serializing_if = "Option::is_none") )]
11210	pub ctry: Option<String>,
11211	#[cfg_attr( feature = "derive_serde", serde(rename = "AdrLine", skip_serializing_if = "Option::is_none") )]
11212	pub adr_line: Option<Vec<String>>,
11213}
11214
11215impl PostalAddress24 {
11216	pub fn validate(&self) -> Result<(), ValidationError> {
11217		if let Some(ref val) = self.adr_tp { val.validate()? }
11218		if let Some(ref val) = self.dept {
11219			if val.chars().count() < 1 {
11220				return Err(ValidationError::new(1001, "dept is shorter than the minimum length of 1".to_string()));
11221			}
11222			if val.chars().count() > 70 {
11223				return Err(ValidationError::new(1002, "dept exceeds the maximum length of 70".to_string()));
11224			}
11225		}
11226		if let Some(ref val) = self.sub_dept {
11227			if val.chars().count() < 1 {
11228				return Err(ValidationError::new(1001, "sub_dept is shorter than the minimum length of 1".to_string()));
11229			}
11230			if val.chars().count() > 70 {
11231				return Err(ValidationError::new(1002, "sub_dept exceeds the maximum length of 70".to_string()));
11232			}
11233		}
11234		if let Some(ref val) = self.strt_nm {
11235			if val.chars().count() < 1 {
11236				return Err(ValidationError::new(1001, "strt_nm is shorter than the minimum length of 1".to_string()));
11237			}
11238			if val.chars().count() > 70 {
11239				return Err(ValidationError::new(1002, "strt_nm exceeds the maximum length of 70".to_string()));
11240			}
11241		}
11242		if let Some(ref val) = self.bldg_nb {
11243			if val.chars().count() < 1 {
11244				return Err(ValidationError::new(1001, "bldg_nb is shorter than the minimum length of 1".to_string()));
11245			}
11246			if val.chars().count() > 16 {
11247				return Err(ValidationError::new(1002, "bldg_nb exceeds the maximum length of 16".to_string()));
11248			}
11249		}
11250		if let Some(ref val) = self.bldg_nm {
11251			if val.chars().count() < 1 {
11252				return Err(ValidationError::new(1001, "bldg_nm is shorter than the minimum length of 1".to_string()));
11253			}
11254			if val.chars().count() > 35 {
11255				return Err(ValidationError::new(1002, "bldg_nm exceeds the maximum length of 35".to_string()));
11256			}
11257		}
11258		if let Some(ref val) = self.flr {
11259			if val.chars().count() < 1 {
11260				return Err(ValidationError::new(1001, "flr is shorter than the minimum length of 1".to_string()));
11261			}
11262			if val.chars().count() > 70 {
11263				return Err(ValidationError::new(1002, "flr exceeds the maximum length of 70".to_string()));
11264			}
11265		}
11266		if let Some(ref val) = self.pst_bx {
11267			if val.chars().count() < 1 {
11268				return Err(ValidationError::new(1001, "pst_bx is shorter than the minimum length of 1".to_string()));
11269			}
11270			if val.chars().count() > 16 {
11271				return Err(ValidationError::new(1002, "pst_bx exceeds the maximum length of 16".to_string()));
11272			}
11273		}
11274		if let Some(ref val) = self.room {
11275			if val.chars().count() < 1 {
11276				return Err(ValidationError::new(1001, "room is shorter than the minimum length of 1".to_string()));
11277			}
11278			if val.chars().count() > 70 {
11279				return Err(ValidationError::new(1002, "room exceeds the maximum length of 70".to_string()));
11280			}
11281		}
11282		if let Some(ref val) = self.pst_cd {
11283			if val.chars().count() < 1 {
11284				return Err(ValidationError::new(1001, "pst_cd is shorter than the minimum length of 1".to_string()));
11285			}
11286			if val.chars().count() > 16 {
11287				return Err(ValidationError::new(1002, "pst_cd exceeds the maximum length of 16".to_string()));
11288			}
11289		}
11290		if let Some(ref val) = self.twn_nm {
11291			if val.chars().count() < 1 {
11292				return Err(ValidationError::new(1001, "twn_nm is shorter than the minimum length of 1".to_string()));
11293			}
11294			if val.chars().count() > 35 {
11295				return Err(ValidationError::new(1002, "twn_nm exceeds the maximum length of 35".to_string()));
11296			}
11297		}
11298		if let Some(ref val) = self.twn_lctn_nm {
11299			if val.chars().count() < 1 {
11300				return Err(ValidationError::new(1001, "twn_lctn_nm is shorter than the minimum length of 1".to_string()));
11301			}
11302			if val.chars().count() > 35 {
11303				return Err(ValidationError::new(1002, "twn_lctn_nm exceeds the maximum length of 35".to_string()));
11304			}
11305		}
11306		if let Some(ref val) = self.dstrct_nm {
11307			if val.chars().count() < 1 {
11308				return Err(ValidationError::new(1001, "dstrct_nm is shorter than the minimum length of 1".to_string()));
11309			}
11310			if val.chars().count() > 35 {
11311				return Err(ValidationError::new(1002, "dstrct_nm exceeds the maximum length of 35".to_string()));
11312			}
11313		}
11314		if let Some(ref val) = self.ctry_sub_dvsn {
11315			if val.chars().count() < 1 {
11316				return Err(ValidationError::new(1001, "ctry_sub_dvsn is shorter than the minimum length of 1".to_string()));
11317			}
11318			if val.chars().count() > 35 {
11319				return Err(ValidationError::new(1002, "ctry_sub_dvsn exceeds the maximum length of 35".to_string()));
11320			}
11321		}
11322		if let Some(ref val) = self.ctry {
11323			let pattern = Regex::new("[A-Z]{2,2}").unwrap();
11324			if !pattern.is_match(val) {
11325				return Err(ValidationError::new(1005, "ctry does not match the required pattern".to_string()));
11326			}
11327		}
11328		if let Some(ref vec) = self.adr_line {
11329			for item in vec {
11330				if item.chars().count() < 1 {
11331					return Err(ValidationError::new(1001, "adr_line is shorter than the minimum length of 1".to_string()));
11332				}
11333				if item.chars().count() > 70 {
11334					return Err(ValidationError::new(1002, "adr_line exceeds the maximum length of 70".to_string()));
11335				}
11336			}
11337		}
11338		Ok(())
11339	}
11340}
11341
11342
11343// PreferredContactMethod1Code ...
11344#[cfg_attr(feature = "derive_debug", derive(Debug))]
11345#[cfg_attr(feature = "derive_default", derive(Default))]
11346#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11347#[cfg_attr(feature = "derive_clone", derive(Clone))]
11348#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11349pub enum PreferredContactMethod1Code {
11350	#[cfg_attr(feature = "derive_default", default)]
11351	#[cfg_attr( feature = "derive_serde", serde(rename = "LETT") )]
11352	CodeLETT,
11353	#[cfg_attr( feature = "derive_serde", serde(rename = "MAIL") )]
11354	CodeMAIL,
11355	#[cfg_attr( feature = "derive_serde", serde(rename = "PHON") )]
11356	CodePHON,
11357	#[cfg_attr( feature = "derive_serde", serde(rename = "FAXX") )]
11358	CodeFAXX,
11359	#[cfg_attr( feature = "derive_serde", serde(rename = "CELL") )]
11360	CodeCELL,
11361}
11362
11363impl PreferredContactMethod1Code {
11364	pub fn validate(&self) -> Result<(), ValidationError> {
11365		Ok(())
11366	}
11367}
11368
11369
11370// Price7 ...
11371#[cfg_attr(feature = "derive_debug", derive(Debug))]
11372#[cfg_attr(feature = "derive_default", derive(Default))]
11373#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11374#[cfg_attr(feature = "derive_clone", derive(Clone))]
11375#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11376pub struct Price7 {
11377	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11378	pub tp: YieldedOrValueType1Choice,
11379	#[cfg_attr( feature = "derive_serde", serde(rename = "Val") )]
11380	pub val: PriceRateOrAmount3Choice,
11381}
11382
11383impl Price7 {
11384	pub fn validate(&self) -> Result<(), ValidationError> {
11385		self.tp.validate()?;
11386		self.val.validate()?;
11387		Ok(())
11388	}
11389}
11390
11391
11392// PriceRateOrAmount3Choice ...
11393#[cfg_attr(feature = "derive_debug", derive(Debug))]
11394#[cfg_attr(feature = "derive_default", derive(Default))]
11395#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11396#[cfg_attr(feature = "derive_clone", derive(Clone))]
11397#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11398pub struct PriceRateOrAmount3Choice {
11399	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
11400	pub rate: Option<f64>,
11401	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
11402	pub amt: Option<ActiveOrHistoricCurrencyAnd13DecimalAmount>,
11403}
11404
11405impl PriceRateOrAmount3Choice {
11406	pub fn validate(&self) -> Result<(), ValidationError> {
11407		if let Some(ref val) = self.amt { val.validate()? }
11408		Ok(())
11409	}
11410}
11411
11412
11413// PriceValueType1Code ...
11414#[cfg_attr(feature = "derive_debug", derive(Debug))]
11415#[cfg_attr(feature = "derive_default", derive(Default))]
11416#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11417#[cfg_attr(feature = "derive_clone", derive(Clone))]
11418#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11419pub enum PriceValueType1Code {
11420	#[cfg_attr(feature = "derive_default", default)]
11421	#[cfg_attr( feature = "derive_serde", serde(rename = "DISC") )]
11422	CodeDISC,
11423	#[cfg_attr( feature = "derive_serde", serde(rename = "PREM") )]
11424	CodePREM,
11425	#[cfg_attr( feature = "derive_serde", serde(rename = "PARV") )]
11426	CodePARV,
11427}
11428
11429impl PriceValueType1Code {
11430	pub fn validate(&self) -> Result<(), ValidationError> {
11431		Ok(())
11432	}
11433}
11434
11435
11436// Priority2Code ...
11437#[cfg_attr(feature = "derive_debug", derive(Debug))]
11438#[cfg_attr(feature = "derive_default", derive(Default))]
11439#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11440#[cfg_attr(feature = "derive_clone", derive(Clone))]
11441#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11442pub enum Priority2Code {
11443	#[cfg_attr(feature = "derive_default", default)]
11444	#[cfg_attr( feature = "derive_serde", serde(rename = "HIGH") )]
11445	CodeHIGH,
11446	#[cfg_attr( feature = "derive_serde", serde(rename = "NORM") )]
11447	CodeNORM,
11448}
11449
11450impl Priority2Code {
11451	pub fn validate(&self) -> Result<(), ValidationError> {
11452		Ok(())
11453	}
11454}
11455
11456
11457// Priority3Code ...
11458#[cfg_attr(feature = "derive_debug", derive(Debug))]
11459#[cfg_attr(feature = "derive_default", derive(Default))]
11460#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11461#[cfg_attr(feature = "derive_clone", derive(Clone))]
11462#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11463pub enum Priority3Code {
11464	#[cfg_attr(feature = "derive_default", default)]
11465	#[cfg_attr( feature = "derive_serde", serde(rename = "URGT") )]
11466	CodeURGT,
11467	#[cfg_attr( feature = "derive_serde", serde(rename = "HIGH") )]
11468	CodeHIGH,
11469	#[cfg_attr( feature = "derive_serde", serde(rename = "NORM") )]
11470	CodeNORM,
11471}
11472
11473impl Priority3Code {
11474	pub fn validate(&self) -> Result<(), ValidationError> {
11475		Ok(())
11476	}
11477}
11478
11479
11480// Product2 ...
11481#[cfg_attr(feature = "derive_debug", derive(Debug))]
11482#[cfg_attr(feature = "derive_default", derive(Default))]
11483#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11484#[cfg_attr(feature = "derive_clone", derive(Clone))]
11485#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11486pub struct Product2 {
11487	#[cfg_attr( feature = "derive_serde", serde(rename = "PdctCd") )]
11488	pub pdct_cd: String,
11489	#[cfg_attr( feature = "derive_serde", serde(rename = "UnitOfMeasr", skip_serializing_if = "Option::is_none") )]
11490	pub unit_of_measr: Option<UnitOfMeasure1Code>,
11491	#[cfg_attr( feature = "derive_serde", serde(rename = "PdctQty", skip_serializing_if = "Option::is_none") )]
11492	pub pdct_qty: Option<f64>,
11493	#[cfg_attr( feature = "derive_serde", serde(rename = "UnitPric", skip_serializing_if = "Option::is_none") )]
11494	pub unit_pric: Option<f64>,
11495	#[cfg_attr( feature = "derive_serde", serde(rename = "PdctAmt", skip_serializing_if = "Option::is_none") )]
11496	pub pdct_amt: Option<f64>,
11497	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxTp", skip_serializing_if = "Option::is_none") )]
11498	pub tax_tp: Option<String>,
11499	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlPdctInf", skip_serializing_if = "Option::is_none") )]
11500	pub addtl_pdct_inf: Option<String>,
11501}
11502
11503impl Product2 {
11504	pub fn validate(&self) -> Result<(), ValidationError> {
11505		if self.pdct_cd.chars().count() < 1 {
11506			return Err(ValidationError::new(1001, "pdct_cd is shorter than the minimum length of 1".to_string()));
11507		}
11508		if self.pdct_cd.chars().count() > 70 {
11509			return Err(ValidationError::new(1002, "pdct_cd exceeds the maximum length of 70".to_string()));
11510		}
11511		if let Some(ref val) = self.unit_of_measr { val.validate()? }
11512		if let Some(ref val) = self.tax_tp {
11513			if val.chars().count() < 1 {
11514				return Err(ValidationError::new(1001, "tax_tp is shorter than the minimum length of 1".to_string()));
11515			}
11516			if val.chars().count() > 35 {
11517				return Err(ValidationError::new(1002, "tax_tp exceeds the maximum length of 35".to_string()));
11518			}
11519		}
11520		if let Some(ref val) = self.addtl_pdct_inf {
11521			if val.chars().count() < 1 {
11522				return Err(ValidationError::new(1001, "addtl_pdct_inf is shorter than the minimum length of 1".to_string()));
11523			}
11524			if val.chars().count() > 35 {
11525				return Err(ValidationError::new(1002, "addtl_pdct_inf exceeds the maximum length of 35".to_string()));
11526			}
11527		}
11528		Ok(())
11529	}
11530}
11531
11532
11533// ProprietaryAgent4 ...
11534#[cfg_attr(feature = "derive_debug", derive(Debug))]
11535#[cfg_attr(feature = "derive_default", derive(Default))]
11536#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11537#[cfg_attr(feature = "derive_clone", derive(Clone))]
11538#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11539pub struct ProprietaryAgent4 {
11540	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11541	pub tp: String,
11542	#[cfg_attr( feature = "derive_serde", serde(rename = "Agt") )]
11543	pub agt: BranchAndFinancialInstitutionIdentification6,
11544}
11545
11546impl ProprietaryAgent4 {
11547	pub fn validate(&self) -> Result<(), ValidationError> {
11548		if self.tp.chars().count() < 1 {
11549			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11550		}
11551		if self.tp.chars().count() > 35 {
11552			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11553		}
11554		self.agt.validate()?;
11555		Ok(())
11556	}
11557}
11558
11559
11560// ProprietaryBankTransactionCodeStructure1 ...
11561#[cfg_attr(feature = "derive_debug", derive(Debug))]
11562#[cfg_attr(feature = "derive_default", derive(Default))]
11563#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11564#[cfg_attr(feature = "derive_clone", derive(Clone))]
11565#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11566pub struct ProprietaryBankTransactionCodeStructure1 {
11567	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd") )]
11568	pub cd: String,
11569	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
11570	pub issr: Option<String>,
11571}
11572
11573impl ProprietaryBankTransactionCodeStructure1 {
11574	pub fn validate(&self) -> Result<(), ValidationError> {
11575		if self.cd.chars().count() < 1 {
11576			return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
11577		}
11578		if self.cd.chars().count() > 35 {
11579			return Err(ValidationError::new(1002, "cd exceeds the maximum length of 35".to_string()));
11580		}
11581		if let Some(ref val) = self.issr {
11582			if val.chars().count() < 1 {
11583				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
11584			}
11585			if val.chars().count() > 35 {
11586				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
11587			}
11588		}
11589		Ok(())
11590	}
11591}
11592
11593
11594// ProprietaryData5 ...
11595#[cfg_attr(feature = "derive_debug", derive(Debug))]
11596#[cfg_attr(feature = "derive_default", derive(Default))]
11597#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11598#[cfg_attr(feature = "derive_clone", derive(Clone))]
11599#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11600pub struct ProprietaryData5 {
11601	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11602	pub tp: String,
11603	#[cfg_attr( feature = "derive_serde", serde(rename = "Data") )]
11604	pub data: SupplementaryDataEnvelope1,
11605}
11606
11607impl ProprietaryData5 {
11608	pub fn validate(&self) -> Result<(), ValidationError> {
11609		if self.tp.chars().count() < 1 {
11610			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11611		}
11612		if self.tp.chars().count() > 35 {
11613			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11614		}
11615		self.data.validate()?;
11616		Ok(())
11617	}
11618}
11619
11620
11621// ProprietaryDate3 ...
11622#[cfg_attr(feature = "derive_debug", derive(Debug))]
11623#[cfg_attr(feature = "derive_default", derive(Default))]
11624#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11625#[cfg_attr(feature = "derive_clone", derive(Clone))]
11626#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11627pub struct ProprietaryDate3 {
11628	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11629	pub tp: String,
11630	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt") )]
11631	pub dt: DateAndDateTime2Choice,
11632}
11633
11634impl ProprietaryDate3 {
11635	pub fn validate(&self) -> Result<(), ValidationError> {
11636		if self.tp.chars().count() < 1 {
11637			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11638		}
11639		if self.tp.chars().count() > 35 {
11640			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11641		}
11642		self.dt.validate()?;
11643		Ok(())
11644	}
11645}
11646
11647
11648// ProprietaryParty5 ...
11649#[cfg_attr(feature = "derive_debug", derive(Debug))]
11650#[cfg_attr(feature = "derive_default", derive(Default))]
11651#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11652#[cfg_attr(feature = "derive_clone", derive(Clone))]
11653#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11654pub struct ProprietaryParty5 {
11655	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11656	pub tp: String,
11657	#[cfg_attr( feature = "derive_serde", serde(rename = "Pty") )]
11658	pub pty: Party40Choice,
11659}
11660
11661impl ProprietaryParty5 {
11662	pub fn validate(&self) -> Result<(), ValidationError> {
11663		if self.tp.chars().count() < 1 {
11664			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11665		}
11666		if self.tp.chars().count() > 35 {
11667			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11668		}
11669		self.pty.validate()?;
11670		Ok(())
11671	}
11672}
11673
11674
11675// ProprietaryPrice2 ...
11676#[cfg_attr(feature = "derive_debug", derive(Debug))]
11677#[cfg_attr(feature = "derive_default", derive(Default))]
11678#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11679#[cfg_attr(feature = "derive_clone", derive(Clone))]
11680#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11681pub struct ProprietaryPrice2 {
11682	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11683	pub tp: String,
11684	#[cfg_attr( feature = "derive_serde", serde(rename = "Pric") )]
11685	pub pric: ActiveOrHistoricCurrencyAndAmount,
11686}
11687
11688impl ProprietaryPrice2 {
11689	pub fn validate(&self) -> Result<(), ValidationError> {
11690		if self.tp.chars().count() < 1 {
11691			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11692		}
11693		if self.tp.chars().count() > 35 {
11694			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11695		}
11696		self.pric.validate()?;
11697		Ok(())
11698	}
11699}
11700
11701
11702// ProprietaryQuantity1 ...
11703#[cfg_attr(feature = "derive_debug", derive(Debug))]
11704#[cfg_attr(feature = "derive_default", derive(Default))]
11705#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11706#[cfg_attr(feature = "derive_clone", derive(Clone))]
11707#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11708pub struct ProprietaryQuantity1 {
11709	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11710	pub tp: String,
11711	#[cfg_attr( feature = "derive_serde", serde(rename = "Qty") )]
11712	pub qty: String,
11713}
11714
11715impl ProprietaryQuantity1 {
11716	pub fn validate(&self) -> Result<(), ValidationError> {
11717		if self.tp.chars().count() < 1 {
11718			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11719		}
11720		if self.tp.chars().count() > 35 {
11721			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11722		}
11723		if self.qty.chars().count() < 1 {
11724			return Err(ValidationError::new(1001, "qty is shorter than the minimum length of 1".to_string()));
11725		}
11726		if self.qty.chars().count() > 35 {
11727			return Err(ValidationError::new(1002, "qty exceeds the maximum length of 35".to_string()));
11728		}
11729		Ok(())
11730	}
11731}
11732
11733
11734// ProprietaryReference1 ...
11735#[cfg_attr(feature = "derive_debug", derive(Debug))]
11736#[cfg_attr(feature = "derive_default", derive(Default))]
11737#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11738#[cfg_attr(feature = "derive_clone", derive(Clone))]
11739#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11740pub struct ProprietaryReference1 {
11741	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11742	pub tp: String,
11743	#[cfg_attr( feature = "derive_serde", serde(rename = "Ref") )]
11744	pub ref_attr: String,
11745}
11746
11747impl ProprietaryReference1 {
11748	pub fn validate(&self) -> Result<(), ValidationError> {
11749		if self.tp.chars().count() < 1 {
11750			return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
11751		}
11752		if self.tp.chars().count() > 35 {
11753			return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
11754		}
11755		if self.ref_attr.chars().count() < 1 {
11756			return Err(ValidationError::new(1001, "ref_attr is shorter than the minimum length of 1".to_string()));
11757		}
11758		if self.ref_attr.chars().count() > 35 {
11759			return Err(ValidationError::new(1002, "ref_attr exceeds the maximum length of 35".to_string()));
11760		}
11761		Ok(())
11762	}
11763}
11764
11765
11766// ProxyAccountIdentification1 ...
11767#[cfg_attr(feature = "derive_debug", derive(Debug))]
11768#[cfg_attr(feature = "derive_default", derive(Default))]
11769#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11770#[cfg_attr(feature = "derive_clone", derive(Clone))]
11771#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11772pub struct ProxyAccountIdentification1 {
11773	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
11774	pub tp: Option<ProxyAccountType1Choice>,
11775	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
11776	pub id: String,
11777}
11778
11779impl ProxyAccountIdentification1 {
11780	pub fn validate(&self) -> Result<(), ValidationError> {
11781		if let Some(ref val) = self.tp { val.validate()? }
11782		if self.id.chars().count() < 1 {
11783			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
11784		}
11785		if self.id.chars().count() > 2048 {
11786			return Err(ValidationError::new(1002, "id exceeds the maximum length of 2048".to_string()));
11787		}
11788		Ok(())
11789	}
11790}
11791
11792
11793// ProxyAccountType1Choice ...
11794#[cfg_attr(feature = "derive_debug", derive(Debug))]
11795#[cfg_attr(feature = "derive_default", derive(Default))]
11796#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11797#[cfg_attr(feature = "derive_clone", derive(Clone))]
11798#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11799pub struct ProxyAccountType1Choice {
11800	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
11801	pub cd: Option<String>,
11802	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
11803	pub prtry: Option<String>,
11804}
11805
11806impl ProxyAccountType1Choice {
11807	pub fn validate(&self) -> Result<(), ValidationError> {
11808		if let Some(ref val) = self.cd {
11809			if val.chars().count() < 1 {
11810				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
11811			}
11812			if val.chars().count() > 4 {
11813				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
11814			}
11815		}
11816		if let Some(ref val) = self.prtry {
11817			if val.chars().count() < 1 {
11818				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
11819			}
11820			if val.chars().count() > 35 {
11821				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
11822			}
11823		}
11824		Ok(())
11825	}
11826}
11827
11828
11829// Purpose2Choice ...
11830#[cfg_attr(feature = "derive_debug", derive(Debug))]
11831#[cfg_attr(feature = "derive_default", derive(Default))]
11832#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11833#[cfg_attr(feature = "derive_clone", derive(Clone))]
11834#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11835pub struct Purpose2Choice {
11836	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
11837	pub cd: Option<String>,
11838	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
11839	pub prtry: Option<String>,
11840}
11841
11842impl Purpose2Choice {
11843	pub fn validate(&self) -> Result<(), ValidationError> {
11844		if let Some(ref val) = self.cd {
11845			if val.chars().count() < 1 {
11846				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
11847			}
11848			if val.chars().count() > 4 {
11849				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
11850			}
11851		}
11852		if let Some(ref val) = self.prtry {
11853			if val.chars().count() < 1 {
11854				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
11855			}
11856			if val.chars().count() > 35 {
11857				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
11858			}
11859		}
11860		Ok(())
11861	}
11862}
11863
11864
11865// QueryType3Code ...
11866#[cfg_attr(feature = "derive_debug", derive(Debug))]
11867#[cfg_attr(feature = "derive_default", derive(Default))]
11868#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11869#[cfg_attr(feature = "derive_clone", derive(Clone))]
11870#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11871pub enum QueryType3Code {
11872	#[cfg_attr(feature = "derive_default", default)]
11873	#[cfg_attr( feature = "derive_serde", serde(rename = "ALLL") )]
11874	CodeALLL,
11875	#[cfg_attr( feature = "derive_serde", serde(rename = "CHNG") )]
11876	CodeCHNG,
11877	#[cfg_attr( feature = "derive_serde", serde(rename = "MODF") )]
11878	CodeMODF,
11879}
11880
11881impl QueryType3Code {
11882	pub fn validate(&self) -> Result<(), ValidationError> {
11883		Ok(())
11884	}
11885}
11886
11887
11888// Rate4 ...
11889#[cfg_attr(feature = "derive_debug", derive(Debug))]
11890#[cfg_attr(feature = "derive_default", derive(Default))]
11891#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11892#[cfg_attr(feature = "derive_clone", derive(Clone))]
11893#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11894pub struct Rate4 {
11895	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
11896	pub tp: RateType4Choice,
11897	#[cfg_attr( feature = "derive_serde", serde(rename = "VldtyRg", skip_serializing_if = "Option::is_none") )]
11898	pub vldty_rg: Option<ActiveOrHistoricCurrencyAndAmountRange2>,
11899}
11900
11901impl Rate4 {
11902	pub fn validate(&self) -> Result<(), ValidationError> {
11903		self.tp.validate()?;
11904		if let Some(ref val) = self.vldty_rg { val.validate()? }
11905		Ok(())
11906	}
11907}
11908
11909
11910// RateType4Choice ...
11911#[cfg_attr(feature = "derive_debug", derive(Debug))]
11912#[cfg_attr(feature = "derive_default", derive(Default))]
11913#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11914#[cfg_attr(feature = "derive_clone", derive(Clone))]
11915#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11916pub struct RateType4Choice {
11917	#[cfg_attr( feature = "derive_serde", serde(rename = "Pctg", skip_serializing_if = "Option::is_none") )]
11918	pub pctg: Option<f64>,
11919	#[cfg_attr( feature = "derive_serde", serde(rename = "Othr", skip_serializing_if = "Option::is_none") )]
11920	pub othr: Option<String>,
11921}
11922
11923impl RateType4Choice {
11924	pub fn validate(&self) -> Result<(), ValidationError> {
11925		if let Some(ref val) = self.othr {
11926			if val.chars().count() < 1 {
11927				return Err(ValidationError::new(1001, "othr is shorter than the minimum length of 1".to_string()));
11928			}
11929			if val.chars().count() > 35 {
11930				return Err(ValidationError::new(1002, "othr exceeds the maximum length of 35".to_string()));
11931			}
11932		}
11933		Ok(())
11934	}
11935}
11936
11937
11938// ReceiptAcknowledgementReport2 ...
11939#[cfg_attr(feature = "derive_debug", derive(Debug))]
11940#[cfg_attr(feature = "derive_default", derive(Default))]
11941#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11942#[cfg_attr(feature = "derive_clone", derive(Clone))]
11943#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11944pub struct ReceiptAcknowledgementReport2 {
11945	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdRef") )]
11946	pub rltd_ref: MessageReference1,
11947	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqHdlg") )]
11948	pub req_hdlg: RequestHandling2,
11949}
11950
11951impl ReceiptAcknowledgementReport2 {
11952	pub fn validate(&self) -> Result<(), ValidationError> {
11953		self.rltd_ref.validate()?;
11954		self.req_hdlg.validate()?;
11955		Ok(())
11956	}
11957}
11958
11959
11960// ReferredDocumentInformation7 ...
11961#[cfg_attr(feature = "derive_debug", derive(Debug))]
11962#[cfg_attr(feature = "derive_default", derive(Default))]
11963#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11964#[cfg_attr(feature = "derive_clone", derive(Clone))]
11965#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
11966pub struct ReferredDocumentInformation7 {
11967	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
11968	pub tp: Option<ReferredDocumentType4>,
11969	#[cfg_attr( feature = "derive_serde", serde(rename = "Nb", skip_serializing_if = "Option::is_none") )]
11970	pub nb: Option<String>,
11971	#[cfg_attr( feature = "derive_serde", serde(rename = "RltdDt", skip_serializing_if = "Option::is_none") )]
11972	pub rltd_dt: Option<String>,
11973	#[cfg_attr( feature = "derive_serde", serde(rename = "LineDtls", skip_serializing_if = "Option::is_none") )]
11974	pub line_dtls: Option<Vec<DocumentLineInformation1>>,
11975}
11976
11977impl ReferredDocumentInformation7 {
11978	pub fn validate(&self) -> Result<(), ValidationError> {
11979		if let Some(ref val) = self.tp { val.validate()? }
11980		if let Some(ref val) = self.nb {
11981			if val.chars().count() < 1 {
11982				return Err(ValidationError::new(1001, "nb is shorter than the minimum length of 1".to_string()));
11983			}
11984			if val.chars().count() > 35 {
11985				return Err(ValidationError::new(1002, "nb exceeds the maximum length of 35".to_string()));
11986			}
11987		}
11988		if let Some(ref vec) = self.line_dtls { for item in vec { item.validate()? } }
11989		Ok(())
11990	}
11991}
11992
11993
11994// ReferredDocumentType3Choice ...
11995#[cfg_attr(feature = "derive_debug", derive(Debug))]
11996#[cfg_attr(feature = "derive_default", derive(Default))]
11997#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
11998#[cfg_attr(feature = "derive_clone", derive(Clone))]
11999#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12000pub struct ReferredDocumentType3Choice {
12001	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
12002	pub cd: Option<DocumentType6Code>,
12003	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
12004	pub prtry: Option<String>,
12005}
12006
12007impl ReferredDocumentType3Choice {
12008	pub fn validate(&self) -> Result<(), ValidationError> {
12009		if let Some(ref val) = self.cd { val.validate()? }
12010		if let Some(ref val) = self.prtry {
12011			if val.chars().count() < 1 {
12012				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
12013			}
12014			if val.chars().count() > 35 {
12015				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
12016			}
12017		}
12018		Ok(())
12019	}
12020}
12021
12022
12023// ReferredDocumentType4 ...
12024#[cfg_attr(feature = "derive_debug", derive(Debug))]
12025#[cfg_attr(feature = "derive_default", derive(Default))]
12026#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12027#[cfg_attr(feature = "derive_clone", derive(Clone))]
12028#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12029pub struct ReferredDocumentType4 {
12030	#[cfg_attr( feature = "derive_serde", serde(rename = "CdOrPrtry") )]
12031	pub cd_or_prtry: ReferredDocumentType3Choice,
12032	#[cfg_attr( feature = "derive_serde", serde(rename = "Issr", skip_serializing_if = "Option::is_none") )]
12033	pub issr: Option<String>,
12034}
12035
12036impl ReferredDocumentType4 {
12037	pub fn validate(&self) -> Result<(), ValidationError> {
12038		self.cd_or_prtry.validate()?;
12039		if let Some(ref val) = self.issr {
12040			if val.chars().count() < 1 {
12041				return Err(ValidationError::new(1001, "issr is shorter than the minimum length of 1".to_string()));
12042			}
12043			if val.chars().count() > 35 {
12044				return Err(ValidationError::new(1002, "issr exceeds the maximum length of 35".to_string()));
12045			}
12046		}
12047		Ok(())
12048	}
12049}
12050
12051
12052// RegulatoryAuthority2 ...
12053#[cfg_attr(feature = "derive_debug", derive(Debug))]
12054#[cfg_attr(feature = "derive_default", derive(Default))]
12055#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12056#[cfg_attr(feature = "derive_clone", derive(Clone))]
12057#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12058pub struct RegulatoryAuthority2 {
12059	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
12060	pub nm: Option<String>,
12061	#[cfg_attr( feature = "derive_serde", serde(rename = "Ctry", skip_serializing_if = "Option::is_none") )]
12062	pub ctry: Option<String>,
12063}
12064
12065impl RegulatoryAuthority2 {
12066	pub fn validate(&self) -> Result<(), ValidationError> {
12067		if let Some(ref val) = self.nm {
12068			if val.chars().count() < 1 {
12069				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
12070			}
12071			if val.chars().count() > 140 {
12072				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
12073			}
12074		}
12075		if let Some(ref val) = self.ctry {
12076			let pattern = Regex::new("[A-Z]{2,2}").unwrap();
12077			if !pattern.is_match(val) {
12078				return Err(ValidationError::new(1005, "ctry does not match the required pattern".to_string()));
12079			}
12080		}
12081		Ok(())
12082	}
12083}
12084
12085
12086// RegulatoryReporting3 ...
12087#[cfg_attr(feature = "derive_debug", derive(Debug))]
12088#[cfg_attr(feature = "derive_default", derive(Default))]
12089#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12090#[cfg_attr(feature = "derive_clone", derive(Clone))]
12091#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12092pub struct RegulatoryReporting3 {
12093	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtCdtRptgInd", skip_serializing_if = "Option::is_none") )]
12094	pub dbt_cdt_rptg_ind: Option<RegulatoryReportingType1Code>,
12095	#[cfg_attr( feature = "derive_serde", serde(rename = "Authrty", skip_serializing_if = "Option::is_none") )]
12096	pub authrty: Option<RegulatoryAuthority2>,
12097	#[cfg_attr( feature = "derive_serde", serde(rename = "Dtls", skip_serializing_if = "Option::is_none") )]
12098	pub dtls: Option<Vec<StructuredRegulatoryReporting3>>,
12099}
12100
12101impl RegulatoryReporting3 {
12102	pub fn validate(&self) -> Result<(), ValidationError> {
12103		if let Some(ref val) = self.dbt_cdt_rptg_ind { val.validate()? }
12104		if let Some(ref val) = self.authrty { val.validate()? }
12105		if let Some(ref vec) = self.dtls { for item in vec { item.validate()? } }
12106		Ok(())
12107	}
12108}
12109
12110
12111// RegulatoryReportingType1Code ...
12112#[cfg_attr(feature = "derive_debug", derive(Debug))]
12113#[cfg_attr(feature = "derive_default", derive(Default))]
12114#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12115#[cfg_attr(feature = "derive_clone", derive(Clone))]
12116#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12117pub enum RegulatoryReportingType1Code {
12118	#[cfg_attr(feature = "derive_default", default)]
12119	#[cfg_attr( feature = "derive_serde", serde(rename = "CRED") )]
12120	CodeCRED,
12121	#[cfg_attr( feature = "derive_serde", serde(rename = "DEBT") )]
12122	CodeDEBT,
12123	#[cfg_attr( feature = "derive_serde", serde(rename = "BOTH") )]
12124	CodeBOTH,
12125}
12126
12127impl RegulatoryReportingType1Code {
12128	pub fn validate(&self) -> Result<(), ValidationError> {
12129		Ok(())
12130	}
12131}
12132
12133
12134// RejectionReason2 ...
12135#[cfg_attr(feature = "derive_debug", derive(Debug))]
12136#[cfg_attr(feature = "derive_default", derive(Default))]
12137#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12138#[cfg_attr(feature = "derive_clone", derive(Clone))]
12139#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12140pub struct RejectionReason2 {
12141	#[cfg_attr( feature = "derive_serde", serde(rename = "RjctgPtyRsn") )]
12142	pub rjctg_pty_rsn: String,
12143	#[cfg_attr( feature = "derive_serde", serde(rename = "RjctnDtTm", skip_serializing_if = "Option::is_none") )]
12144	pub rjctn_dt_tm: Option<String>,
12145	#[cfg_attr( feature = "derive_serde", serde(rename = "ErrLctn", skip_serializing_if = "Option::is_none") )]
12146	pub err_lctn: Option<String>,
12147	#[cfg_attr( feature = "derive_serde", serde(rename = "RsnDesc", skip_serializing_if = "Option::is_none") )]
12148	pub rsn_desc: Option<String>,
12149	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlData", skip_serializing_if = "Option::is_none") )]
12150	pub addtl_data: Option<String>,
12151}
12152
12153impl RejectionReason2 {
12154	pub fn validate(&self) -> Result<(), ValidationError> {
12155		if self.rjctg_pty_rsn.chars().count() < 1 {
12156			return Err(ValidationError::new(1001, "rjctg_pty_rsn is shorter than the minimum length of 1".to_string()));
12157		}
12158		if self.rjctg_pty_rsn.chars().count() > 35 {
12159			return Err(ValidationError::new(1002, "rjctg_pty_rsn exceeds the maximum length of 35".to_string()));
12160		}
12161		if let Some(ref val) = self.err_lctn {
12162			if val.chars().count() < 1 {
12163				return Err(ValidationError::new(1001, "err_lctn is shorter than the minimum length of 1".to_string()));
12164			}
12165			if val.chars().count() > 350 {
12166				return Err(ValidationError::new(1002, "err_lctn exceeds the maximum length of 350".to_string()));
12167			}
12168		}
12169		if let Some(ref val) = self.rsn_desc {
12170			if val.chars().count() < 1 {
12171				return Err(ValidationError::new(1001, "rsn_desc is shorter than the minimum length of 1".to_string()));
12172			}
12173			if val.chars().count() > 350 {
12174				return Err(ValidationError::new(1002, "rsn_desc exceeds the maximum length of 350".to_string()));
12175			}
12176		}
12177		if let Some(ref val) = self.addtl_data {
12178			if val.chars().count() < 1 {
12179				return Err(ValidationError::new(1001, "addtl_data is shorter than the minimum length of 1".to_string()));
12180			}
12181			if val.chars().count() > 20000 {
12182				return Err(ValidationError::new(1002, "addtl_data exceeds the maximum length of 20000".to_string()));
12183			}
12184		}
12185		Ok(())
12186	}
12187}
12188
12189
12190// RemittanceAmount2 ...
12191#[cfg_attr(feature = "derive_debug", derive(Debug))]
12192#[cfg_attr(feature = "derive_default", derive(Default))]
12193#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12194#[cfg_attr(feature = "derive_clone", derive(Clone))]
12195#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12196pub struct RemittanceAmount2 {
12197	#[cfg_attr( feature = "derive_serde", serde(rename = "DuePyblAmt", skip_serializing_if = "Option::is_none") )]
12198	pub due_pybl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12199	#[cfg_attr( feature = "derive_serde", serde(rename = "DscntApldAmt", skip_serializing_if = "Option::is_none") )]
12200	pub dscnt_apld_amt: Option<Vec<DiscountAmountAndType1>>,
12201	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtNoteAmt", skip_serializing_if = "Option::is_none") )]
12202	pub cdt_note_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12203	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none") )]
12204	pub tax_amt: Option<Vec<TaxAmountAndType1>>,
12205	#[cfg_attr( feature = "derive_serde", serde(rename = "AdjstmntAmtAndRsn", skip_serializing_if = "Option::is_none") )]
12206	pub adjstmnt_amt_and_rsn: Option<Vec<DocumentAdjustment1>>,
12207	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none") )]
12208	pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12209}
12210
12211impl RemittanceAmount2 {
12212	pub fn validate(&self) -> Result<(), ValidationError> {
12213		if let Some(ref val) = self.due_pybl_amt { val.validate()? }
12214		if let Some(ref vec) = self.dscnt_apld_amt { for item in vec { item.validate()? } }
12215		if let Some(ref val) = self.cdt_note_amt { val.validate()? }
12216		if let Some(ref vec) = self.tax_amt { for item in vec { item.validate()? } }
12217		if let Some(ref vec) = self.adjstmnt_amt_and_rsn { for item in vec { item.validate()? } }
12218		if let Some(ref val) = self.rmtd_amt { val.validate()? }
12219		Ok(())
12220	}
12221}
12222
12223
12224// RemittanceAmount3 ...
12225#[cfg_attr(feature = "derive_debug", derive(Debug))]
12226#[cfg_attr(feature = "derive_default", derive(Default))]
12227#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12228#[cfg_attr(feature = "derive_clone", derive(Clone))]
12229#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12230pub struct RemittanceAmount3 {
12231	#[cfg_attr( feature = "derive_serde", serde(rename = "DuePyblAmt", skip_serializing_if = "Option::is_none") )]
12232	pub due_pybl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12233	#[cfg_attr( feature = "derive_serde", serde(rename = "DscntApldAmt", skip_serializing_if = "Option::is_none") )]
12234	pub dscnt_apld_amt: Option<Vec<DiscountAmountAndType1>>,
12235	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtNoteAmt", skip_serializing_if = "Option::is_none") )]
12236	pub cdt_note_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12237	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none") )]
12238	pub tax_amt: Option<Vec<TaxAmountAndType1>>,
12239	#[cfg_attr( feature = "derive_serde", serde(rename = "AdjstmntAmtAndRsn", skip_serializing_if = "Option::is_none") )]
12240	pub adjstmnt_amt_and_rsn: Option<Vec<DocumentAdjustment1>>,
12241	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtdAmt", skip_serializing_if = "Option::is_none") )]
12242	pub rmtd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12243}
12244
12245impl RemittanceAmount3 {
12246	pub fn validate(&self) -> Result<(), ValidationError> {
12247		if let Some(ref val) = self.due_pybl_amt { val.validate()? }
12248		if let Some(ref vec) = self.dscnt_apld_amt { for item in vec { item.validate()? } }
12249		if let Some(ref val) = self.cdt_note_amt { val.validate()? }
12250		if let Some(ref vec) = self.tax_amt { for item in vec { item.validate()? } }
12251		if let Some(ref vec) = self.adjstmnt_amt_and_rsn { for item in vec { item.validate()? } }
12252		if let Some(ref val) = self.rmtd_amt { val.validate()? }
12253		Ok(())
12254	}
12255}
12256
12257
12258// RemittanceInformation16 ...
12259#[cfg_attr(feature = "derive_debug", derive(Debug))]
12260#[cfg_attr(feature = "derive_default", derive(Default))]
12261#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12262#[cfg_attr(feature = "derive_clone", derive(Clone))]
12263#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12264pub struct RemittanceInformation16 {
12265	#[cfg_attr( feature = "derive_serde", serde(rename = "Ustrd", skip_serializing_if = "Option::is_none") )]
12266	pub ustrd: Option<Vec<String>>,
12267	#[cfg_attr( feature = "derive_serde", serde(rename = "Strd", skip_serializing_if = "Option::is_none") )]
12268	pub strd: Option<Vec<StructuredRemittanceInformation16>>,
12269}
12270
12271impl RemittanceInformation16 {
12272	pub fn validate(&self) -> Result<(), ValidationError> {
12273		if let Some(ref vec) = self.ustrd {
12274			for item in vec {
12275				if item.chars().count() < 1 {
12276					return Err(ValidationError::new(1001, "ustrd is shorter than the minimum length of 1".to_string()));
12277				}
12278				if item.chars().count() > 140 {
12279					return Err(ValidationError::new(1002, "ustrd exceeds the maximum length of 140".to_string()));
12280				}
12281			}
12282		}
12283		if let Some(ref vec) = self.strd { for item in vec { item.validate()? } }
12284		Ok(())
12285	}
12286}
12287
12288
12289// RemittanceInformation2 ...
12290#[cfg_attr(feature = "derive_debug", derive(Debug))]
12291#[cfg_attr(feature = "derive_default", derive(Default))]
12292#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12293#[cfg_attr(feature = "derive_clone", derive(Clone))]
12294#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12295pub struct RemittanceInformation2 {
12296	#[cfg_attr( feature = "derive_serde", serde(rename = "Ustrd", skip_serializing_if = "Option::is_none") )]
12297	pub ustrd: Option<Vec<String>>,
12298}
12299
12300impl RemittanceInformation2 {
12301	pub fn validate(&self) -> Result<(), ValidationError> {
12302		if let Some(ref vec) = self.ustrd {
12303			for item in vec {
12304				if item.chars().count() < 1 {
12305					return Err(ValidationError::new(1001, "ustrd is shorter than the minimum length of 1".to_string()));
12306				}
12307				if item.chars().count() > 140 {
12308					return Err(ValidationError::new(1002, "ustrd exceeds the maximum length of 140".to_string()));
12309				}
12310			}
12311		}
12312		Ok(())
12313	}
12314}
12315
12316
12317// RemittanceLocation7 ...
12318#[cfg_attr(feature = "derive_debug", derive(Debug))]
12319#[cfg_attr(feature = "derive_default", derive(Default))]
12320#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12321#[cfg_attr(feature = "derive_clone", derive(Clone))]
12322#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12323pub struct RemittanceLocation7 {
12324	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtId", skip_serializing_if = "Option::is_none") )]
12325	pub rmt_id: Option<String>,
12326	#[cfg_attr( feature = "derive_serde", serde(rename = "RmtLctnDtls", skip_serializing_if = "Option::is_none") )]
12327	pub rmt_lctn_dtls: Option<Vec<RemittanceLocationData1>>,
12328}
12329
12330impl RemittanceLocation7 {
12331	pub fn validate(&self) -> Result<(), ValidationError> {
12332		if let Some(ref val) = self.rmt_id {
12333			if val.chars().count() < 1 {
12334				return Err(ValidationError::new(1001, "rmt_id is shorter than the minimum length of 1".to_string()));
12335			}
12336			if val.chars().count() > 35 {
12337				return Err(ValidationError::new(1002, "rmt_id exceeds the maximum length of 35".to_string()));
12338			}
12339		}
12340		if let Some(ref vec) = self.rmt_lctn_dtls { for item in vec { item.validate()? } }
12341		Ok(())
12342	}
12343}
12344
12345
12346// RemittanceLocationData1 ...
12347#[cfg_attr(feature = "derive_debug", derive(Debug))]
12348#[cfg_attr(feature = "derive_default", derive(Default))]
12349#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12350#[cfg_attr(feature = "derive_clone", derive(Clone))]
12351#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12352pub struct RemittanceLocationData1 {
12353	#[cfg_attr( feature = "derive_serde", serde(rename = "Mtd") )]
12354	pub mtd: RemittanceLocationMethod2Code,
12355	#[cfg_attr( feature = "derive_serde", serde(rename = "ElctrncAdr", skip_serializing_if = "Option::is_none") )]
12356	pub elctrnc_adr: Option<String>,
12357	#[cfg_attr( feature = "derive_serde", serde(rename = "PstlAdr", skip_serializing_if = "Option::is_none") )]
12358	pub pstl_adr: Option<NameAndAddress16>,
12359}
12360
12361impl RemittanceLocationData1 {
12362	pub fn validate(&self) -> Result<(), ValidationError> {
12363		self.mtd.validate()?;
12364		if let Some(ref val) = self.elctrnc_adr {
12365			if val.chars().count() < 1 {
12366				return Err(ValidationError::new(1001, "elctrnc_adr is shorter than the minimum length of 1".to_string()));
12367			}
12368			if val.chars().count() > 2048 {
12369				return Err(ValidationError::new(1002, "elctrnc_adr exceeds the maximum length of 2048".to_string()));
12370			}
12371		}
12372		if let Some(ref val) = self.pstl_adr { val.validate()? }
12373		Ok(())
12374	}
12375}
12376
12377
12378// RemittanceLocationMethod2Code ...
12379#[cfg_attr(feature = "derive_debug", derive(Debug))]
12380#[cfg_attr(feature = "derive_default", derive(Default))]
12381#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12382#[cfg_attr(feature = "derive_clone", derive(Clone))]
12383#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12384pub enum RemittanceLocationMethod2Code {
12385	#[cfg_attr(feature = "derive_default", default)]
12386	#[cfg_attr( feature = "derive_serde", serde(rename = "FAXI") )]
12387	CodeFAXI,
12388	#[cfg_attr( feature = "derive_serde", serde(rename = "EDIC") )]
12389	CodeEDIC,
12390	#[cfg_attr( feature = "derive_serde", serde(rename = "URID") )]
12391	CodeURID,
12392	#[cfg_attr( feature = "derive_serde", serde(rename = "EMAL") )]
12393	CodeEMAL,
12394	#[cfg_attr( feature = "derive_serde", serde(rename = "POST") )]
12395	CodePOST,
12396	#[cfg_attr( feature = "derive_serde", serde(rename = "SMSM") )]
12397	CodeSMSM,
12398}
12399
12400impl RemittanceLocationMethod2Code {
12401	pub fn validate(&self) -> Result<(), ValidationError> {
12402		Ok(())
12403	}
12404}
12405
12406
12407// ReportEntry10 ...
12408#[cfg_attr(feature = "derive_debug", derive(Debug))]
12409#[cfg_attr(feature = "derive_default", derive(Default))]
12410#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12411#[cfg_attr(feature = "derive_clone", derive(Clone))]
12412#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12413pub struct ReportEntry10 {
12414	#[cfg_attr( feature = "derive_serde", serde(rename = "NtryRef", skip_serializing_if = "Option::is_none") )]
12415	pub ntry_ref: Option<String>,
12416	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
12417	pub amt: ActiveOrHistoricCurrencyAndAmount,
12418	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
12419	pub cdt_dbt_ind: CreditDebitCode,
12420	#[cfg_attr( feature = "derive_serde", serde(rename = "RvslInd", skip_serializing_if = "Option::is_none") )]
12421	pub rvsl_ind: Option<bool>,
12422	#[cfg_attr( feature = "derive_serde", serde(rename = "Sts") )]
12423	pub sts: EntryStatus1Choice,
12424	#[cfg_attr( feature = "derive_serde", serde(rename = "BookgDt", skip_serializing_if = "Option::is_none") )]
12425	pub bookg_dt: Option<DateAndDateTime2Choice>,
12426	#[cfg_attr( feature = "derive_serde", serde(rename = "ValDt", skip_serializing_if = "Option::is_none") )]
12427	pub val_dt: Option<DateAndDateTime2Choice>,
12428	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none") )]
12429	pub acct_svcr_ref: Option<String>,
12430	#[cfg_attr( feature = "derive_serde", serde(rename = "Avlbty", skip_serializing_if = "Option::is_none") )]
12431	pub avlbty: Option<Vec<CashAvailability1>>,
12432	#[cfg_attr( feature = "derive_serde", serde(rename = "BkTxCd") )]
12433	pub bk_tx_cd: BankTransactionCodeStructure4,
12434	#[cfg_attr( feature = "derive_serde", serde(rename = "ComssnWvrInd", skip_serializing_if = "Option::is_none") )]
12435	pub comssn_wvr_ind: Option<bool>,
12436	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInfInd", skip_serializing_if = "Option::is_none") )]
12437	pub addtl_inf_ind: Option<MessageIdentification2>,
12438	#[cfg_attr( feature = "derive_serde", serde(rename = "AmtDtls", skip_serializing_if = "Option::is_none") )]
12439	pub amt_dtls: Option<AmountAndCurrencyExchange3>,
12440	#[cfg_attr( feature = "derive_serde", serde(rename = "Chrgs", skip_serializing_if = "Option::is_none") )]
12441	pub chrgs: Option<Charges6>,
12442	#[cfg_attr( feature = "derive_serde", serde(rename = "TechInptChanl", skip_serializing_if = "Option::is_none") )]
12443	pub tech_inpt_chanl: Option<TechnicalInputChannel1Choice>,
12444	#[cfg_attr( feature = "derive_serde", serde(rename = "Intrst", skip_serializing_if = "Option::is_none") )]
12445	pub intrst: Option<TransactionInterest4>,
12446	#[cfg_attr( feature = "derive_serde", serde(rename = "CardTx", skip_serializing_if = "Option::is_none") )]
12447	pub card_tx: Option<CardEntry4>,
12448	#[cfg_attr( feature = "derive_serde", serde(rename = "NtryDtls", skip_serializing_if = "Option::is_none") )]
12449	pub ntry_dtls: Option<Vec<EntryDetails9>>,
12450	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlNtryInf", skip_serializing_if = "Option::is_none") )]
12451	pub addtl_ntry_inf: Option<String>,
12452}
12453
12454impl ReportEntry10 {
12455	pub fn validate(&self) -> Result<(), ValidationError> {
12456		if let Some(ref val) = self.ntry_ref {
12457			if val.chars().count() < 1 {
12458				return Err(ValidationError::new(1001, "ntry_ref is shorter than the minimum length of 1".to_string()));
12459			}
12460			if val.chars().count() > 35 {
12461				return Err(ValidationError::new(1002, "ntry_ref exceeds the maximum length of 35".to_string()));
12462			}
12463		}
12464		self.amt.validate()?;
12465		self.cdt_dbt_ind.validate()?;
12466		self.sts.validate()?;
12467		if let Some(ref val) = self.bookg_dt { val.validate()? }
12468		if let Some(ref val) = self.val_dt { val.validate()? }
12469		if let Some(ref val) = self.acct_svcr_ref {
12470			if val.chars().count() < 1 {
12471				return Err(ValidationError::new(1001, "acct_svcr_ref is shorter than the minimum length of 1".to_string()));
12472			}
12473			if val.chars().count() > 35 {
12474				return Err(ValidationError::new(1002, "acct_svcr_ref exceeds the maximum length of 35".to_string()));
12475			}
12476		}
12477		if let Some(ref vec) = self.avlbty { for item in vec { item.validate()? } }
12478		self.bk_tx_cd.validate()?;
12479		if let Some(ref val) = self.addtl_inf_ind { val.validate()? }
12480		if let Some(ref val) = self.amt_dtls { val.validate()? }
12481		if let Some(ref val) = self.chrgs { val.validate()? }
12482		if let Some(ref val) = self.tech_inpt_chanl { val.validate()? }
12483		if let Some(ref val) = self.intrst { val.validate()? }
12484		if let Some(ref val) = self.card_tx { val.validate()? }
12485		if let Some(ref vec) = self.ntry_dtls { for item in vec { item.validate()? } }
12486		if let Some(ref val) = self.addtl_ntry_inf {
12487			if val.chars().count() < 1 {
12488				return Err(ValidationError::new(1001, "addtl_ntry_inf is shorter than the minimum length of 1".to_string()));
12489			}
12490			if val.chars().count() > 500 {
12491				return Err(ValidationError::new(1002, "addtl_ntry_inf exceeds the maximum length of 500".to_string()));
12492			}
12493		}
12494		Ok(())
12495	}
12496}
12497
12498
12499// ReportingPeriod2 ...
12500#[cfg_attr(feature = "derive_debug", derive(Debug))]
12501#[cfg_attr(feature = "derive_default", derive(Default))]
12502#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12503#[cfg_attr(feature = "derive_clone", derive(Clone))]
12504#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12505pub struct ReportingPeriod2 {
12506	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt") )]
12507	pub fr_to_dt: DatePeriodDetails1,
12508	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToTm", skip_serializing_if = "Option::is_none") )]
12509	pub fr_to_tm: Option<TimePeriodDetails1>,
12510	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp") )]
12511	pub tp: QueryType3Code,
12512}
12513
12514impl ReportingPeriod2 {
12515	pub fn validate(&self) -> Result<(), ValidationError> {
12516		self.fr_to_dt.validate()?;
12517		if let Some(ref val) = self.fr_to_tm { val.validate()? }
12518		self.tp.validate()?;
12519		Ok(())
12520	}
12521}
12522
12523
12524// ReportingRequest5 ...
12525#[cfg_attr(feature = "derive_debug", derive(Debug))]
12526#[cfg_attr(feature = "derive_default", derive(Default))]
12527#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12528#[cfg_attr(feature = "derive_clone", derive(Clone))]
12529#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12530pub struct ReportingRequest5 {
12531	#[cfg_attr( feature = "derive_serde", serde(rename = "Id", skip_serializing_if = "Option::is_none") )]
12532	pub id: Option<String>,
12533	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdMsgNmId") )]
12534	pub reqd_msg_nm_id: String,
12535	#[cfg_attr( feature = "derive_serde", serde(rename = "Acct", skip_serializing_if = "Option::is_none") )]
12536	pub acct: Option<CashAccount38>,
12537	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctOwnr") )]
12538	pub acct_ownr: Party40Choice,
12539	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcr", skip_serializing_if = "Option::is_none") )]
12540	pub acct_svcr: Option<BranchAndFinancialInstitutionIdentification6>,
12541	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgPrd", skip_serializing_if = "Option::is_none") )]
12542	pub rptg_prd: Option<ReportingPeriod2>,
12543	#[cfg_attr( feature = "derive_serde", serde(rename = "RptgSeq", skip_serializing_if = "Option::is_none") )]
12544	pub rptg_seq: Option<SequenceRange1Choice>,
12545	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdTxTp", skip_serializing_if = "Option::is_none") )]
12546	pub reqd_tx_tp: Option<TransactionType2>,
12547	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdBalTp", skip_serializing_if = "Option::is_none") )]
12548	pub reqd_bal_tp: Option<Vec<BalanceType13>>,
12549}
12550
12551impl ReportingRequest5 {
12552	pub fn validate(&self) -> Result<(), ValidationError> {
12553		if let Some(ref val) = self.id {
12554			if val.chars().count() < 1 {
12555				return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
12556			}
12557			if val.chars().count() > 35 {
12558				return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
12559			}
12560		}
12561		if self.reqd_msg_nm_id.chars().count() < 15 {
12562			return Err(ValidationError::new(1001, "reqd_msg_nm_id is shorter than the minimum length of 15".to_string()));
12563		}
12564		if self.reqd_msg_nm_id.chars().count() > 15 {
12565			return Err(ValidationError::new(1002, "reqd_msg_nm_id exceeds the maximum length of 15".to_string()));
12566		}
12567		let pattern = Regex::new("[a-z]{4,4}[.]{1,1}[0-9]{3,3}[.]{1,1}001[.]{1,1}[0-9]{2,2}").unwrap();
12568		if !pattern.is_match(&self.reqd_msg_nm_id) {
12569			return Err(ValidationError::new(1005, "reqd_msg_nm_id does not match the required pattern".to_string()));
12570		}
12571		if let Some(ref val) = self.acct { val.validate()? }
12572		self.acct_ownr.validate()?;
12573		if let Some(ref val) = self.acct_svcr { val.validate()? }
12574		if let Some(ref val) = self.rptg_prd { val.validate()? }
12575		if let Some(ref val) = self.rptg_seq { val.validate()? }
12576		if let Some(ref val) = self.reqd_tx_tp { val.validate()? }
12577		if let Some(ref vec) = self.reqd_bal_tp { for item in vec { item.validate()? } }
12578		Ok(())
12579	}
12580}
12581
12582
12583// ReportingSource1Choice ...
12584#[cfg_attr(feature = "derive_debug", derive(Debug))]
12585#[cfg_attr(feature = "derive_default", derive(Default))]
12586#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12587#[cfg_attr(feature = "derive_clone", derive(Clone))]
12588#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12589pub struct ReportingSource1Choice {
12590	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
12591	pub cd: Option<String>,
12592	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
12593	pub prtry: Option<String>,
12594}
12595
12596impl ReportingSource1Choice {
12597	pub fn validate(&self) -> Result<(), ValidationError> {
12598		if let Some(ref val) = self.cd {
12599			if val.chars().count() < 1 {
12600				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
12601			}
12602			if val.chars().count() > 4 {
12603				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
12604			}
12605		}
12606		if let Some(ref val) = self.prtry {
12607			if val.chars().count() < 1 {
12608				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
12609			}
12610			if val.chars().count() > 35 {
12611				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
12612			}
12613		}
12614		Ok(())
12615	}
12616}
12617
12618
12619// RequestHandling2 ...
12620#[cfg_attr(feature = "derive_debug", derive(Debug))]
12621#[cfg_attr(feature = "derive_default", derive(Default))]
12622#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12623#[cfg_attr(feature = "derive_clone", derive(Clone))]
12624#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12625pub struct RequestHandling2 {
12626	#[cfg_attr( feature = "derive_serde", serde(rename = "StsCd") )]
12627	pub sts_cd: String,
12628	#[cfg_attr( feature = "derive_serde", serde(rename = "StsDtTm", skip_serializing_if = "Option::is_none") )]
12629	pub sts_dt_tm: Option<String>,
12630	#[cfg_attr( feature = "derive_serde", serde(rename = "Desc", skip_serializing_if = "Option::is_none") )]
12631	pub desc: Option<String>,
12632}
12633
12634impl RequestHandling2 {
12635	pub fn validate(&self) -> Result<(), ValidationError> {
12636		if self.sts_cd.chars().count() < 1 {
12637			return Err(ValidationError::new(1001, "sts_cd is shorter than the minimum length of 1".to_string()));
12638		}
12639		if self.sts_cd.chars().count() > 4 {
12640			return Err(ValidationError::new(1002, "sts_cd exceeds the maximum length of 4".to_string()));
12641		}
12642		let pattern = Regex::new("[a-zA-Z0-9]{1,4}").unwrap();
12643		if !pattern.is_match(&self.sts_cd) {
12644			return Err(ValidationError::new(1005, "sts_cd does not match the required pattern".to_string()));
12645		}
12646		if let Some(ref val) = self.desc {
12647			if val.chars().count() < 1 {
12648				return Err(ValidationError::new(1001, "desc is shorter than the minimum length of 1".to_string()));
12649			}
12650			if val.chars().count() > 140 {
12651				return Err(ValidationError::new(1002, "desc exceeds the maximum length of 140".to_string()));
12652			}
12653		}
12654		Ok(())
12655	}
12656}
12657
12658
12659// RequestType4Choice ...
12660#[cfg_attr(feature = "derive_debug", derive(Debug))]
12661#[cfg_attr(feature = "derive_default", derive(Default))]
12662#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12663#[cfg_attr(feature = "derive_clone", derive(Clone))]
12664#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12665pub struct RequestType4Choice {
12666	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtCtrl", skip_serializing_if = "Option::is_none") )]
12667	pub pmt_ctrl: Option<String>,
12668	#[cfg_attr( feature = "derive_serde", serde(rename = "Enqry", skip_serializing_if = "Option::is_none") )]
12669	pub enqry: Option<String>,
12670	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
12671	pub prtry: Option<GenericIdentification1>,
12672}
12673
12674impl RequestType4Choice {
12675	pub fn validate(&self) -> Result<(), ValidationError> {
12676		if let Some(ref val) = self.pmt_ctrl {
12677			if val.chars().count() < 1 {
12678				return Err(ValidationError::new(1001, "pmt_ctrl is shorter than the minimum length of 1".to_string()));
12679			}
12680			if val.chars().count() > 4 {
12681				return Err(ValidationError::new(1002, "pmt_ctrl exceeds the maximum length of 4".to_string()));
12682			}
12683		}
12684		if let Some(ref val) = self.enqry {
12685			if val.chars().count() < 1 {
12686				return Err(ValidationError::new(1001, "enqry is shorter than the minimum length of 1".to_string()));
12687			}
12688			if val.chars().count() > 4 {
12689				return Err(ValidationError::new(1002, "enqry exceeds the maximum length of 4".to_string()));
12690			}
12691		}
12692		if let Some(ref val) = self.prtry { val.validate()? }
12693		Ok(())
12694	}
12695}
12696
12697
12698// ResendSearchCriteria2 ...
12699#[cfg_attr(feature = "derive_debug", derive(Debug))]
12700#[cfg_attr(feature = "derive_default", derive(Default))]
12701#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12702#[cfg_attr(feature = "derive_clone", derive(Clone))]
12703#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12704pub struct ResendSearchCriteria2 {
12705	#[cfg_attr( feature = "derive_serde", serde(rename = "BizDt", skip_serializing_if = "Option::is_none") )]
12706	pub biz_dt: Option<String>,
12707	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqNb", skip_serializing_if = "Option::is_none") )]
12708	pub seq_nb: Option<String>,
12709	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqRg", skip_serializing_if = "Option::is_none") )]
12710	pub seq_rg: Option<SequenceRange1Choice>,
12711	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId", skip_serializing_if = "Option::is_none") )]
12712	pub orgnl_msg_nm_id: Option<String>,
12713	#[cfg_attr( feature = "derive_serde", serde(rename = "FileRef", skip_serializing_if = "Option::is_none") )]
12714	pub file_ref: Option<String>,
12715	#[cfg_attr( feature = "derive_serde", serde(rename = "Rcpt") )]
12716	pub rcpt: PartyIdentification136,
12717}
12718
12719impl ResendSearchCriteria2 {
12720	pub fn validate(&self) -> Result<(), ValidationError> {
12721		if let Some(ref val) = self.seq_nb {
12722			if val.chars().count() < 1 {
12723				return Err(ValidationError::new(1001, "seq_nb is shorter than the minimum length of 1".to_string()));
12724			}
12725			if val.chars().count() > 35 {
12726				return Err(ValidationError::new(1002, "seq_nb exceeds the maximum length of 35".to_string()));
12727			}
12728		}
12729		if let Some(ref val) = self.seq_rg { val.validate()? }
12730		if let Some(ref val) = self.orgnl_msg_nm_id {
12731			if val.chars().count() < 1 {
12732				return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
12733			}
12734			if val.chars().count() > 35 {
12735				return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
12736			}
12737		}
12738		if let Some(ref val) = self.file_ref {
12739			if val.chars().count() < 1 {
12740				return Err(ValidationError::new(1001, "file_ref is shorter than the minimum length of 1".to_string()));
12741			}
12742			if val.chars().count() > 35 {
12743				return Err(ValidationError::new(1002, "file_ref exceeds the maximum length of 35".to_string()));
12744			}
12745		}
12746		self.rcpt.validate()?;
12747		Ok(())
12748	}
12749}
12750
12751
12752// ResolutionData1 ...
12753#[cfg_attr(feature = "derive_debug", derive(Debug))]
12754#[cfg_attr(feature = "derive_default", derive(Default))]
12755#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12756#[cfg_attr(feature = "derive_clone", derive(Clone))]
12757#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12758pub struct ResolutionData1 {
12759	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none") )]
12760	pub end_to_end_id: Option<String>,
12761	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
12762	pub tx_id: Option<String>,
12763	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
12764	pub uetr: Option<String>,
12765	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmAmt", skip_serializing_if = "Option::is_none") )]
12766	pub intr_bk_sttlm_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
12767	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
12768	pub intr_bk_sttlm_dt: Option<String>,
12769	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrChanl", skip_serializing_if = "Option::is_none") )]
12770	pub clr_chanl: Option<ClearingChannel2Code>,
12771	#[cfg_attr( feature = "derive_serde", serde(rename = "Compstn", skip_serializing_if = "Option::is_none") )]
12772	pub compstn: Option<Compensation2>,
12773	#[cfg_attr( feature = "derive_serde", serde(rename = "Chrgs", skip_serializing_if = "Option::is_none") )]
12774	pub chrgs: Option<Vec<Charges7>>,
12775}
12776
12777impl ResolutionData1 {
12778	pub fn validate(&self) -> Result<(), ValidationError> {
12779		if let Some(ref val) = self.end_to_end_id {
12780			if val.chars().count() < 1 {
12781				return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
12782			}
12783			if val.chars().count() > 35 {
12784				return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
12785			}
12786		}
12787		if let Some(ref val) = self.tx_id {
12788			if val.chars().count() < 1 {
12789				return Err(ValidationError::new(1001, "tx_id is shorter than the minimum length of 1".to_string()));
12790			}
12791			if val.chars().count() > 35 {
12792				return Err(ValidationError::new(1002, "tx_id exceeds the maximum length of 35".to_string()));
12793			}
12794		}
12795		if let Some(ref val) = self.uetr {
12796			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
12797			if !pattern.is_match(val) {
12798				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
12799			}
12800		}
12801		if let Some(ref val) = self.intr_bk_sttlm_amt { val.validate()? }
12802		if let Some(ref val) = self.clr_chanl { val.validate()? }
12803		if let Some(ref val) = self.compstn { val.validate()? }
12804		if let Some(ref vec) = self.chrgs { for item in vec { item.validate()? } }
12805		Ok(())
12806	}
12807}
12808
12809
12810// ReturnReason5Choice ...
12811#[cfg_attr(feature = "derive_debug", derive(Debug))]
12812#[cfg_attr(feature = "derive_default", derive(Default))]
12813#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12814#[cfg_attr(feature = "derive_clone", derive(Clone))]
12815#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12816pub struct ReturnReason5Choice {
12817	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
12818	pub cd: Option<String>,
12819	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
12820	pub prtry: Option<String>,
12821}
12822
12823impl ReturnReason5Choice {
12824	pub fn validate(&self) -> Result<(), ValidationError> {
12825		if let Some(ref val) = self.cd {
12826			if val.chars().count() < 1 {
12827				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
12828			}
12829			if val.chars().count() > 4 {
12830				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
12831			}
12832		}
12833		if let Some(ref val) = self.prtry {
12834			if val.chars().count() < 1 {
12835				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
12836			}
12837			if val.chars().count() > 35 {
12838				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
12839			}
12840		}
12841		Ok(())
12842	}
12843}
12844
12845
12846// SecuritiesAccount19 ...
12847#[cfg_attr(feature = "derive_debug", derive(Debug))]
12848#[cfg_attr(feature = "derive_default", derive(Default))]
12849#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12850#[cfg_attr(feature = "derive_clone", derive(Clone))]
12851#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12852pub struct SecuritiesAccount19 {
12853	#[cfg_attr( feature = "derive_serde", serde(rename = "Id") )]
12854	pub id: String,
12855	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
12856	pub tp: Option<GenericIdentification30>,
12857	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
12858	pub nm: Option<String>,
12859}
12860
12861impl SecuritiesAccount19 {
12862	pub fn validate(&self) -> Result<(), ValidationError> {
12863		if self.id.chars().count() < 1 {
12864			return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
12865		}
12866		if self.id.chars().count() > 35 {
12867			return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
12868		}
12869		if let Some(ref val) = self.tp { val.validate()? }
12870		if let Some(ref val) = self.nm {
12871			if val.chars().count() < 1 {
12872				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
12873			}
12874			if val.chars().count() > 70 {
12875				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 70".to_string()));
12876			}
12877		}
12878		Ok(())
12879	}
12880}
12881
12882
12883// SecurityIdentification19 ...
12884#[cfg_attr(feature = "derive_debug", derive(Debug))]
12885#[cfg_attr(feature = "derive_default", derive(Default))]
12886#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12887#[cfg_attr(feature = "derive_clone", derive(Clone))]
12888#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12889pub struct SecurityIdentification19 {
12890	#[cfg_attr( feature = "derive_serde", serde(rename = "ISIN", skip_serializing_if = "Option::is_none") )]
12891	pub isin: Option<String>,
12892	#[cfg_attr( feature = "derive_serde", serde(rename = "OthrId", skip_serializing_if = "Option::is_none") )]
12893	pub othr_id: Option<Vec<OtherIdentification1>>,
12894	#[cfg_attr( feature = "derive_serde", serde(rename = "Desc", skip_serializing_if = "Option::is_none") )]
12895	pub desc: Option<String>,
12896}
12897
12898impl SecurityIdentification19 {
12899	pub fn validate(&self) -> Result<(), ValidationError> {
12900		if let Some(ref val) = self.isin {
12901			let pattern = Regex::new("[A-Z]{2,2}[A-Z0-9]{9,9}[0-9]{1,1}").unwrap();
12902			if !pattern.is_match(val) {
12903				return Err(ValidationError::new(1005, "isin does not match the required pattern".to_string()));
12904			}
12905		}
12906		if let Some(ref vec) = self.othr_id { for item in vec { item.validate()? } }
12907		if let Some(ref val) = self.desc {
12908			if val.chars().count() < 1 {
12909				return Err(ValidationError::new(1001, "desc is shorter than the minimum length of 1".to_string()));
12910			}
12911			if val.chars().count() > 140 {
12912				return Err(ValidationError::new(1002, "desc exceeds the maximum length of 140".to_string()));
12913			}
12914		}
12915		Ok(())
12916	}
12917}
12918
12919
12920// SequenceRange1 ...
12921#[cfg_attr(feature = "derive_debug", derive(Debug))]
12922#[cfg_attr(feature = "derive_default", derive(Default))]
12923#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12924#[cfg_attr(feature = "derive_clone", derive(Clone))]
12925#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12926pub struct SequenceRange1 {
12927	#[cfg_attr( feature = "derive_serde", serde(rename = "FrSeq") )]
12928	pub fr_seq: String,
12929	#[cfg_attr( feature = "derive_serde", serde(rename = "ToSeq") )]
12930	pub to_seq: String,
12931}
12932
12933impl SequenceRange1 {
12934	pub fn validate(&self) -> Result<(), ValidationError> {
12935		if self.fr_seq.chars().count() < 1 {
12936			return Err(ValidationError::new(1001, "fr_seq is shorter than the minimum length of 1".to_string()));
12937		}
12938		if self.fr_seq.chars().count() > 35 {
12939			return Err(ValidationError::new(1002, "fr_seq exceeds the maximum length of 35".to_string()));
12940		}
12941		if self.to_seq.chars().count() < 1 {
12942			return Err(ValidationError::new(1001, "to_seq is shorter than the minimum length of 1".to_string()));
12943		}
12944		if self.to_seq.chars().count() > 35 {
12945			return Err(ValidationError::new(1002, "to_seq exceeds the maximum length of 35".to_string()));
12946		}
12947		Ok(())
12948	}
12949}
12950
12951
12952// SequenceRange1Choice ...
12953#[cfg_attr(feature = "derive_debug", derive(Debug))]
12954#[cfg_attr(feature = "derive_default", derive(Default))]
12955#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
12956#[cfg_attr(feature = "derive_clone", derive(Clone))]
12957#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
12958pub struct SequenceRange1Choice {
12959	#[cfg_attr( feature = "derive_serde", serde(rename = "FrSeq", skip_serializing_if = "Option::is_none") )]
12960	pub fr_seq: Option<String>,
12961	#[cfg_attr( feature = "derive_serde", serde(rename = "ToSeq", skip_serializing_if = "Option::is_none") )]
12962	pub to_seq: Option<String>,
12963	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToSeq", skip_serializing_if = "Option::is_none") )]
12964	pub fr_to_seq: Option<Vec<SequenceRange1>>,
12965	#[cfg_attr( feature = "derive_serde", serde(rename = "EQSeq", skip_serializing_if = "Option::is_none") )]
12966	pub eq_seq: Option<Vec<String>>,
12967	#[cfg_attr( feature = "derive_serde", serde(rename = "NEQSeq", skip_serializing_if = "Option::is_none") )]
12968	pub neq_seq: Option<Vec<String>>,
12969}
12970
12971impl SequenceRange1Choice {
12972	pub fn validate(&self) -> Result<(), ValidationError> {
12973		if let Some(ref val) = self.fr_seq {
12974			if val.chars().count() < 1 {
12975				return Err(ValidationError::new(1001, "fr_seq is shorter than the minimum length of 1".to_string()));
12976			}
12977			if val.chars().count() > 35 {
12978				return Err(ValidationError::new(1002, "fr_seq exceeds the maximum length of 35".to_string()));
12979			}
12980		}
12981		if let Some(ref val) = self.to_seq {
12982			if val.chars().count() < 1 {
12983				return Err(ValidationError::new(1001, "to_seq is shorter than the minimum length of 1".to_string()));
12984			}
12985			if val.chars().count() > 35 {
12986				return Err(ValidationError::new(1002, "to_seq exceeds the maximum length of 35".to_string()));
12987			}
12988		}
12989		if let Some(ref vec) = self.fr_to_seq { for item in vec { item.validate()? } }
12990		if let Some(ref vec) = self.eq_seq {
12991			for item in vec {
12992				if item.chars().count() < 1 {
12993					return Err(ValidationError::new(1001, "eq_seq is shorter than the minimum length of 1".to_string()));
12994				}
12995				if item.chars().count() > 35 {
12996					return Err(ValidationError::new(1002, "eq_seq exceeds the maximum length of 35".to_string()));
12997				}
12998			}
12999		}
13000		if let Some(ref vec) = self.neq_seq {
13001			for item in vec {
13002				if item.chars().count() < 1 {
13003					return Err(ValidationError::new(1001, "neq_seq is shorter than the minimum length of 1".to_string()));
13004				}
13005				if item.chars().count() > 35 {
13006					return Err(ValidationError::new(1002, "neq_seq exceeds the maximum length of 35".to_string()));
13007				}
13008			}
13009		}
13010		Ok(())
13011	}
13012}
13013
13014
13015// SequenceType3Code ...
13016#[cfg_attr(feature = "derive_debug", derive(Debug))]
13017#[cfg_attr(feature = "derive_default", derive(Default))]
13018#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13019#[cfg_attr(feature = "derive_clone", derive(Clone))]
13020#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13021pub enum SequenceType3Code {
13022	#[cfg_attr(feature = "derive_default", default)]
13023	#[cfg_attr( feature = "derive_serde", serde(rename = "FRST") )]
13024	CodeFRST,
13025	#[cfg_attr( feature = "derive_serde", serde(rename = "RCUR") )]
13026	CodeRCUR,
13027	#[cfg_attr( feature = "derive_serde", serde(rename = "FNAL") )]
13028	CodeFNAL,
13029	#[cfg_attr( feature = "derive_serde", serde(rename = "OOFF") )]
13030	CodeOOFF,
13031	#[cfg_attr( feature = "derive_serde", serde(rename = "RPRE") )]
13032	CodeRPRE,
13033}
13034
13035impl SequenceType3Code {
13036	pub fn validate(&self) -> Result<(), ValidationError> {
13037		Ok(())
13038	}
13039}
13040
13041
13042// ServiceLevel8Choice ...
13043#[cfg_attr(feature = "derive_debug", derive(Debug))]
13044#[cfg_attr(feature = "derive_default", derive(Default))]
13045#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13046#[cfg_attr(feature = "derive_clone", derive(Clone))]
13047#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13048pub struct ServiceLevel8Choice {
13049	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
13050	pub cd: Option<String>,
13051	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
13052	pub prtry: Option<String>,
13053}
13054
13055impl ServiceLevel8Choice {
13056	pub fn validate(&self) -> Result<(), ValidationError> {
13057		if let Some(ref val) = self.cd {
13058			if val.chars().count() < 1 {
13059				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
13060			}
13061			if val.chars().count() > 4 {
13062				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
13063			}
13064		}
13065		if let Some(ref val) = self.prtry {
13066			if val.chars().count() < 1 {
13067				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
13068			}
13069			if val.chars().count() > 35 {
13070				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
13071			}
13072		}
13073		Ok(())
13074	}
13075}
13076
13077
13078// SettlementDateTimeIndication1 ...
13079#[cfg_attr(feature = "derive_debug", derive(Debug))]
13080#[cfg_attr(feature = "derive_default", derive(Default))]
13081#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13082#[cfg_attr(feature = "derive_clone", derive(Clone))]
13083#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13084pub struct SettlementDateTimeIndication1 {
13085	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtDtTm", skip_serializing_if = "Option::is_none") )]
13086	pub dbt_dt_tm: Option<String>,
13087	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDtTm", skip_serializing_if = "Option::is_none") )]
13088	pub cdt_dt_tm: Option<String>,
13089}
13090
13091impl SettlementDateTimeIndication1 {
13092	pub fn validate(&self) -> Result<(), ValidationError> {
13093		Ok(())
13094	}
13095}
13096
13097
13098// SettlementInstruction7 ...
13099#[cfg_attr(feature = "derive_debug", derive(Debug))]
13100#[cfg_attr(feature = "derive_default", derive(Default))]
13101#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13102#[cfg_attr(feature = "derive_clone", derive(Clone))]
13103#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13104pub struct SettlementInstruction7 {
13105	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmMtd") )]
13106	pub sttlm_mtd: SettlementMethod1Code,
13107	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmAcct", skip_serializing_if = "Option::is_none") )]
13108	pub sttlm_acct: Option<CashAccount38>,
13109	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSys", skip_serializing_if = "Option::is_none") )]
13110	pub clr_sys: Option<ClearingSystemIdentification3Choice>,
13111	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgRmbrsmntAgt", skip_serializing_if = "Option::is_none") )]
13112	pub instg_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification6>,
13113	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgRmbrsmntAgtAcct", skip_serializing_if = "Option::is_none") )]
13114	pub instg_rmbrsmnt_agt_acct: Option<CashAccount38>,
13115	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdRmbrsmntAgt", skip_serializing_if = "Option::is_none") )]
13116	pub instd_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification6>,
13117	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdRmbrsmntAgtAcct", skip_serializing_if = "Option::is_none") )]
13118	pub instd_rmbrsmnt_agt_acct: Option<CashAccount38>,
13119	#[cfg_attr( feature = "derive_serde", serde(rename = "ThrdRmbrsmntAgt", skip_serializing_if = "Option::is_none") )]
13120	pub thrd_rmbrsmnt_agt: Option<BranchAndFinancialInstitutionIdentification6>,
13121	#[cfg_attr( feature = "derive_serde", serde(rename = "ThrdRmbrsmntAgtAcct", skip_serializing_if = "Option::is_none") )]
13122	pub thrd_rmbrsmnt_agt_acct: Option<CashAccount38>,
13123}
13124
13125impl SettlementInstruction7 {
13126	pub fn validate(&self) -> Result<(), ValidationError> {
13127		self.sttlm_mtd.validate()?;
13128		if let Some(ref val) = self.sttlm_acct { val.validate()? }
13129		if let Some(ref val) = self.clr_sys { val.validate()? }
13130		if let Some(ref val) = self.instg_rmbrsmnt_agt { val.validate()? }
13131		if let Some(ref val) = self.instg_rmbrsmnt_agt_acct { val.validate()? }
13132		if let Some(ref val) = self.instd_rmbrsmnt_agt { val.validate()? }
13133		if let Some(ref val) = self.instd_rmbrsmnt_agt_acct { val.validate()? }
13134		if let Some(ref val) = self.thrd_rmbrsmnt_agt { val.validate()? }
13135		if let Some(ref val) = self.thrd_rmbrsmnt_agt_acct { val.validate()? }
13136		Ok(())
13137	}
13138}
13139
13140
13141// SettlementMethod1Code ...
13142#[cfg_attr(feature = "derive_debug", derive(Debug))]
13143#[cfg_attr(feature = "derive_default", derive(Default))]
13144#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13145#[cfg_attr(feature = "derive_clone", derive(Clone))]
13146#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13147pub enum SettlementMethod1Code {
13148	#[cfg_attr(feature = "derive_default", default)]
13149	#[cfg_attr( feature = "derive_serde", serde(rename = "INDA") )]
13150	CodeINDA,
13151	#[cfg_attr( feature = "derive_serde", serde(rename = "INGA") )]
13152	CodeINGA,
13153	#[cfg_attr( feature = "derive_serde", serde(rename = "COVE") )]
13154	CodeCOVE,
13155	#[cfg_attr( feature = "derive_serde", serde(rename = "CLRG") )]
13156	CodeCLRG,
13157}
13158
13159impl SettlementMethod1Code {
13160	pub fn validate(&self) -> Result<(), ValidationError> {
13161		Ok(())
13162	}
13163}
13164
13165
13166// SettlementTimeRequest2 ...
13167#[cfg_attr(feature = "derive_debug", derive(Debug))]
13168#[cfg_attr(feature = "derive_default", derive(Default))]
13169#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13170#[cfg_attr(feature = "derive_clone", derive(Clone))]
13171#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13172pub struct SettlementTimeRequest2 {
13173	#[cfg_attr( feature = "derive_serde", serde(rename = "CLSTm", skip_serializing_if = "Option::is_none") )]
13174	pub cls_tm: Option<String>,
13175	#[cfg_attr( feature = "derive_serde", serde(rename = "TillTm", skip_serializing_if = "Option::is_none") )]
13176	pub till_tm: Option<String>,
13177	#[cfg_attr( feature = "derive_serde", serde(rename = "FrTm", skip_serializing_if = "Option::is_none") )]
13178	pub fr_tm: Option<String>,
13179	#[cfg_attr( feature = "derive_serde", serde(rename = "RjctTm", skip_serializing_if = "Option::is_none") )]
13180	pub rjct_tm: Option<String>,
13181}
13182
13183impl SettlementTimeRequest2 {
13184	pub fn validate(&self) -> Result<(), ValidationError> {
13185		Ok(())
13186	}
13187}
13188
13189
13190// SignatureEnvelope ...
13191#[cfg_attr(feature = "derive_debug", derive(Debug))]
13192#[cfg_attr(feature = "derive_default", derive(Default))]
13193#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13194#[cfg_attr(feature = "derive_clone", derive(Clone))]
13195#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13196pub struct SignatureEnvelope {
13197}
13198
13199impl SignatureEnvelope {
13200	pub fn validate(&self) -> Result<(), ValidationError> {
13201		Ok(())
13202	}
13203}
13204
13205
13206// SkipPayload ...
13207#[cfg_attr(feature = "derive_debug", derive(Debug))]
13208#[cfg_attr(feature = "derive_default", derive(Default))]
13209#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13210#[cfg_attr(feature = "derive_clone", derive(Clone))]
13211#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13212pub struct SkipPayload {
13213}
13214
13215impl SkipPayload {
13216	pub fn validate(&self) -> Result<(), ValidationError> {
13217		Ok(())
13218	}
13219}
13220
13221
13222// StatementResolutionEntry4 ...
13223#[cfg_attr(feature = "derive_debug", derive(Debug))]
13224#[cfg_attr(feature = "derive_default", derive(Default))]
13225#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13226#[cfg_attr(feature = "derive_clone", derive(Clone))]
13227#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13228pub struct StatementResolutionEntry4 {
13229	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
13230	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
13231	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlStmtId", skip_serializing_if = "Option::is_none") )]
13232	pub orgnl_stmt_id: Option<String>,
13233	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
13234	pub uetr: Option<String>,
13235	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none") )]
13236	pub acct_svcr_ref: Option<String>,
13237	#[cfg_attr( feature = "derive_serde", serde(rename = "CrrctdAmt", skip_serializing_if = "Option::is_none") )]
13238	pub crrctd_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13239	#[cfg_attr( feature = "derive_serde", serde(rename = "Chrgs", skip_serializing_if = "Option::is_none") )]
13240	pub chrgs: Option<Vec<Charges6>>,
13241	#[cfg_attr( feature = "derive_serde", serde(rename = "Purp", skip_serializing_if = "Option::is_none") )]
13242	pub purp: Option<Purpose2Choice>,
13243}
13244
13245impl StatementResolutionEntry4 {
13246	pub fn validate(&self) -> Result<(), ValidationError> {
13247		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
13248		if let Some(ref val) = self.orgnl_stmt_id {
13249			if val.chars().count() < 1 {
13250				return Err(ValidationError::new(1001, "orgnl_stmt_id is shorter than the minimum length of 1".to_string()));
13251			}
13252			if val.chars().count() > 35 {
13253				return Err(ValidationError::new(1002, "orgnl_stmt_id exceeds the maximum length of 35".to_string()));
13254			}
13255		}
13256		if let Some(ref val) = self.uetr {
13257			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
13258			if !pattern.is_match(val) {
13259				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
13260			}
13261		}
13262		if let Some(ref val) = self.acct_svcr_ref {
13263			if val.chars().count() < 1 {
13264				return Err(ValidationError::new(1001, "acct_svcr_ref is shorter than the minimum length of 1".to_string()));
13265			}
13266			if val.chars().count() > 35 {
13267				return Err(ValidationError::new(1002, "acct_svcr_ref exceeds the maximum length of 35".to_string()));
13268			}
13269		}
13270		if let Some(ref val) = self.crrctd_amt { val.validate()? }
13271		if let Some(ref vec) = self.chrgs { for item in vec { item.validate()? } }
13272		if let Some(ref val) = self.purp { val.validate()? }
13273		Ok(())
13274	}
13275}
13276
13277
13278// StatusReason6Choice ...
13279#[cfg_attr(feature = "derive_debug", derive(Debug))]
13280#[cfg_attr(feature = "derive_default", derive(Default))]
13281#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13282#[cfg_attr(feature = "derive_clone", derive(Clone))]
13283#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13284pub struct StatusReason6Choice {
13285	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
13286	pub cd: Option<String>,
13287	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
13288	pub prtry: Option<String>,
13289}
13290
13291impl StatusReason6Choice {
13292	pub fn validate(&self) -> Result<(), ValidationError> {
13293		if let Some(ref val) = self.cd {
13294			if val.chars().count() < 1 {
13295				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
13296			}
13297			if val.chars().count() > 4 {
13298				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
13299			}
13300		}
13301		if let Some(ref val) = self.prtry {
13302			if val.chars().count() < 1 {
13303				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
13304			}
13305			if val.chars().count() > 35 {
13306				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
13307			}
13308		}
13309		Ok(())
13310	}
13311}
13312
13313
13314// StatusReasonInformation12 ...
13315#[cfg_attr(feature = "derive_debug", derive(Debug))]
13316#[cfg_attr(feature = "derive_default", derive(Default))]
13317#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13318#[cfg_attr(feature = "derive_clone", derive(Clone))]
13319#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13320pub struct StatusReasonInformation12 {
13321	#[cfg_attr( feature = "derive_serde", serde(rename = "Orgtr", skip_serializing_if = "Option::is_none") )]
13322	pub orgtr: Option<PartyIdentification135>,
13323	#[cfg_attr( feature = "derive_serde", serde(rename = "Rsn", skip_serializing_if = "Option::is_none") )]
13324	pub rsn: Option<StatusReason6Choice>,
13325	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
13326	pub addtl_inf: Option<Vec<String>>,
13327}
13328
13329impl StatusReasonInformation12 {
13330	pub fn validate(&self) -> Result<(), ValidationError> {
13331		if let Some(ref val) = self.orgtr { val.validate()? }
13332		if let Some(ref val) = self.rsn { val.validate()? }
13333		if let Some(ref vec) = self.addtl_inf {
13334			for item in vec {
13335				if item.chars().count() < 1 {
13336					return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
13337				}
13338				if item.chars().count() > 105 {
13339					return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 105".to_string()));
13340				}
13341			}
13342		}
13343		Ok(())
13344	}
13345}
13346
13347
13348// StructuredRegulatoryReporting3 ...
13349#[cfg_attr(feature = "derive_debug", derive(Debug))]
13350#[cfg_attr(feature = "derive_default", derive(Default))]
13351#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13352#[cfg_attr(feature = "derive_clone", derive(Clone))]
13353#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13354pub struct StructuredRegulatoryReporting3 {
13355	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
13356	pub tp: Option<String>,
13357	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
13358	pub dt: Option<String>,
13359	#[cfg_attr( feature = "derive_serde", serde(rename = "Ctry", skip_serializing_if = "Option::is_none") )]
13360	pub ctry: Option<String>,
13361	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
13362	pub cd: Option<String>,
13363	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
13364	pub amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13365	#[cfg_attr( feature = "derive_serde", serde(rename = "Inf", skip_serializing_if = "Option::is_none") )]
13366	pub inf: Option<Vec<String>>,
13367}
13368
13369impl StructuredRegulatoryReporting3 {
13370	pub fn validate(&self) -> Result<(), ValidationError> {
13371		if let Some(ref val) = self.tp {
13372			if val.chars().count() < 1 {
13373				return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
13374			}
13375			if val.chars().count() > 35 {
13376				return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
13377			}
13378		}
13379		if let Some(ref val) = self.ctry {
13380			let pattern = Regex::new("[A-Z]{2,2}").unwrap();
13381			if !pattern.is_match(val) {
13382				return Err(ValidationError::new(1005, "ctry does not match the required pattern".to_string()));
13383			}
13384		}
13385		if let Some(ref val) = self.cd {
13386			if val.chars().count() < 1 {
13387				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
13388			}
13389			if val.chars().count() > 10 {
13390				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 10".to_string()));
13391			}
13392		}
13393		if let Some(ref val) = self.amt { val.validate()? }
13394		if let Some(ref vec) = self.inf {
13395			for item in vec {
13396				if item.chars().count() < 1 {
13397					return Err(ValidationError::new(1001, "inf is shorter than the minimum length of 1".to_string()));
13398				}
13399				if item.chars().count() > 35 {
13400					return Err(ValidationError::new(1002, "inf exceeds the maximum length of 35".to_string()));
13401				}
13402			}
13403		}
13404		Ok(())
13405	}
13406}
13407
13408
13409// StructuredRemittanceInformation16 ...
13410#[cfg_attr(feature = "derive_debug", derive(Debug))]
13411#[cfg_attr(feature = "derive_default", derive(Default))]
13412#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13413#[cfg_attr(feature = "derive_clone", derive(Clone))]
13414#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13415pub struct StructuredRemittanceInformation16 {
13416	#[cfg_attr( feature = "derive_serde", serde(rename = "RfrdDocInf", skip_serializing_if = "Option::is_none") )]
13417	pub rfrd_doc_inf: Option<Vec<ReferredDocumentInformation7>>,
13418	#[cfg_attr( feature = "derive_serde", serde(rename = "RfrdDocAmt", skip_serializing_if = "Option::is_none") )]
13419	pub rfrd_doc_amt: Option<RemittanceAmount2>,
13420	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrRefInf", skip_serializing_if = "Option::is_none") )]
13421	pub cdtr_ref_inf: Option<CreditorReferenceInformation2>,
13422	#[cfg_attr( feature = "derive_serde", serde(rename = "Invcr", skip_serializing_if = "Option::is_none") )]
13423	pub invcr: Option<PartyIdentification135>,
13424	#[cfg_attr( feature = "derive_serde", serde(rename = "Invcee", skip_serializing_if = "Option::is_none") )]
13425	pub invcee: Option<PartyIdentification135>,
13426	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxRmt", skip_serializing_if = "Option::is_none") )]
13427	pub tax_rmt: Option<TaxInformation7>,
13428	#[cfg_attr( feature = "derive_serde", serde(rename = "GrnshmtRmt", skip_serializing_if = "Option::is_none") )]
13429	pub grnshmt_rmt: Option<Garnishment3>,
13430	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlRmtInf", skip_serializing_if = "Option::is_none") )]
13431	pub addtl_rmt_inf: Option<Vec<String>>,
13432}
13433
13434impl StructuredRemittanceInformation16 {
13435	pub fn validate(&self) -> Result<(), ValidationError> {
13436		if let Some(ref vec) = self.rfrd_doc_inf { for item in vec { item.validate()? } }
13437		if let Some(ref val) = self.rfrd_doc_amt { val.validate()? }
13438		if let Some(ref val) = self.cdtr_ref_inf { val.validate()? }
13439		if let Some(ref val) = self.invcr { val.validate()? }
13440		if let Some(ref val) = self.invcee { val.validate()? }
13441		if let Some(ref val) = self.tax_rmt { val.validate()? }
13442		if let Some(ref val) = self.grnshmt_rmt { val.validate()? }
13443		if let Some(ref vec) = self.addtl_rmt_inf {
13444			for item in vec {
13445				if item.chars().count() < 1 {
13446					return Err(ValidationError::new(1001, "addtl_rmt_inf is shorter than the minimum length of 1".to_string()));
13447				}
13448				if item.chars().count() > 140 {
13449					return Err(ValidationError::new(1002, "addtl_rmt_inf exceeds the maximum length of 140".to_string()));
13450				}
13451			}
13452		}
13453		Ok(())
13454	}
13455}
13456
13457
13458// SupplementaryData1 ...
13459#[cfg_attr(feature = "derive_debug", derive(Debug))]
13460#[cfg_attr(feature = "derive_default", derive(Default))]
13461#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13462#[cfg_attr(feature = "derive_clone", derive(Clone))]
13463#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13464pub struct SupplementaryData1 {
13465	#[cfg_attr( feature = "derive_serde", serde(rename = "PlcAndNm", skip_serializing_if = "Option::is_none") )]
13466	pub plc_and_nm: Option<String>,
13467	#[cfg_attr( feature = "derive_serde", serde(rename = "Envlp") )]
13468	pub envlp: SupplementaryDataEnvelope1,
13469}
13470
13471impl SupplementaryData1 {
13472	pub fn validate(&self) -> Result<(), ValidationError> {
13473		if let Some(ref val) = self.plc_and_nm {
13474			if val.chars().count() < 1 {
13475				return Err(ValidationError::new(1001, "plc_and_nm is shorter than the minimum length of 1".to_string()));
13476			}
13477			if val.chars().count() > 350 {
13478				return Err(ValidationError::new(1002, "plc_and_nm exceeds the maximum length of 350".to_string()));
13479			}
13480		}
13481		self.envlp.validate()?;
13482		Ok(())
13483	}
13484}
13485
13486
13487// SupplementaryDataEnvelope1 ...
13488#[cfg_attr(feature = "derive_debug", derive(Debug))]
13489#[cfg_attr(feature = "derive_default", derive(Default))]
13490#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13491#[cfg_attr(feature = "derive_clone", derive(Clone))]
13492#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13493pub struct SupplementaryDataEnvelope1 {
13494}
13495
13496impl SupplementaryDataEnvelope1 {
13497	pub fn validate(&self) -> Result<(), ValidationError> {
13498		Ok(())
13499	}
13500}
13501
13502
13503// TaxAmount2 ...
13504#[cfg_attr(feature = "derive_debug", derive(Debug))]
13505#[cfg_attr(feature = "derive_default", derive(Default))]
13506#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13507#[cfg_attr(feature = "derive_clone", derive(Clone))]
13508#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13509pub struct TaxAmount2 {
13510	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
13511	pub rate: Option<f64>,
13512	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxblBaseAmt", skip_serializing_if = "Option::is_none") )]
13513	pub taxbl_base_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13514	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlAmt", skip_serializing_if = "Option::is_none") )]
13515	pub ttl_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13516	#[cfg_attr( feature = "derive_serde", serde(rename = "Dtls", skip_serializing_if = "Option::is_none") )]
13517	pub dtls: Option<Vec<TaxRecordDetails2>>,
13518}
13519
13520impl TaxAmount2 {
13521	pub fn validate(&self) -> Result<(), ValidationError> {
13522		if let Some(ref val) = self.taxbl_base_amt { val.validate()? }
13523		if let Some(ref val) = self.ttl_amt { val.validate()? }
13524		if let Some(ref vec) = self.dtls { for item in vec { item.validate()? } }
13525		Ok(())
13526	}
13527}
13528
13529
13530// TaxAmountAndType1 ...
13531#[cfg_attr(feature = "derive_debug", derive(Debug))]
13532#[cfg_attr(feature = "derive_default", derive(Default))]
13533#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13534#[cfg_attr(feature = "derive_clone", derive(Clone))]
13535#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13536pub struct TaxAmountAndType1 {
13537	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
13538	pub tp: Option<TaxAmountType1Choice>,
13539	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
13540	pub amt: ActiveOrHistoricCurrencyAndAmount,
13541}
13542
13543impl TaxAmountAndType1 {
13544	pub fn validate(&self) -> Result<(), ValidationError> {
13545		if let Some(ref val) = self.tp { val.validate()? }
13546		self.amt.validate()?;
13547		Ok(())
13548	}
13549}
13550
13551
13552// TaxAmountType1Choice ...
13553#[cfg_attr(feature = "derive_debug", derive(Debug))]
13554#[cfg_attr(feature = "derive_default", derive(Default))]
13555#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13556#[cfg_attr(feature = "derive_clone", derive(Clone))]
13557#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13558pub struct TaxAmountType1Choice {
13559	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
13560	pub cd: Option<String>,
13561	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
13562	pub prtry: Option<String>,
13563}
13564
13565impl TaxAmountType1Choice {
13566	pub fn validate(&self) -> Result<(), ValidationError> {
13567		if let Some(ref val) = self.cd {
13568			if val.chars().count() < 1 {
13569				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
13570			}
13571			if val.chars().count() > 4 {
13572				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
13573			}
13574		}
13575		if let Some(ref val) = self.prtry {
13576			if val.chars().count() < 1 {
13577				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
13578			}
13579			if val.chars().count() > 35 {
13580				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
13581			}
13582		}
13583		Ok(())
13584	}
13585}
13586
13587
13588// TaxAuthorisation1 ...
13589#[cfg_attr(feature = "derive_debug", derive(Debug))]
13590#[cfg_attr(feature = "derive_default", derive(Default))]
13591#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13592#[cfg_attr(feature = "derive_clone", derive(Clone))]
13593#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13594pub struct TaxAuthorisation1 {
13595	#[cfg_attr( feature = "derive_serde", serde(rename = "Titl", skip_serializing_if = "Option::is_none") )]
13596	pub titl: Option<String>,
13597	#[cfg_attr( feature = "derive_serde", serde(rename = "Nm", skip_serializing_if = "Option::is_none") )]
13598	pub nm: Option<String>,
13599}
13600
13601impl TaxAuthorisation1 {
13602	pub fn validate(&self) -> Result<(), ValidationError> {
13603		if let Some(ref val) = self.titl {
13604			if val.chars().count() < 1 {
13605				return Err(ValidationError::new(1001, "titl is shorter than the minimum length of 1".to_string()));
13606			}
13607			if val.chars().count() > 35 {
13608				return Err(ValidationError::new(1002, "titl exceeds the maximum length of 35".to_string()));
13609			}
13610		}
13611		if let Some(ref val) = self.nm {
13612			if val.chars().count() < 1 {
13613				return Err(ValidationError::new(1001, "nm is shorter than the minimum length of 1".to_string()));
13614			}
13615			if val.chars().count() > 140 {
13616				return Err(ValidationError::new(1002, "nm exceeds the maximum length of 140".to_string()));
13617			}
13618		}
13619		Ok(())
13620	}
13621}
13622
13623
13624// TaxCharges2 ...
13625#[cfg_attr(feature = "derive_debug", derive(Debug))]
13626#[cfg_attr(feature = "derive_default", derive(Default))]
13627#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13628#[cfg_attr(feature = "derive_clone", derive(Clone))]
13629#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13630pub struct TaxCharges2 {
13631	#[cfg_attr( feature = "derive_serde", serde(rename = "Id", skip_serializing_if = "Option::is_none") )]
13632	pub id: Option<String>,
13633	#[cfg_attr( feature = "derive_serde", serde(rename = "Rate", skip_serializing_if = "Option::is_none") )]
13634	pub rate: Option<f64>,
13635	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt", skip_serializing_if = "Option::is_none") )]
13636	pub amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13637}
13638
13639impl TaxCharges2 {
13640	pub fn validate(&self) -> Result<(), ValidationError> {
13641		if let Some(ref val) = self.id {
13642			if val.chars().count() < 1 {
13643				return Err(ValidationError::new(1001, "id is shorter than the minimum length of 1".to_string()));
13644			}
13645			if val.chars().count() > 35 {
13646				return Err(ValidationError::new(1002, "id exceeds the maximum length of 35".to_string()));
13647			}
13648		}
13649		if let Some(ref val) = self.amt { val.validate()? }
13650		Ok(())
13651	}
13652}
13653
13654
13655// TaxInformation7 ...
13656#[cfg_attr(feature = "derive_debug", derive(Debug))]
13657#[cfg_attr(feature = "derive_default", derive(Default))]
13658#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13659#[cfg_attr(feature = "derive_clone", derive(Clone))]
13660#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13661pub struct TaxInformation7 {
13662	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
13663	pub cdtr: Option<TaxParty1>,
13664	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
13665	pub dbtr: Option<TaxParty2>,
13666	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
13667	pub ultmt_dbtr: Option<TaxParty2>,
13668	#[cfg_attr( feature = "derive_serde", serde(rename = "AdmstnZone", skip_serializing_if = "Option::is_none") )]
13669	pub admstn_zone: Option<String>,
13670	#[cfg_attr( feature = "derive_serde", serde(rename = "RefNb", skip_serializing_if = "Option::is_none") )]
13671	pub ref_nb: Option<String>,
13672	#[cfg_attr( feature = "derive_serde", serde(rename = "Mtd", skip_serializing_if = "Option::is_none") )]
13673	pub mtd: Option<String>,
13674	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlTaxblBaseAmt", skip_serializing_if = "Option::is_none") )]
13675	pub ttl_taxbl_base_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13676	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlTaxAmt", skip_serializing_if = "Option::is_none") )]
13677	pub ttl_tax_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13678	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
13679	pub dt: Option<String>,
13680	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqNb", skip_serializing_if = "Option::is_none") )]
13681	pub seq_nb: Option<f64>,
13682	#[cfg_attr( feature = "derive_serde", serde(rename = "Rcrd", skip_serializing_if = "Option::is_none") )]
13683	pub rcrd: Option<Vec<TaxRecord2>>,
13684}
13685
13686impl TaxInformation7 {
13687	pub fn validate(&self) -> Result<(), ValidationError> {
13688		if let Some(ref val) = self.cdtr { val.validate()? }
13689		if let Some(ref val) = self.dbtr { val.validate()? }
13690		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
13691		if let Some(ref val) = self.admstn_zone {
13692			if val.chars().count() < 1 {
13693				return Err(ValidationError::new(1001, "admstn_zone is shorter than the minimum length of 1".to_string()));
13694			}
13695			if val.chars().count() > 35 {
13696				return Err(ValidationError::new(1002, "admstn_zone exceeds the maximum length of 35".to_string()));
13697			}
13698		}
13699		if let Some(ref val) = self.ref_nb {
13700			if val.chars().count() < 1 {
13701				return Err(ValidationError::new(1001, "ref_nb is shorter than the minimum length of 1".to_string()));
13702			}
13703			if val.chars().count() > 140 {
13704				return Err(ValidationError::new(1002, "ref_nb exceeds the maximum length of 140".to_string()));
13705			}
13706		}
13707		if let Some(ref val) = self.mtd {
13708			if val.chars().count() < 1 {
13709				return Err(ValidationError::new(1001, "mtd is shorter than the minimum length of 1".to_string()));
13710			}
13711			if val.chars().count() > 35 {
13712				return Err(ValidationError::new(1002, "mtd exceeds the maximum length of 35".to_string()));
13713			}
13714		}
13715		if let Some(ref val) = self.ttl_taxbl_base_amt { val.validate()? }
13716		if let Some(ref val) = self.ttl_tax_amt { val.validate()? }
13717		if let Some(ref vec) = self.rcrd { for item in vec { item.validate()? } }
13718		Ok(())
13719	}
13720}
13721
13722
13723// TaxInformation8 ...
13724#[cfg_attr(feature = "derive_debug", derive(Debug))]
13725#[cfg_attr(feature = "derive_default", derive(Default))]
13726#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13727#[cfg_attr(feature = "derive_clone", derive(Clone))]
13728#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13729pub struct TaxInformation8 {
13730	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
13731	pub cdtr: Option<TaxParty1>,
13732	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
13733	pub dbtr: Option<TaxParty2>,
13734	#[cfg_attr( feature = "derive_serde", serde(rename = "AdmstnZone", skip_serializing_if = "Option::is_none") )]
13735	pub admstn_zone: Option<String>,
13736	#[cfg_attr( feature = "derive_serde", serde(rename = "RefNb", skip_serializing_if = "Option::is_none") )]
13737	pub ref_nb: Option<String>,
13738	#[cfg_attr( feature = "derive_serde", serde(rename = "Mtd", skip_serializing_if = "Option::is_none") )]
13739	pub mtd: Option<String>,
13740	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlTaxblBaseAmt", skip_serializing_if = "Option::is_none") )]
13741	pub ttl_taxbl_base_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13742	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlTaxAmt", skip_serializing_if = "Option::is_none") )]
13743	pub ttl_tax_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
13744	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
13745	pub dt: Option<String>,
13746	#[cfg_attr( feature = "derive_serde", serde(rename = "SeqNb", skip_serializing_if = "Option::is_none") )]
13747	pub seq_nb: Option<f64>,
13748	#[cfg_attr( feature = "derive_serde", serde(rename = "Rcrd", skip_serializing_if = "Option::is_none") )]
13749	pub rcrd: Option<Vec<TaxRecord2>>,
13750}
13751
13752impl TaxInformation8 {
13753	pub fn validate(&self) -> Result<(), ValidationError> {
13754		if let Some(ref val) = self.cdtr { val.validate()? }
13755		if let Some(ref val) = self.dbtr { val.validate()? }
13756		if let Some(ref val) = self.admstn_zone {
13757			if val.chars().count() < 1 {
13758				return Err(ValidationError::new(1001, "admstn_zone is shorter than the minimum length of 1".to_string()));
13759			}
13760			if val.chars().count() > 35 {
13761				return Err(ValidationError::new(1002, "admstn_zone exceeds the maximum length of 35".to_string()));
13762			}
13763		}
13764		if let Some(ref val) = self.ref_nb {
13765			if val.chars().count() < 1 {
13766				return Err(ValidationError::new(1001, "ref_nb is shorter than the minimum length of 1".to_string()));
13767			}
13768			if val.chars().count() > 140 {
13769				return Err(ValidationError::new(1002, "ref_nb exceeds the maximum length of 140".to_string()));
13770			}
13771		}
13772		if let Some(ref val) = self.mtd {
13773			if val.chars().count() < 1 {
13774				return Err(ValidationError::new(1001, "mtd is shorter than the minimum length of 1".to_string()));
13775			}
13776			if val.chars().count() > 35 {
13777				return Err(ValidationError::new(1002, "mtd exceeds the maximum length of 35".to_string()));
13778			}
13779		}
13780		if let Some(ref val) = self.ttl_taxbl_base_amt { val.validate()? }
13781		if let Some(ref val) = self.ttl_tax_amt { val.validate()? }
13782		if let Some(ref vec) = self.rcrd { for item in vec { item.validate()? } }
13783		Ok(())
13784	}
13785}
13786
13787
13788// TaxParty1 ...
13789#[cfg_attr(feature = "derive_debug", derive(Debug))]
13790#[cfg_attr(feature = "derive_default", derive(Default))]
13791#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13792#[cfg_attr(feature = "derive_clone", derive(Clone))]
13793#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13794pub struct TaxParty1 {
13795	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxId", skip_serializing_if = "Option::is_none") )]
13796	pub tax_id: Option<String>,
13797	#[cfg_attr( feature = "derive_serde", serde(rename = "RegnId", skip_serializing_if = "Option::is_none") )]
13798	pub regn_id: Option<String>,
13799	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxTp", skip_serializing_if = "Option::is_none") )]
13800	pub tax_tp: Option<String>,
13801}
13802
13803impl TaxParty1 {
13804	pub fn validate(&self) -> Result<(), ValidationError> {
13805		if let Some(ref val) = self.tax_id {
13806			if val.chars().count() < 1 {
13807				return Err(ValidationError::new(1001, "tax_id is shorter than the minimum length of 1".to_string()));
13808			}
13809			if val.chars().count() > 35 {
13810				return Err(ValidationError::new(1002, "tax_id exceeds the maximum length of 35".to_string()));
13811			}
13812		}
13813		if let Some(ref val) = self.regn_id {
13814			if val.chars().count() < 1 {
13815				return Err(ValidationError::new(1001, "regn_id is shorter than the minimum length of 1".to_string()));
13816			}
13817			if val.chars().count() > 35 {
13818				return Err(ValidationError::new(1002, "regn_id exceeds the maximum length of 35".to_string()));
13819			}
13820		}
13821		if let Some(ref val) = self.tax_tp {
13822			if val.chars().count() < 1 {
13823				return Err(ValidationError::new(1001, "tax_tp is shorter than the minimum length of 1".to_string()));
13824			}
13825			if val.chars().count() > 35 {
13826				return Err(ValidationError::new(1002, "tax_tp exceeds the maximum length of 35".to_string()));
13827			}
13828		}
13829		Ok(())
13830	}
13831}
13832
13833
13834// TaxParty2 ...
13835#[cfg_attr(feature = "derive_debug", derive(Debug))]
13836#[cfg_attr(feature = "derive_default", derive(Default))]
13837#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13838#[cfg_attr(feature = "derive_clone", derive(Clone))]
13839#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13840pub struct TaxParty2 {
13841	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxId", skip_serializing_if = "Option::is_none") )]
13842	pub tax_id: Option<String>,
13843	#[cfg_attr( feature = "derive_serde", serde(rename = "RegnId", skip_serializing_if = "Option::is_none") )]
13844	pub regn_id: Option<String>,
13845	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxTp", skip_serializing_if = "Option::is_none") )]
13846	pub tax_tp: Option<String>,
13847	#[cfg_attr( feature = "derive_serde", serde(rename = "Authstn", skip_serializing_if = "Option::is_none") )]
13848	pub authstn: Option<TaxAuthorisation1>,
13849}
13850
13851impl TaxParty2 {
13852	pub fn validate(&self) -> Result<(), ValidationError> {
13853		if let Some(ref val) = self.tax_id {
13854			if val.chars().count() < 1 {
13855				return Err(ValidationError::new(1001, "tax_id is shorter than the minimum length of 1".to_string()));
13856			}
13857			if val.chars().count() > 35 {
13858				return Err(ValidationError::new(1002, "tax_id exceeds the maximum length of 35".to_string()));
13859			}
13860		}
13861		if let Some(ref val) = self.regn_id {
13862			if val.chars().count() < 1 {
13863				return Err(ValidationError::new(1001, "regn_id is shorter than the minimum length of 1".to_string()));
13864			}
13865			if val.chars().count() > 35 {
13866				return Err(ValidationError::new(1002, "regn_id exceeds the maximum length of 35".to_string()));
13867			}
13868		}
13869		if let Some(ref val) = self.tax_tp {
13870			if val.chars().count() < 1 {
13871				return Err(ValidationError::new(1001, "tax_tp is shorter than the minimum length of 1".to_string()));
13872			}
13873			if val.chars().count() > 35 {
13874				return Err(ValidationError::new(1002, "tax_tp exceeds the maximum length of 35".to_string()));
13875			}
13876		}
13877		if let Some(ref val) = self.authstn { val.validate()? }
13878		Ok(())
13879	}
13880}
13881
13882
13883// TaxPeriod2 ...
13884#[cfg_attr(feature = "derive_debug", derive(Debug))]
13885#[cfg_attr(feature = "derive_default", derive(Default))]
13886#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13887#[cfg_attr(feature = "derive_clone", derive(Clone))]
13888#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13889pub struct TaxPeriod2 {
13890	#[cfg_attr( feature = "derive_serde", serde(rename = "Yr", skip_serializing_if = "Option::is_none") )]
13891	pub yr: Option<String>,
13892	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
13893	pub tp: Option<TaxRecordPeriod1Code>,
13894	#[cfg_attr( feature = "derive_serde", serde(rename = "FrToDt", skip_serializing_if = "Option::is_none") )]
13895	pub fr_to_dt: Option<DatePeriod2>,
13896}
13897
13898impl TaxPeriod2 {
13899	pub fn validate(&self) -> Result<(), ValidationError> {
13900		if let Some(ref val) = self.tp { val.validate()? }
13901		if let Some(ref val) = self.fr_to_dt { val.validate()? }
13902		Ok(())
13903	}
13904}
13905
13906
13907// TaxRecord2 ...
13908#[cfg_attr(feature = "derive_debug", derive(Debug))]
13909#[cfg_attr(feature = "derive_default", derive(Default))]
13910#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
13911#[cfg_attr(feature = "derive_clone", derive(Clone))]
13912#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
13913pub struct TaxRecord2 {
13914	#[cfg_attr( feature = "derive_serde", serde(rename = "Tp", skip_serializing_if = "Option::is_none") )]
13915	pub tp: Option<String>,
13916	#[cfg_attr( feature = "derive_serde", serde(rename = "Ctgy", skip_serializing_if = "Option::is_none") )]
13917	pub ctgy: Option<String>,
13918	#[cfg_attr( feature = "derive_serde", serde(rename = "CtgyDtls", skip_serializing_if = "Option::is_none") )]
13919	pub ctgy_dtls: Option<String>,
13920	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrSts", skip_serializing_if = "Option::is_none") )]
13921	pub dbtr_sts: Option<String>,
13922	#[cfg_attr( feature = "derive_serde", serde(rename = "CertId", skip_serializing_if = "Option::is_none") )]
13923	pub cert_id: Option<String>,
13924	#[cfg_attr( feature = "derive_serde", serde(rename = "FrmsCd", skip_serializing_if = "Option::is_none") )]
13925	pub frms_cd: Option<String>,
13926	#[cfg_attr( feature = "derive_serde", serde(rename = "Prd", skip_serializing_if = "Option::is_none") )]
13927	pub prd: Option<TaxPeriod2>,
13928	#[cfg_attr( feature = "derive_serde", serde(rename = "TaxAmt", skip_serializing_if = "Option::is_none") )]
13929	pub tax_amt: Option<TaxAmount2>,
13930	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlInf", skip_serializing_if = "Option::is_none") )]
13931	pub addtl_inf: Option<String>,
13932}
13933
13934impl TaxRecord2 {
13935	pub fn validate(&self) -> Result<(), ValidationError> {
13936		if let Some(ref val) = self.tp {
13937			if val.chars().count() < 1 {
13938				return Err(ValidationError::new(1001, "tp is shorter than the minimum length of 1".to_string()));
13939			}
13940			if val.chars().count() > 35 {
13941				return Err(ValidationError::new(1002, "tp exceeds the maximum length of 35".to_string()));
13942			}
13943		}
13944		if let Some(ref val) = self.ctgy {
13945			if val.chars().count() < 1 {
13946				return Err(ValidationError::new(1001, "ctgy is shorter than the minimum length of 1".to_string()));
13947			}
13948			if val.chars().count() > 35 {
13949				return Err(ValidationError::new(1002, "ctgy exceeds the maximum length of 35".to_string()));
13950			}
13951		}
13952		if let Some(ref val) = self.ctgy_dtls {
13953			if val.chars().count() < 1 {
13954				return Err(ValidationError::new(1001, "ctgy_dtls is shorter than the minimum length of 1".to_string()));
13955			}
13956			if val.chars().count() > 35 {
13957				return Err(ValidationError::new(1002, "ctgy_dtls exceeds the maximum length of 35".to_string()));
13958			}
13959		}
13960		if let Some(ref val) = self.dbtr_sts {
13961			if val.chars().count() < 1 {
13962				return Err(ValidationError::new(1001, "dbtr_sts is shorter than the minimum length of 1".to_string()));
13963			}
13964			if val.chars().count() > 35 {
13965				return Err(ValidationError::new(1002, "dbtr_sts exceeds the maximum length of 35".to_string()));
13966			}
13967		}
13968		if let Some(ref val) = self.cert_id {
13969			if val.chars().count() < 1 {
13970				return Err(ValidationError::new(1001, "cert_id is shorter than the minimum length of 1".to_string()));
13971			}
13972			if val.chars().count() > 35 {
13973				return Err(ValidationError::new(1002, "cert_id exceeds the maximum length of 35".to_string()));
13974			}
13975		}
13976		if let Some(ref val) = self.frms_cd {
13977			if val.chars().count() < 1 {
13978				return Err(ValidationError::new(1001, "frms_cd is shorter than the minimum length of 1".to_string()));
13979			}
13980			if val.chars().count() > 35 {
13981				return Err(ValidationError::new(1002, "frms_cd exceeds the maximum length of 35".to_string()));
13982			}
13983		}
13984		if let Some(ref val) = self.prd { val.validate()? }
13985		if let Some(ref val) = self.tax_amt { val.validate()? }
13986		if let Some(ref val) = self.addtl_inf {
13987			if val.chars().count() < 1 {
13988				return Err(ValidationError::new(1001, "addtl_inf is shorter than the minimum length of 1".to_string()));
13989			}
13990			if val.chars().count() > 140 {
13991				return Err(ValidationError::new(1002, "addtl_inf exceeds the maximum length of 140".to_string()));
13992			}
13993		}
13994		Ok(())
13995	}
13996}
13997
13998
13999// TaxRecordDetails2 ...
14000#[cfg_attr(feature = "derive_debug", derive(Debug))]
14001#[cfg_attr(feature = "derive_default", derive(Default))]
14002#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14003#[cfg_attr(feature = "derive_clone", derive(Clone))]
14004#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14005pub struct TaxRecordDetails2 {
14006	#[cfg_attr( feature = "derive_serde", serde(rename = "Prd", skip_serializing_if = "Option::is_none") )]
14007	pub prd: Option<TaxPeriod2>,
14008	#[cfg_attr( feature = "derive_serde", serde(rename = "Amt") )]
14009	pub amt: ActiveOrHistoricCurrencyAndAmount,
14010}
14011
14012impl TaxRecordDetails2 {
14013	pub fn validate(&self) -> Result<(), ValidationError> {
14014		if let Some(ref val) = self.prd { val.validate()? }
14015		self.amt.validate()?;
14016		Ok(())
14017	}
14018}
14019
14020
14021// TaxRecordPeriod1Code ...
14022#[cfg_attr(feature = "derive_debug", derive(Debug))]
14023#[cfg_attr(feature = "derive_default", derive(Default))]
14024#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14025#[cfg_attr(feature = "derive_clone", derive(Clone))]
14026#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14027pub enum TaxRecordPeriod1Code {
14028	#[cfg_attr(feature = "derive_default", default)]
14029	#[cfg_attr( feature = "derive_serde", serde(rename = "MM01") )]
14030	CodeMM01,
14031	#[cfg_attr( feature = "derive_serde", serde(rename = "MM02") )]
14032	CodeMM02,
14033	#[cfg_attr( feature = "derive_serde", serde(rename = "MM03") )]
14034	CodeMM03,
14035	#[cfg_attr( feature = "derive_serde", serde(rename = "MM04") )]
14036	CodeMM04,
14037	#[cfg_attr( feature = "derive_serde", serde(rename = "MM05") )]
14038	CodeMM05,
14039	#[cfg_attr( feature = "derive_serde", serde(rename = "MM06") )]
14040	CodeMM06,
14041	#[cfg_attr( feature = "derive_serde", serde(rename = "MM07") )]
14042	CodeMM07,
14043	#[cfg_attr( feature = "derive_serde", serde(rename = "MM08") )]
14044	CodeMM08,
14045	#[cfg_attr( feature = "derive_serde", serde(rename = "MM09") )]
14046	CodeMM09,
14047	#[cfg_attr( feature = "derive_serde", serde(rename = "MM10") )]
14048	CodeMM10,
14049	#[cfg_attr( feature = "derive_serde", serde(rename = "MM11") )]
14050	CodeMM11,
14051	#[cfg_attr( feature = "derive_serde", serde(rename = "MM12") )]
14052	CodeMM12,
14053	#[cfg_attr( feature = "derive_serde", serde(rename = "QTR1") )]
14054	CodeQTR1,
14055	#[cfg_attr( feature = "derive_serde", serde(rename = "QTR2") )]
14056	CodeQTR2,
14057	#[cfg_attr( feature = "derive_serde", serde(rename = "QTR3") )]
14058	CodeQTR3,
14059	#[cfg_attr( feature = "derive_serde", serde(rename = "QTR4") )]
14060	CodeQTR4,
14061	#[cfg_attr( feature = "derive_serde", serde(rename = "HLF1") )]
14062	CodeHLF1,
14063	#[cfg_attr( feature = "derive_serde", serde(rename = "HLF2") )]
14064	CodeHLF2,
14065}
14066
14067impl TaxRecordPeriod1Code {
14068	pub fn validate(&self) -> Result<(), ValidationError> {
14069		Ok(())
14070	}
14071}
14072
14073
14074// TechnicalInputChannel1Choice ...
14075#[cfg_attr(feature = "derive_debug", derive(Debug))]
14076#[cfg_attr(feature = "derive_default", derive(Default))]
14077#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14078#[cfg_attr(feature = "derive_clone", derive(Clone))]
14079#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14080pub struct TechnicalInputChannel1Choice {
14081	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd", skip_serializing_if = "Option::is_none") )]
14082	pub cd: Option<String>,
14083	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14084	pub prtry: Option<String>,
14085}
14086
14087impl TechnicalInputChannel1Choice {
14088	pub fn validate(&self) -> Result<(), ValidationError> {
14089		if let Some(ref val) = self.cd {
14090			if val.chars().count() < 1 {
14091				return Err(ValidationError::new(1001, "cd is shorter than the minimum length of 1".to_string()));
14092			}
14093			if val.chars().count() > 4 {
14094				return Err(ValidationError::new(1002, "cd exceeds the maximum length of 4".to_string()));
14095			}
14096		}
14097		if let Some(ref val) = self.prtry {
14098			if val.chars().count() < 1 {
14099				return Err(ValidationError::new(1001, "prtry is shorter than the minimum length of 1".to_string()));
14100			}
14101			if val.chars().count() > 35 {
14102				return Err(ValidationError::new(1002, "prtry exceeds the maximum length of 35".to_string()));
14103			}
14104		}
14105		Ok(())
14106	}
14107}
14108
14109
14110// TimePeriodDetails1 ...
14111#[cfg_attr(feature = "derive_debug", derive(Debug))]
14112#[cfg_attr(feature = "derive_default", derive(Default))]
14113#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14114#[cfg_attr(feature = "derive_clone", derive(Clone))]
14115#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14116pub struct TimePeriodDetails1 {
14117	#[cfg_attr( feature = "derive_serde", serde(rename = "FrTm") )]
14118	pub fr_tm: String,
14119	#[cfg_attr( feature = "derive_serde", serde(rename = "ToTm", skip_serializing_if = "Option::is_none") )]
14120	pub to_tm: Option<String>,
14121}
14122
14123impl TimePeriodDetails1 {
14124	pub fn validate(&self) -> Result<(), ValidationError> {
14125		Ok(())
14126	}
14127}
14128
14129
14130// TotalTransactions6 ...
14131#[cfg_attr(feature = "derive_debug", derive(Debug))]
14132#[cfg_attr(feature = "derive_default", derive(Default))]
14133#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14134#[cfg_attr(feature = "derive_clone", derive(Clone))]
14135#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14136pub struct TotalTransactions6 {
14137	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlNtries", skip_serializing_if = "Option::is_none") )]
14138	pub ttl_ntries: Option<NumberAndSumOfTransactions4>,
14139	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlCdtNtries", skip_serializing_if = "Option::is_none") )]
14140	pub ttl_cdt_ntries: Option<NumberAndSumOfTransactions1>,
14141	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlDbtNtries", skip_serializing_if = "Option::is_none") )]
14142	pub ttl_dbt_ntries: Option<NumberAndSumOfTransactions1>,
14143	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlNtriesPerBkTxCd", skip_serializing_if = "Option::is_none") )]
14144	pub ttl_ntries_per_bk_tx_cd: Option<Vec<TotalsPerBankTransactionCode5>>,
14145}
14146
14147impl TotalTransactions6 {
14148	pub fn validate(&self) -> Result<(), ValidationError> {
14149		if let Some(ref val) = self.ttl_ntries { val.validate()? }
14150		if let Some(ref val) = self.ttl_cdt_ntries { val.validate()? }
14151		if let Some(ref val) = self.ttl_dbt_ntries { val.validate()? }
14152		if let Some(ref vec) = self.ttl_ntries_per_bk_tx_cd { for item in vec { item.validate()? } }
14153		Ok(())
14154	}
14155}
14156
14157
14158// TotalsPerBankTransactionCode5 ...
14159#[cfg_attr(feature = "derive_debug", derive(Debug))]
14160#[cfg_attr(feature = "derive_default", derive(Default))]
14161#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14162#[cfg_attr(feature = "derive_clone", derive(Clone))]
14163#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14164pub struct TotalsPerBankTransactionCode5 {
14165	#[cfg_attr( feature = "derive_serde", serde(rename = "NbOfNtries", skip_serializing_if = "Option::is_none") )]
14166	pub nb_of_ntries: Option<String>,
14167	#[cfg_attr( feature = "derive_serde", serde(rename = "Sum", skip_serializing_if = "Option::is_none") )]
14168	pub sum: Option<f64>,
14169	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlNetNtry", skip_serializing_if = "Option::is_none") )]
14170	pub ttl_net_ntry: Option<AmountAndDirection35>,
14171	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtNtries", skip_serializing_if = "Option::is_none") )]
14172	pub cdt_ntries: Option<NumberAndSumOfTransactions1>,
14173	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtNtries", skip_serializing_if = "Option::is_none") )]
14174	pub dbt_ntries: Option<NumberAndSumOfTransactions1>,
14175	#[cfg_attr( feature = "derive_serde", serde(rename = "FcstInd", skip_serializing_if = "Option::is_none") )]
14176	pub fcst_ind: Option<bool>,
14177	#[cfg_attr( feature = "derive_serde", serde(rename = "BkTxCd") )]
14178	pub bk_tx_cd: BankTransactionCodeStructure4,
14179	#[cfg_attr( feature = "derive_serde", serde(rename = "Avlbty", skip_serializing_if = "Option::is_none") )]
14180	pub avlbty: Option<Vec<CashAvailability1>>,
14181	#[cfg_attr( feature = "derive_serde", serde(rename = "Dt", skip_serializing_if = "Option::is_none") )]
14182	pub dt: Option<DateAndDateTime2Choice>,
14183}
14184
14185impl TotalsPerBankTransactionCode5 {
14186	pub fn validate(&self) -> Result<(), ValidationError> {
14187		if let Some(ref val) = self.nb_of_ntries {
14188			let pattern = Regex::new("[0-9]{1,15}").unwrap();
14189			if !pattern.is_match(val) {
14190				return Err(ValidationError::new(1005, "nb_of_ntries does not match the required pattern".to_string()));
14191			}
14192		}
14193		if let Some(ref val) = self.ttl_net_ntry { val.validate()? }
14194		if let Some(ref val) = self.cdt_ntries { val.validate()? }
14195		if let Some(ref val) = self.dbt_ntries { val.validate()? }
14196		self.bk_tx_cd.validate()?;
14197		if let Some(ref vec) = self.avlbty { for item in vec { item.validate()? } }
14198		if let Some(ref val) = self.dt { val.validate()? }
14199		Ok(())
14200	}
14201}
14202
14203
14204// TrackData1 ...
14205#[cfg_attr(feature = "derive_debug", derive(Debug))]
14206#[cfg_attr(feature = "derive_default", derive(Default))]
14207#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14208#[cfg_attr(feature = "derive_clone", derive(Clone))]
14209#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14210pub struct TrackData1 {
14211	#[cfg_attr( feature = "derive_serde", serde(rename = "TrckNb", skip_serializing_if = "Option::is_none") )]
14212	pub trck_nb: Option<String>,
14213	#[cfg_attr( feature = "derive_serde", serde(rename = "TrckVal") )]
14214	pub trck_val: String,
14215}
14216
14217impl TrackData1 {
14218	pub fn validate(&self) -> Result<(), ValidationError> {
14219		if let Some(ref val) = self.trck_nb {
14220			let pattern = Regex::new("[0-9]").unwrap();
14221			if !pattern.is_match(val) {
14222				return Err(ValidationError::new(1005, "trck_nb does not match the required pattern".to_string()));
14223			}
14224		}
14225		if self.trck_val.chars().count() < 1 {
14226			return Err(ValidationError::new(1001, "trck_val is shorter than the minimum length of 1".to_string()));
14227		}
14228		if self.trck_val.chars().count() > 140 {
14229			return Err(ValidationError::new(1002, "trck_val exceeds the maximum length of 140".to_string()));
14230		}
14231		Ok(())
14232	}
14233}
14234
14235
14236// TransactionAgents5 ...
14237#[cfg_attr(feature = "derive_debug", derive(Debug))]
14238#[cfg_attr(feature = "derive_default", derive(Default))]
14239#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14240#[cfg_attr(feature = "derive_clone", derive(Clone))]
14241#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14242pub struct TransactionAgents5 {
14243	#[cfg_attr( feature = "derive_serde", serde(rename = "InstgAgt", skip_serializing_if = "Option::is_none") )]
14244	pub instg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14245	#[cfg_attr( feature = "derive_serde", serde(rename = "InstdAgt", skip_serializing_if = "Option::is_none") )]
14246	pub instd_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14247	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
14248	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14249	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
14250	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14251	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
14252	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
14253	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
14254	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
14255	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
14256	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
14257	#[cfg_attr( feature = "derive_serde", serde(rename = "RcvgAgt", skip_serializing_if = "Option::is_none") )]
14258	pub rcvg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14259	#[cfg_attr( feature = "derive_serde", serde(rename = "DlvrgAgt", skip_serializing_if = "Option::is_none") )]
14260	pub dlvrg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14261	#[cfg_attr( feature = "derive_serde", serde(rename = "IssgAgt", skip_serializing_if = "Option::is_none") )]
14262	pub issg_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14263	#[cfg_attr( feature = "derive_serde", serde(rename = "SttlmPlc", skip_serializing_if = "Option::is_none") )]
14264	pub sttlm_plc: Option<BranchAndFinancialInstitutionIdentification6>,
14265	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14266	pub prtry: Option<Vec<ProprietaryAgent4>>,
14267}
14268
14269impl TransactionAgents5 {
14270	pub fn validate(&self) -> Result<(), ValidationError> {
14271		if let Some(ref val) = self.instg_agt { val.validate()? }
14272		if let Some(ref val) = self.instd_agt { val.validate()? }
14273		if let Some(ref val) = self.dbtr_agt { val.validate()? }
14274		if let Some(ref val) = self.cdtr_agt { val.validate()? }
14275		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
14276		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
14277		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
14278		if let Some(ref val) = self.rcvg_agt { val.validate()? }
14279		if let Some(ref val) = self.dlvrg_agt { val.validate()? }
14280		if let Some(ref val) = self.issg_agt { val.validate()? }
14281		if let Some(ref val) = self.sttlm_plc { val.validate()? }
14282		if let Some(ref vec) = self.prtry { for item in vec { item.validate()? } }
14283		Ok(())
14284	}
14285}
14286
14287
14288// TransactionChannel1Code ...
14289#[cfg_attr(feature = "derive_debug", derive(Debug))]
14290#[cfg_attr(feature = "derive_default", derive(Default))]
14291#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14292#[cfg_attr(feature = "derive_clone", derive(Clone))]
14293#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14294pub enum TransactionChannel1Code {
14295	#[cfg_attr(feature = "derive_default", default)]
14296	#[cfg_attr( feature = "derive_serde", serde(rename = "MAIL") )]
14297	CodeMAIL,
14298	#[cfg_attr( feature = "derive_serde", serde(rename = "TLPH") )]
14299	CodeTLPH,
14300	#[cfg_attr( feature = "derive_serde", serde(rename = "ECOM") )]
14301	CodeECOM,
14302	#[cfg_attr( feature = "derive_serde", serde(rename = "TVPY") )]
14303	CodeTVPY,
14304}
14305
14306impl TransactionChannel1Code {
14307	pub fn validate(&self) -> Result<(), ValidationError> {
14308		Ok(())
14309	}
14310}
14311
14312
14313// TransactionDates3 ...
14314#[cfg_attr(feature = "derive_debug", derive(Debug))]
14315#[cfg_attr(feature = "derive_default", derive(Default))]
14316#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14317#[cfg_attr(feature = "derive_clone", derive(Clone))]
14318#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14319pub struct TransactionDates3 {
14320	#[cfg_attr( feature = "derive_serde", serde(rename = "AccptncDtTm", skip_serializing_if = "Option::is_none") )]
14321	pub accptnc_dt_tm: Option<String>,
14322	#[cfg_attr( feature = "derive_serde", serde(rename = "TradActvtyCtrctlSttlmDt", skip_serializing_if = "Option::is_none") )]
14323	pub trad_actvty_ctrctl_sttlm_dt: Option<String>,
14324	#[cfg_attr( feature = "derive_serde", serde(rename = "TradDt", skip_serializing_if = "Option::is_none") )]
14325	pub trad_dt: Option<String>,
14326	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBkSttlmDt", skip_serializing_if = "Option::is_none") )]
14327	pub intr_bk_sttlm_dt: Option<String>,
14328	#[cfg_attr( feature = "derive_serde", serde(rename = "StartDt", skip_serializing_if = "Option::is_none") )]
14329	pub start_dt: Option<String>,
14330	#[cfg_attr( feature = "derive_serde", serde(rename = "EndDt", skip_serializing_if = "Option::is_none") )]
14331	pub end_dt: Option<String>,
14332	#[cfg_attr( feature = "derive_serde", serde(rename = "TxDtTm", skip_serializing_if = "Option::is_none") )]
14333	pub tx_dt_tm: Option<String>,
14334	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14335	pub prtry: Option<Vec<ProprietaryDate3>>,
14336}
14337
14338impl TransactionDates3 {
14339	pub fn validate(&self) -> Result<(), ValidationError> {
14340		if let Some(ref vec) = self.prtry { for item in vec { item.validate()? } }
14341		Ok(())
14342	}
14343}
14344
14345
14346// TransactionEnvironment1Code ...
14347#[cfg_attr(feature = "derive_debug", derive(Debug))]
14348#[cfg_attr(feature = "derive_default", derive(Default))]
14349#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14350#[cfg_attr(feature = "derive_clone", derive(Clone))]
14351#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14352pub enum TransactionEnvironment1Code {
14353	#[cfg_attr(feature = "derive_default", default)]
14354	#[cfg_attr( feature = "derive_serde", serde(rename = "MERC") )]
14355	CodeMERC,
14356	#[cfg_attr( feature = "derive_serde", serde(rename = "PRIV") )]
14357	CodePRIV,
14358	#[cfg_attr( feature = "derive_serde", serde(rename = "PUBL") )]
14359	CodePUBL,
14360}
14361
14362impl TransactionEnvironment1Code {
14363	pub fn validate(&self) -> Result<(), ValidationError> {
14364		Ok(())
14365	}
14366}
14367
14368
14369// TransactionIdentifier1 ...
14370#[cfg_attr(feature = "derive_debug", derive(Debug))]
14371#[cfg_attr(feature = "derive_default", derive(Default))]
14372#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14373#[cfg_attr(feature = "derive_clone", derive(Clone))]
14374#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14375pub struct TransactionIdentifier1 {
14376	#[cfg_attr( feature = "derive_serde", serde(rename = "TxDtTm") )]
14377	pub tx_dt_tm: String,
14378	#[cfg_attr( feature = "derive_serde", serde(rename = "TxRef") )]
14379	pub tx_ref: String,
14380}
14381
14382impl TransactionIdentifier1 {
14383	pub fn validate(&self) -> Result<(), ValidationError> {
14384		if self.tx_ref.chars().count() < 1 {
14385			return Err(ValidationError::new(1001, "tx_ref is shorter than the minimum length of 1".to_string()));
14386		}
14387		if self.tx_ref.chars().count() > 35 {
14388			return Err(ValidationError::new(1002, "tx_ref exceeds the maximum length of 35".to_string()));
14389		}
14390		Ok(())
14391	}
14392}
14393
14394
14395// TransactionIndividualStatus1Code ...
14396#[cfg_attr(feature = "derive_debug", derive(Debug))]
14397#[cfg_attr(feature = "derive_default", derive(Default))]
14398#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14399#[cfg_attr(feature = "derive_clone", derive(Clone))]
14400#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14401pub enum TransactionIndividualStatus1Code {
14402	#[cfg_attr(feature = "derive_default", default)]
14403	#[cfg_attr( feature = "derive_serde", serde(rename = "ACTC") )]
14404	CodeACTC,
14405	#[cfg_attr( feature = "derive_serde", serde(rename = "RJCT") )]
14406	CodeRJCT,
14407	#[cfg_attr( feature = "derive_serde", serde(rename = "PDNG") )]
14408	CodePDNG,
14409	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCP") )]
14410	CodeACCP,
14411	#[cfg_attr( feature = "derive_serde", serde(rename = "ACSP") )]
14412	CodeACSP,
14413	#[cfg_attr( feature = "derive_serde", serde(rename = "ACSC") )]
14414	CodeACSC,
14415	#[cfg_attr( feature = "derive_serde", serde(rename = "ACCR") )]
14416	CodeACCR,
14417	#[cfg_attr( feature = "derive_serde", serde(rename = "ACWC") )]
14418	CodeACWC,
14419}
14420
14421impl TransactionIndividualStatus1Code {
14422	pub fn validate(&self) -> Result<(), ValidationError> {
14423		Ok(())
14424	}
14425}
14426
14427
14428// TransactionInterest4 ...
14429#[cfg_attr(feature = "derive_debug", derive(Debug))]
14430#[cfg_attr(feature = "derive_default", derive(Default))]
14431#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14432#[cfg_attr(feature = "derive_clone", derive(Clone))]
14433#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14434pub struct TransactionInterest4 {
14435	#[cfg_attr( feature = "derive_serde", serde(rename = "TtlIntrstAndTaxAmt", skip_serializing_if = "Option::is_none") )]
14436	pub ttl_intrst_and_tax_amt: Option<ActiveOrHistoricCurrencyAndAmount>,
14437	#[cfg_attr( feature = "derive_serde", serde(rename = "Rcrd", skip_serializing_if = "Option::is_none") )]
14438	pub rcrd: Option<Vec<InterestRecord2>>,
14439}
14440
14441impl TransactionInterest4 {
14442	pub fn validate(&self) -> Result<(), ValidationError> {
14443		if let Some(ref val) = self.ttl_intrst_and_tax_amt { val.validate()? }
14444		if let Some(ref vec) = self.rcrd { for item in vec { item.validate()? } }
14445		Ok(())
14446	}
14447}
14448
14449
14450// TransactionParties6 ...
14451#[cfg_attr(feature = "derive_debug", derive(Debug))]
14452#[cfg_attr(feature = "derive_default", derive(Default))]
14453#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14454#[cfg_attr(feature = "derive_clone", derive(Clone))]
14455#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14456pub struct TransactionParties6 {
14457	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty", skip_serializing_if = "Option::is_none") )]
14458	pub initg_pty: Option<Party40Choice>,
14459	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr", skip_serializing_if = "Option::is_none") )]
14460	pub dbtr: Option<Party40Choice>,
14461	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
14462	pub dbtr_acct: Option<CashAccount38>,
14463	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
14464	pub ultmt_dbtr: Option<Party40Choice>,
14465	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr", skip_serializing_if = "Option::is_none") )]
14466	pub cdtr: Option<Party40Choice>,
14467	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
14468	pub cdtr_acct: Option<CashAccount38>,
14469	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
14470	pub ultmt_cdtr: Option<Party40Choice>,
14471	#[cfg_attr( feature = "derive_serde", serde(rename = "TradgPty", skip_serializing_if = "Option::is_none") )]
14472	pub tradg_pty: Option<Party40Choice>,
14473	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14474	pub prtry: Option<Vec<ProprietaryParty5>>,
14475}
14476
14477impl TransactionParties6 {
14478	pub fn validate(&self) -> Result<(), ValidationError> {
14479		if let Some(ref val) = self.initg_pty { val.validate()? }
14480		if let Some(ref val) = self.dbtr { val.validate()? }
14481		if let Some(ref val) = self.dbtr_acct { val.validate()? }
14482		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
14483		if let Some(ref val) = self.cdtr { val.validate()? }
14484		if let Some(ref val) = self.cdtr_acct { val.validate()? }
14485		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
14486		if let Some(ref val) = self.tradg_pty { val.validate()? }
14487		if let Some(ref vec) = self.prtry { for item in vec { item.validate()? } }
14488		Ok(())
14489	}
14490}
14491
14492
14493// TransactionParties8 ...
14494#[cfg_attr(feature = "derive_debug", derive(Debug))]
14495#[cfg_attr(feature = "derive_default", derive(Default))]
14496#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14497#[cfg_attr(feature = "derive_clone", derive(Clone))]
14498#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14499pub struct TransactionParties8 {
14500	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtDbtr", skip_serializing_if = "Option::is_none") )]
14501	pub ultmt_dbtr: Option<Party40Choice>,
14502	#[cfg_attr( feature = "derive_serde", serde(rename = "Dbtr") )]
14503	pub dbtr: Party40Choice,
14504	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAcct", skip_serializing_if = "Option::is_none") )]
14505	pub dbtr_acct: Option<CashAccount38>,
14506	#[cfg_attr( feature = "derive_serde", serde(rename = "InitgPty", skip_serializing_if = "Option::is_none") )]
14507	pub initg_pty: Option<Party40Choice>,
14508	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgt", skip_serializing_if = "Option::is_none") )]
14509	pub dbtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14510	#[cfg_attr( feature = "derive_serde", serde(rename = "DbtrAgtAcct", skip_serializing_if = "Option::is_none") )]
14511	pub dbtr_agt_acct: Option<CashAccount38>,
14512	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1", skip_serializing_if = "Option::is_none") )]
14513	pub prvs_instg_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
14514	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt1Acct", skip_serializing_if = "Option::is_none") )]
14515	pub prvs_instg_agt1_acct: Option<CashAccount38>,
14516	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2", skip_serializing_if = "Option::is_none") )]
14517	pub prvs_instg_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
14518	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt2Acct", skip_serializing_if = "Option::is_none") )]
14519	pub prvs_instg_agt2_acct: Option<CashAccount38>,
14520	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3", skip_serializing_if = "Option::is_none") )]
14521	pub prvs_instg_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
14522	#[cfg_attr( feature = "derive_serde", serde(rename = "PrvsInstgAgt3Acct", skip_serializing_if = "Option::is_none") )]
14523	pub prvs_instg_agt3_acct: Option<CashAccount38>,
14524	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1", skip_serializing_if = "Option::is_none") )]
14525	pub intrmy_agt1: Option<BranchAndFinancialInstitutionIdentification6>,
14526	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt1Acct", skip_serializing_if = "Option::is_none") )]
14527	pub intrmy_agt1_acct: Option<CashAccount38>,
14528	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2", skip_serializing_if = "Option::is_none") )]
14529	pub intrmy_agt2: Option<BranchAndFinancialInstitutionIdentification6>,
14530	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt2Acct", skip_serializing_if = "Option::is_none") )]
14531	pub intrmy_agt2_acct: Option<CashAccount38>,
14532	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3", skip_serializing_if = "Option::is_none") )]
14533	pub intrmy_agt3: Option<BranchAndFinancialInstitutionIdentification6>,
14534	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrmyAgt3Acct", skip_serializing_if = "Option::is_none") )]
14535	pub intrmy_agt3_acct: Option<CashAccount38>,
14536	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgt", skip_serializing_if = "Option::is_none") )]
14537	pub cdtr_agt: Option<BranchAndFinancialInstitutionIdentification6>,
14538	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAgtAcct", skip_serializing_if = "Option::is_none") )]
14539	pub cdtr_agt_acct: Option<CashAccount38>,
14540	#[cfg_attr( feature = "derive_serde", serde(rename = "Cdtr") )]
14541	pub cdtr: Party40Choice,
14542	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtrAcct", skip_serializing_if = "Option::is_none") )]
14543	pub cdtr_acct: Option<CashAccount38>,
14544	#[cfg_attr( feature = "derive_serde", serde(rename = "UltmtCdtr", skip_serializing_if = "Option::is_none") )]
14545	pub ultmt_cdtr: Option<Party40Choice>,
14546}
14547
14548impl TransactionParties8 {
14549	pub fn validate(&self) -> Result<(), ValidationError> {
14550		if let Some(ref val) = self.ultmt_dbtr { val.validate()? }
14551		self.dbtr.validate()?;
14552		if let Some(ref val) = self.dbtr_acct { val.validate()? }
14553		if let Some(ref val) = self.initg_pty { val.validate()? }
14554		if let Some(ref val) = self.dbtr_agt { val.validate()? }
14555		if let Some(ref val) = self.dbtr_agt_acct { val.validate()? }
14556		if let Some(ref val) = self.prvs_instg_agt1 { val.validate()? }
14557		if let Some(ref val) = self.prvs_instg_agt1_acct { val.validate()? }
14558		if let Some(ref val) = self.prvs_instg_agt2 { val.validate()? }
14559		if let Some(ref val) = self.prvs_instg_agt2_acct { val.validate()? }
14560		if let Some(ref val) = self.prvs_instg_agt3 { val.validate()? }
14561		if let Some(ref val) = self.prvs_instg_agt3_acct { val.validate()? }
14562		if let Some(ref val) = self.intrmy_agt1 { val.validate()? }
14563		if let Some(ref val) = self.intrmy_agt1_acct { val.validate()? }
14564		if let Some(ref val) = self.intrmy_agt2 { val.validate()? }
14565		if let Some(ref val) = self.intrmy_agt2_acct { val.validate()? }
14566		if let Some(ref val) = self.intrmy_agt3 { val.validate()? }
14567		if let Some(ref val) = self.intrmy_agt3_acct { val.validate()? }
14568		if let Some(ref val) = self.cdtr_agt { val.validate()? }
14569		if let Some(ref val) = self.cdtr_agt_acct { val.validate()? }
14570		self.cdtr.validate()?;
14571		if let Some(ref val) = self.cdtr_acct { val.validate()? }
14572		if let Some(ref val) = self.ultmt_cdtr { val.validate()? }
14573		Ok(())
14574	}
14575}
14576
14577
14578// TransactionPrice4Choice ...
14579#[cfg_attr(feature = "derive_debug", derive(Debug))]
14580#[cfg_attr(feature = "derive_default", derive(Default))]
14581#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14582#[cfg_attr(feature = "derive_clone", derive(Clone))]
14583#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14584pub struct TransactionPrice4Choice {
14585	#[cfg_attr( feature = "derive_serde", serde(rename = "DealPric", skip_serializing_if = "Option::is_none") )]
14586	pub deal_pric: Option<Price7>,
14587	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14588	pub prtry: Option<Vec<ProprietaryPrice2>>,
14589}
14590
14591impl TransactionPrice4Choice {
14592	pub fn validate(&self) -> Result<(), ValidationError> {
14593		if let Some(ref val) = self.deal_pric { val.validate()? }
14594		if let Some(ref vec) = self.prtry { for item in vec { item.validate()? } }
14595		Ok(())
14596	}
14597}
14598
14599
14600// TransactionQuantities3Choice ...
14601#[cfg_attr(feature = "derive_debug", derive(Debug))]
14602#[cfg_attr(feature = "derive_default", derive(Default))]
14603#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14604#[cfg_attr(feature = "derive_clone", derive(Clone))]
14605#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14606pub struct TransactionQuantities3Choice {
14607	#[cfg_attr( feature = "derive_serde", serde(rename = "Qty", skip_serializing_if = "Option::is_none") )]
14608	pub qty: Option<FinancialInstrumentQuantity1Choice>,
14609	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlAndCurFaceAmt", skip_serializing_if = "Option::is_none") )]
14610	pub orgnl_and_cur_face_amt: Option<OriginalAndCurrentQuantities1>,
14611	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14612	pub prtry: Option<ProprietaryQuantity1>,
14613}
14614
14615impl TransactionQuantities3Choice {
14616	pub fn validate(&self) -> Result<(), ValidationError> {
14617		if let Some(ref val) = self.qty { val.validate()? }
14618		if let Some(ref val) = self.orgnl_and_cur_face_amt { val.validate()? }
14619		if let Some(ref val) = self.prtry { val.validate()? }
14620		Ok(())
14621	}
14622}
14623
14624
14625// TransactionReferences6 ...
14626#[cfg_attr(feature = "derive_debug", derive(Debug))]
14627#[cfg_attr(feature = "derive_default", derive(Default))]
14628#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14629#[cfg_attr(feature = "derive_clone", derive(Clone))]
14630#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14631pub struct TransactionReferences6 {
14632	#[cfg_attr( feature = "derive_serde", serde(rename = "MsgId", skip_serializing_if = "Option::is_none") )]
14633	pub msg_id: Option<String>,
14634	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrRef", skip_serializing_if = "Option::is_none") )]
14635	pub acct_svcr_ref: Option<String>,
14636	#[cfg_attr( feature = "derive_serde", serde(rename = "PmtInfId", skip_serializing_if = "Option::is_none") )]
14637	pub pmt_inf_id: Option<String>,
14638	#[cfg_attr( feature = "derive_serde", serde(rename = "InstrId", skip_serializing_if = "Option::is_none") )]
14639	pub instr_id: Option<String>,
14640	#[cfg_attr( feature = "derive_serde", serde(rename = "EndToEndId", skip_serializing_if = "Option::is_none") )]
14641	pub end_to_end_id: Option<String>,
14642	#[cfg_attr( feature = "derive_serde", serde(rename = "UETR", skip_serializing_if = "Option::is_none") )]
14643	pub uetr: Option<String>,
14644	#[cfg_attr( feature = "derive_serde", serde(rename = "TxId", skip_serializing_if = "Option::is_none") )]
14645	pub tx_id: Option<String>,
14646	#[cfg_attr( feature = "derive_serde", serde(rename = "MndtId", skip_serializing_if = "Option::is_none") )]
14647	pub mndt_id: Option<String>,
14648	#[cfg_attr( feature = "derive_serde", serde(rename = "ChqNb", skip_serializing_if = "Option::is_none") )]
14649	pub chq_nb: Option<String>,
14650	#[cfg_attr( feature = "derive_serde", serde(rename = "ClrSysRef", skip_serializing_if = "Option::is_none") )]
14651	pub clr_sys_ref: Option<String>,
14652	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctOwnrTxId", skip_serializing_if = "Option::is_none") )]
14653	pub acct_ownr_tx_id: Option<String>,
14654	#[cfg_attr( feature = "derive_serde", serde(rename = "AcctSvcrTxId", skip_serializing_if = "Option::is_none") )]
14655	pub acct_svcr_tx_id: Option<String>,
14656	#[cfg_attr( feature = "derive_serde", serde(rename = "MktInfrstrctrTxId", skip_serializing_if = "Option::is_none") )]
14657	pub mkt_infrstrctr_tx_id: Option<String>,
14658	#[cfg_attr( feature = "derive_serde", serde(rename = "PrcgId", skip_serializing_if = "Option::is_none") )]
14659	pub prcg_id: Option<String>,
14660	#[cfg_attr( feature = "derive_serde", serde(rename = "Prtry", skip_serializing_if = "Option::is_none") )]
14661	pub prtry: Option<Vec<ProprietaryReference1>>,
14662}
14663
14664impl TransactionReferences6 {
14665	pub fn validate(&self) -> Result<(), ValidationError> {
14666		if let Some(ref val) = self.msg_id {
14667			if val.chars().count() < 1 {
14668				return Err(ValidationError::new(1001, "msg_id is shorter than the minimum length of 1".to_string()));
14669			}
14670			if val.chars().count() > 35 {
14671				return Err(ValidationError::new(1002, "msg_id exceeds the maximum length of 35".to_string()));
14672			}
14673		}
14674		if let Some(ref val) = self.acct_svcr_ref {
14675			if val.chars().count() < 1 {
14676				return Err(ValidationError::new(1001, "acct_svcr_ref is shorter than the minimum length of 1".to_string()));
14677			}
14678			if val.chars().count() > 35 {
14679				return Err(ValidationError::new(1002, "acct_svcr_ref exceeds the maximum length of 35".to_string()));
14680			}
14681		}
14682		if let Some(ref val) = self.pmt_inf_id {
14683			if val.chars().count() < 1 {
14684				return Err(ValidationError::new(1001, "pmt_inf_id is shorter than the minimum length of 1".to_string()));
14685			}
14686			if val.chars().count() > 35 {
14687				return Err(ValidationError::new(1002, "pmt_inf_id exceeds the maximum length of 35".to_string()));
14688			}
14689		}
14690		if let Some(ref val) = self.instr_id {
14691			if val.chars().count() < 1 {
14692				return Err(ValidationError::new(1001, "instr_id is shorter than the minimum length of 1".to_string()));
14693			}
14694			if val.chars().count() > 35 {
14695				return Err(ValidationError::new(1002, "instr_id exceeds the maximum length of 35".to_string()));
14696			}
14697		}
14698		if let Some(ref val) = self.end_to_end_id {
14699			if val.chars().count() < 1 {
14700				return Err(ValidationError::new(1001, "end_to_end_id is shorter than the minimum length of 1".to_string()));
14701			}
14702			if val.chars().count() > 35 {
14703				return Err(ValidationError::new(1002, "end_to_end_id exceeds the maximum length of 35".to_string()));
14704			}
14705		}
14706		if let Some(ref val) = self.uetr {
14707			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
14708			if !pattern.is_match(val) {
14709				return Err(ValidationError::new(1005, "uetr does not match the required pattern".to_string()));
14710			}
14711		}
14712		if let Some(ref val) = self.tx_id {
14713			if val.chars().count() < 1 {
14714				return Err(ValidationError::new(1001, "tx_id is shorter than the minimum length of 1".to_string()));
14715			}
14716			if val.chars().count() > 35 {
14717				return Err(ValidationError::new(1002, "tx_id exceeds the maximum length of 35".to_string()));
14718			}
14719		}
14720		if let Some(ref val) = self.mndt_id {
14721			if val.chars().count() < 1 {
14722				return Err(ValidationError::new(1001, "mndt_id is shorter than the minimum length of 1".to_string()));
14723			}
14724			if val.chars().count() > 35 {
14725				return Err(ValidationError::new(1002, "mndt_id exceeds the maximum length of 35".to_string()));
14726			}
14727		}
14728		if let Some(ref val) = self.chq_nb {
14729			if val.chars().count() < 1 {
14730				return Err(ValidationError::new(1001, "chq_nb is shorter than the minimum length of 1".to_string()));
14731			}
14732			if val.chars().count() > 35 {
14733				return Err(ValidationError::new(1002, "chq_nb exceeds the maximum length of 35".to_string()));
14734			}
14735		}
14736		if let Some(ref val) = self.clr_sys_ref {
14737			if val.chars().count() < 1 {
14738				return Err(ValidationError::new(1001, "clr_sys_ref is shorter than the minimum length of 1".to_string()));
14739			}
14740			if val.chars().count() > 35 {
14741				return Err(ValidationError::new(1002, "clr_sys_ref exceeds the maximum length of 35".to_string()));
14742			}
14743		}
14744		if let Some(ref val) = self.acct_ownr_tx_id {
14745			if val.chars().count() < 1 {
14746				return Err(ValidationError::new(1001, "acct_ownr_tx_id is shorter than the minimum length of 1".to_string()));
14747			}
14748			if val.chars().count() > 35 {
14749				return Err(ValidationError::new(1002, "acct_ownr_tx_id exceeds the maximum length of 35".to_string()));
14750			}
14751		}
14752		if let Some(ref val) = self.acct_svcr_tx_id {
14753			if val.chars().count() < 1 {
14754				return Err(ValidationError::new(1001, "acct_svcr_tx_id is shorter than the minimum length of 1".to_string()));
14755			}
14756			if val.chars().count() > 35 {
14757				return Err(ValidationError::new(1002, "acct_svcr_tx_id exceeds the maximum length of 35".to_string()));
14758			}
14759		}
14760		if let Some(ref val) = self.mkt_infrstrctr_tx_id {
14761			if val.chars().count() < 1 {
14762				return Err(ValidationError::new(1001, "mkt_infrstrctr_tx_id is shorter than the minimum length of 1".to_string()));
14763			}
14764			if val.chars().count() > 35 {
14765				return Err(ValidationError::new(1002, "mkt_infrstrctr_tx_id exceeds the maximum length of 35".to_string()));
14766			}
14767		}
14768		if let Some(ref val) = self.prcg_id {
14769			if val.chars().count() < 1 {
14770				return Err(ValidationError::new(1001, "prcg_id is shorter than the minimum length of 1".to_string()));
14771			}
14772			if val.chars().count() > 35 {
14773				return Err(ValidationError::new(1002, "prcg_id exceeds the maximum length of 35".to_string()));
14774			}
14775		}
14776		if let Some(ref vec) = self.prtry { for item in vec { item.validate()? } }
14777		Ok(())
14778	}
14779}
14780
14781
14782// TransactionType2 ...
14783#[cfg_attr(feature = "derive_debug", derive(Debug))]
14784#[cfg_attr(feature = "derive_default", derive(Default))]
14785#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14786#[cfg_attr(feature = "derive_clone", derive(Clone))]
14787#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14788pub struct TransactionType2 {
14789	#[cfg_attr( feature = "derive_serde", serde(rename = "Sts") )]
14790	pub sts: EntryStatus1Choice,
14791	#[cfg_attr( feature = "derive_serde", serde(rename = "CdtDbtInd") )]
14792	pub cdt_dbt_ind: CreditDebitCode,
14793	#[cfg_attr( feature = "derive_serde", serde(rename = "FlrLmt", skip_serializing_if = "Option::is_none") )]
14794	pub flr_lmt: Option<Vec<Limit2>>,
14795}
14796
14797impl TransactionType2 {
14798	pub fn validate(&self) -> Result<(), ValidationError> {
14799		self.sts.validate()?;
14800		self.cdt_dbt_ind.validate()?;
14801		if let Some(ref vec) = self.flr_lmt { for item in vec { item.validate()? } }
14802		Ok(())
14803	}
14804}
14805
14806
14807// UnableToApplyIncorrect1 ...
14808#[cfg_attr(feature = "derive_debug", derive(Debug))]
14809#[cfg_attr(feature = "derive_default", derive(Default))]
14810#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14811#[cfg_attr(feature = "derive_clone", derive(Clone))]
14812#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14813pub struct UnableToApplyIncorrect1 {
14814	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd") )]
14815	pub cd: UnableToApplyIncorrectInformation4Code,
14816	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlIncrrctInf", skip_serializing_if = "Option::is_none") )]
14817	pub addtl_incrrct_inf: Option<String>,
14818}
14819
14820impl UnableToApplyIncorrect1 {
14821	pub fn validate(&self) -> Result<(), ValidationError> {
14822		self.cd.validate()?;
14823		if let Some(ref val) = self.addtl_incrrct_inf {
14824			if val.chars().count() < 1 {
14825				return Err(ValidationError::new(1001, "addtl_incrrct_inf is shorter than the minimum length of 1".to_string()));
14826			}
14827			if val.chars().count() > 140 {
14828				return Err(ValidationError::new(1002, "addtl_incrrct_inf exceeds the maximum length of 140".to_string()));
14829			}
14830		}
14831		Ok(())
14832	}
14833}
14834
14835
14836// UnableToApplyIncorrectInformation4Code ...
14837#[cfg_attr(feature = "derive_debug", derive(Debug))]
14838#[cfg_attr(feature = "derive_default", derive(Default))]
14839#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14840#[cfg_attr(feature = "derive_clone", derive(Clone))]
14841#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14842pub enum UnableToApplyIncorrectInformation4Code {
14843	#[cfg_attr(feature = "derive_default", default)]
14844	#[cfg_attr( feature = "derive_serde", serde(rename = "IN01") )]
14845	CodeIN01,
14846	#[cfg_attr( feature = "derive_serde", serde(rename = "IN02") )]
14847	CodeIN02,
14848	#[cfg_attr( feature = "derive_serde", serde(rename = "IN03") )]
14849	CodeIN03,
14850	#[cfg_attr( feature = "derive_serde", serde(rename = "IN04") )]
14851	CodeIN04,
14852	#[cfg_attr( feature = "derive_serde", serde(rename = "IN05") )]
14853	CodeIN05,
14854	#[cfg_attr( feature = "derive_serde", serde(rename = "IN06") )]
14855	CodeIN06,
14856	#[cfg_attr( feature = "derive_serde", serde(rename = "IN07") )]
14857	CodeIN07,
14858	#[cfg_attr( feature = "derive_serde", serde(rename = "IN08") )]
14859	CodeIN08,
14860	#[cfg_attr( feature = "derive_serde", serde(rename = "IN09") )]
14861	CodeIN09,
14862	#[cfg_attr( feature = "derive_serde", serde(rename = "IN10") )]
14863	CodeIN10,
14864	#[cfg_attr( feature = "derive_serde", serde(rename = "IN11") )]
14865	CodeIN11,
14866	#[cfg_attr( feature = "derive_serde", serde(rename = "IN12") )]
14867	CodeIN12,
14868	#[cfg_attr( feature = "derive_serde", serde(rename = "IN13") )]
14869	CodeIN13,
14870	#[cfg_attr( feature = "derive_serde", serde(rename = "IN14") )]
14871	CodeIN14,
14872	#[cfg_attr( feature = "derive_serde", serde(rename = "IN15") )]
14873	CodeIN15,
14874	#[cfg_attr( feature = "derive_serde", serde(rename = "IN16") )]
14875	CodeIN16,
14876	#[cfg_attr( feature = "derive_serde", serde(rename = "IN17") )]
14877	CodeIN17,
14878	#[cfg_attr( feature = "derive_serde", serde(rename = "IN18") )]
14879	CodeIN18,
14880	#[cfg_attr( feature = "derive_serde", serde(rename = "IN19") )]
14881	CodeIN19,
14882	#[cfg_attr( feature = "derive_serde", serde(rename = "MM20") )]
14883	CodeMM20,
14884	#[cfg_attr( feature = "derive_serde", serde(rename = "MM21") )]
14885	CodeMM21,
14886	#[cfg_attr( feature = "derive_serde", serde(rename = "MM22") )]
14887	CodeMM22,
14888	#[cfg_attr( feature = "derive_serde", serde(rename = "MM25") )]
14889	CodeMM25,
14890	#[cfg_attr( feature = "derive_serde", serde(rename = "MM26") )]
14891	CodeMM26,
14892	#[cfg_attr( feature = "derive_serde", serde(rename = "MM27") )]
14893	CodeMM27,
14894	#[cfg_attr( feature = "derive_serde", serde(rename = "MM28") )]
14895	CodeMM28,
14896	#[cfg_attr( feature = "derive_serde", serde(rename = "MM29") )]
14897	CodeMM29,
14898	#[cfg_attr( feature = "derive_serde", serde(rename = "MM30") )]
14899	CodeMM30,
14900	#[cfg_attr( feature = "derive_serde", serde(rename = "MM31") )]
14901	CodeMM31,
14902	#[cfg_attr( feature = "derive_serde", serde(rename = "MM32") )]
14903	CodeMM32,
14904	#[cfg_attr( feature = "derive_serde", serde(rename = "IN33") )]
14905	CodeIN33,
14906	#[cfg_attr( feature = "derive_serde", serde(rename = "MM34") )]
14907	CodeMM34,
14908	#[cfg_attr( feature = "derive_serde", serde(rename = "MM35") )]
14909	CodeMM35,
14910	#[cfg_attr( feature = "derive_serde", serde(rename = "IN36") )]
14911	CodeIN36,
14912	#[cfg_attr( feature = "derive_serde", serde(rename = "IN37") )]
14913	CodeIN37,
14914	#[cfg_attr( feature = "derive_serde", serde(rename = "IN38") )]
14915	CodeIN38,
14916	#[cfg_attr( feature = "derive_serde", serde(rename = "IN39") )]
14917	CodeIN39,
14918	#[cfg_attr( feature = "derive_serde", serde(rename = "NARR") )]
14919	CodeNARR,
14920}
14921
14922impl UnableToApplyIncorrectInformation4Code {
14923	pub fn validate(&self) -> Result<(), ValidationError> {
14924		Ok(())
14925	}
14926}
14927
14928
14929// UnableToApplyJustification3Choice ...
14930#[cfg_attr(feature = "derive_debug", derive(Debug))]
14931#[cfg_attr(feature = "derive_default", derive(Default))]
14932#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14933#[cfg_attr(feature = "derive_clone", derive(Clone))]
14934#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14935pub struct UnableToApplyJustification3Choice {
14936	#[cfg_attr( feature = "derive_serde", serde(rename = "AnyInf", skip_serializing_if = "Option::is_none") )]
14937	pub any_inf: Option<bool>,
14938	#[cfg_attr( feature = "derive_serde", serde(rename = "MssngOrIncrrctInf", skip_serializing_if = "Option::is_none") )]
14939	pub mssng_or_incrrct_inf: Option<MissingOrIncorrectInformation3>,
14940	#[cfg_attr( feature = "derive_serde", serde(rename = "PssblDplctInstr", skip_serializing_if = "Option::is_none") )]
14941	pub pssbl_dplct_instr: Option<bool>,
14942}
14943
14944impl UnableToApplyJustification3Choice {
14945	pub fn validate(&self) -> Result<(), ValidationError> {
14946		if let Some(ref val) = self.mssng_or_incrrct_inf { val.validate()? }
14947		Ok(())
14948	}
14949}
14950
14951
14952// UnableToApplyMissing1 ...
14953#[cfg_attr(feature = "derive_debug", derive(Debug))]
14954#[cfg_attr(feature = "derive_default", derive(Default))]
14955#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14956#[cfg_attr(feature = "derive_clone", derive(Clone))]
14957#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14958pub struct UnableToApplyMissing1 {
14959	#[cfg_attr( feature = "derive_serde", serde(rename = "Cd") )]
14960	pub cd: UnableToApplyMissingInformation3Code,
14961	#[cfg_attr( feature = "derive_serde", serde(rename = "AddtlMssngInf", skip_serializing_if = "Option::is_none") )]
14962	pub addtl_mssng_inf: Option<String>,
14963}
14964
14965impl UnableToApplyMissing1 {
14966	pub fn validate(&self) -> Result<(), ValidationError> {
14967		self.cd.validate()?;
14968		if let Some(ref val) = self.addtl_mssng_inf {
14969			if val.chars().count() < 1 {
14970				return Err(ValidationError::new(1001, "addtl_mssng_inf is shorter than the minimum length of 1".to_string()));
14971			}
14972			if val.chars().count() > 140 {
14973				return Err(ValidationError::new(1002, "addtl_mssng_inf exceeds the maximum length of 140".to_string()));
14974			}
14975		}
14976		Ok(())
14977	}
14978}
14979
14980
14981// UnableToApplyMissingInformation3Code ...
14982#[cfg_attr(feature = "derive_debug", derive(Debug))]
14983#[cfg_attr(feature = "derive_default", derive(Default))]
14984#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
14985#[cfg_attr(feature = "derive_clone", derive(Clone))]
14986#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
14987pub enum UnableToApplyMissingInformation3Code {
14988	#[cfg_attr(feature = "derive_default", default)]
14989	#[cfg_attr( feature = "derive_serde", serde(rename = "MS01") )]
14990	CodeMS01,
14991	#[cfg_attr( feature = "derive_serde", serde(rename = "MS02") )]
14992	CodeMS02,
14993	#[cfg_attr( feature = "derive_serde", serde(rename = "MS03") )]
14994	CodeMS03,
14995	#[cfg_attr( feature = "derive_serde", serde(rename = "MS04") )]
14996	CodeMS04,
14997	#[cfg_attr( feature = "derive_serde", serde(rename = "MS05") )]
14998	CodeMS05,
14999	#[cfg_attr( feature = "derive_serde", serde(rename = "MS06") )]
15000	CodeMS06,
15001	#[cfg_attr( feature = "derive_serde", serde(rename = "MS07") )]
15002	CodeMS07,
15003	#[cfg_attr( feature = "derive_serde", serde(rename = "MS08") )]
15004	CodeMS08,
15005	#[cfg_attr( feature = "derive_serde", serde(rename = "MS09") )]
15006	CodeMS09,
15007	#[cfg_attr( feature = "derive_serde", serde(rename = "MS10") )]
15008	CodeMS10,
15009	#[cfg_attr( feature = "derive_serde", serde(rename = "MS11") )]
15010	CodeMS11,
15011	#[cfg_attr( feature = "derive_serde", serde(rename = "MS12") )]
15012	CodeMS12,
15013	#[cfg_attr( feature = "derive_serde", serde(rename = "MS13") )]
15014	CodeMS13,
15015	#[cfg_attr( feature = "derive_serde", serde(rename = "MS14") )]
15016	CodeMS14,
15017	#[cfg_attr( feature = "derive_serde", serde(rename = "MS15") )]
15018	CodeMS15,
15019	#[cfg_attr( feature = "derive_serde", serde(rename = "MS16") )]
15020	CodeMS16,
15021	#[cfg_attr( feature = "derive_serde", serde(rename = "MS17") )]
15022	CodeMS17,
15023	#[cfg_attr( feature = "derive_serde", serde(rename = "NARR") )]
15024	CodeNARR,
15025}
15026
15027impl UnableToApplyMissingInformation3Code {
15028	pub fn validate(&self) -> Result<(), ValidationError> {
15029		Ok(())
15030	}
15031}
15032
15033
15034// UnderlyingGroupInformation1 ...
15035#[cfg_attr(feature = "derive_debug", derive(Debug))]
15036#[cfg_attr(feature = "derive_default", derive(Default))]
15037#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15038#[cfg_attr(feature = "derive_clone", derive(Clone))]
15039#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15040pub struct UnderlyingGroupInformation1 {
15041	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgId") )]
15042	pub orgnl_msg_id: String,
15043	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgNmId") )]
15044	pub orgnl_msg_nm_id: String,
15045	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlCreDtTm", skip_serializing_if = "Option::is_none") )]
15046	pub orgnl_cre_dt_tm: Option<String>,
15047	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlMsgDlvryChanl", skip_serializing_if = "Option::is_none") )]
15048	pub orgnl_msg_dlvry_chanl: Option<String>,
15049}
15050
15051impl UnderlyingGroupInformation1 {
15052	pub fn validate(&self) -> Result<(), ValidationError> {
15053		if self.orgnl_msg_id.chars().count() < 1 {
15054			return Err(ValidationError::new(1001, "orgnl_msg_id is shorter than the minimum length of 1".to_string()));
15055		}
15056		if self.orgnl_msg_id.chars().count() > 35 {
15057			return Err(ValidationError::new(1002, "orgnl_msg_id exceeds the maximum length of 35".to_string()));
15058		}
15059		if self.orgnl_msg_nm_id.chars().count() < 1 {
15060			return Err(ValidationError::new(1001, "orgnl_msg_nm_id is shorter than the minimum length of 1".to_string()));
15061		}
15062		if self.orgnl_msg_nm_id.chars().count() > 35 {
15063			return Err(ValidationError::new(1002, "orgnl_msg_nm_id exceeds the maximum length of 35".to_string()));
15064		}
15065		if let Some(ref val) = self.orgnl_msg_dlvry_chanl {
15066			if val.chars().count() < 1 {
15067				return Err(ValidationError::new(1001, "orgnl_msg_dlvry_chanl is shorter than the minimum length of 1".to_string()));
15068			}
15069			if val.chars().count() > 35 {
15070				return Err(ValidationError::new(1002, "orgnl_msg_dlvry_chanl exceeds the maximum length of 35".to_string()));
15071			}
15072		}
15073		Ok(())
15074	}
15075}
15076
15077
15078// UnderlyingPaymentInstruction5 ...
15079#[cfg_attr(feature = "derive_debug", derive(Debug))]
15080#[cfg_attr(feature = "derive_default", derive(Default))]
15081#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15082#[cfg_attr(feature = "derive_clone", derive(Clone))]
15083#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15084pub struct UnderlyingPaymentInstruction5 {
15085	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
15086	pub orgnl_grp_inf: Option<UnderlyingGroupInformation1>,
15087	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfId", skip_serializing_if = "Option::is_none") )]
15088	pub orgnl_pmt_inf_id: Option<String>,
15089	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
15090	pub orgnl_instr_id: Option<String>,
15091	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
15092	pub orgnl_end_to_end_id: Option<String>,
15093	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
15094	pub orgnl_uetr: Option<String>,
15095	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstdAmt") )]
15096	pub orgnl_instd_amt: ActiveOrHistoricCurrencyAndAmount,
15097	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdExctnDt", skip_serializing_if = "Option::is_none") )]
15098	pub reqd_exctn_dt: Option<DateAndDateTime2Choice>,
15099	#[cfg_attr( feature = "derive_serde", serde(rename = "ReqdColltnDt", skip_serializing_if = "Option::is_none") )]
15100	pub reqd_colltn_dt: Option<String>,
15101	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
15102	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
15103}
15104
15105impl UnderlyingPaymentInstruction5 {
15106	pub fn validate(&self) -> Result<(), ValidationError> {
15107		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
15108		if let Some(ref val) = self.orgnl_pmt_inf_id {
15109			if val.chars().count() < 1 {
15110				return Err(ValidationError::new(1001, "orgnl_pmt_inf_id is shorter than the minimum length of 1".to_string()));
15111			}
15112			if val.chars().count() > 35 {
15113				return Err(ValidationError::new(1002, "orgnl_pmt_inf_id exceeds the maximum length of 35".to_string()));
15114			}
15115		}
15116		if let Some(ref val) = self.orgnl_instr_id {
15117			if val.chars().count() < 1 {
15118				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
15119			}
15120			if val.chars().count() > 35 {
15121				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
15122			}
15123		}
15124		if let Some(ref val) = self.orgnl_end_to_end_id {
15125			if val.chars().count() < 1 {
15126				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
15127			}
15128			if val.chars().count() > 35 {
15129				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
15130			}
15131		}
15132		if let Some(ref val) = self.orgnl_uetr {
15133			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
15134			if !pattern.is_match(val) {
15135				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
15136			}
15137		}
15138		self.orgnl_instd_amt.validate()?;
15139		if let Some(ref val) = self.reqd_exctn_dt { val.validate()? }
15140		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
15141		Ok(())
15142	}
15143}
15144
15145
15146// UnderlyingPaymentTransaction4 ...
15147#[cfg_attr(feature = "derive_debug", derive(Debug))]
15148#[cfg_attr(feature = "derive_default", derive(Default))]
15149#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15150#[cfg_attr(feature = "derive_clone", derive(Clone))]
15151#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15152pub struct UnderlyingPaymentTransaction4 {
15153	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
15154	pub orgnl_grp_inf: Option<UnderlyingGroupInformation1>,
15155	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlInstrId", skip_serializing_if = "Option::is_none") )]
15156	pub orgnl_instr_id: Option<String>,
15157	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlEndToEndId", skip_serializing_if = "Option::is_none") )]
15158	pub orgnl_end_to_end_id: Option<String>,
15159	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxId", skip_serializing_if = "Option::is_none") )]
15160	pub orgnl_tx_id: Option<String>,
15161	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
15162	pub orgnl_uetr: Option<String>,
15163	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmAmt") )]
15164	pub orgnl_intr_bk_sttlm_amt: ActiveOrHistoricCurrencyAndAmount,
15165	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlIntrBkSttlmDt") )]
15166	pub orgnl_intr_bk_sttlm_dt: String,
15167	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlTxRef", skip_serializing_if = "Option::is_none") )]
15168	pub orgnl_tx_ref: Option<OriginalTransactionReference28>,
15169}
15170
15171impl UnderlyingPaymentTransaction4 {
15172	pub fn validate(&self) -> Result<(), ValidationError> {
15173		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
15174		if let Some(ref val) = self.orgnl_instr_id {
15175			if val.chars().count() < 1 {
15176				return Err(ValidationError::new(1001, "orgnl_instr_id is shorter than the minimum length of 1".to_string()));
15177			}
15178			if val.chars().count() > 35 {
15179				return Err(ValidationError::new(1002, "orgnl_instr_id exceeds the maximum length of 35".to_string()));
15180			}
15181		}
15182		if let Some(ref val) = self.orgnl_end_to_end_id {
15183			if val.chars().count() < 1 {
15184				return Err(ValidationError::new(1001, "orgnl_end_to_end_id is shorter than the minimum length of 1".to_string()));
15185			}
15186			if val.chars().count() > 35 {
15187				return Err(ValidationError::new(1002, "orgnl_end_to_end_id exceeds the maximum length of 35".to_string()));
15188			}
15189		}
15190		if let Some(ref val) = self.orgnl_tx_id {
15191			if val.chars().count() < 1 {
15192				return Err(ValidationError::new(1001, "orgnl_tx_id is shorter than the minimum length of 1".to_string()));
15193			}
15194			if val.chars().count() > 35 {
15195				return Err(ValidationError::new(1002, "orgnl_tx_id exceeds the maximum length of 35".to_string()));
15196			}
15197		}
15198		if let Some(ref val) = self.orgnl_uetr {
15199			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
15200			if !pattern.is_match(val) {
15201				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
15202			}
15203		}
15204		self.orgnl_intr_bk_sttlm_amt.validate()?;
15205		if let Some(ref val) = self.orgnl_tx_ref { val.validate()? }
15206		Ok(())
15207	}
15208}
15209
15210
15211// UnderlyingStatementEntry3 ...
15212#[cfg_attr(feature = "derive_debug", derive(Debug))]
15213#[cfg_attr(feature = "derive_default", derive(Default))]
15214#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15215#[cfg_attr(feature = "derive_clone", derive(Clone))]
15216#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15217pub struct UnderlyingStatementEntry3 {
15218	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInf", skip_serializing_if = "Option::is_none") )]
15219	pub orgnl_grp_inf: Option<OriginalGroupInformation29>,
15220	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlStmtId", skip_serializing_if = "Option::is_none") )]
15221	pub orgnl_stmt_id: Option<String>,
15222	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlNtryId", skip_serializing_if = "Option::is_none") )]
15223	pub orgnl_ntry_id: Option<String>,
15224	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlUETR", skip_serializing_if = "Option::is_none") )]
15225	pub orgnl_uetr: Option<String>,
15226}
15227
15228impl UnderlyingStatementEntry3 {
15229	pub fn validate(&self) -> Result<(), ValidationError> {
15230		if let Some(ref val) = self.orgnl_grp_inf { val.validate()? }
15231		if let Some(ref val) = self.orgnl_stmt_id {
15232			if val.chars().count() < 1 {
15233				return Err(ValidationError::new(1001, "orgnl_stmt_id is shorter than the minimum length of 1".to_string()));
15234			}
15235			if val.chars().count() > 35 {
15236				return Err(ValidationError::new(1002, "orgnl_stmt_id exceeds the maximum length of 35".to_string()));
15237			}
15238		}
15239		if let Some(ref val) = self.orgnl_ntry_id {
15240			if val.chars().count() < 1 {
15241				return Err(ValidationError::new(1001, "orgnl_ntry_id is shorter than the minimum length of 1".to_string()));
15242			}
15243			if val.chars().count() > 35 {
15244				return Err(ValidationError::new(1002, "orgnl_ntry_id exceeds the maximum length of 35".to_string()));
15245			}
15246		}
15247		if let Some(ref val) = self.orgnl_uetr {
15248			let pattern = Regex::new("[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}").unwrap();
15249			if !pattern.is_match(val) {
15250				return Err(ValidationError::new(1005, "orgnl_uetr does not match the required pattern".to_string()));
15251			}
15252		}
15253		Ok(())
15254	}
15255}
15256
15257
15258// UnderlyingTransaction22 ...
15259#[cfg_attr(feature = "derive_debug", derive(Debug))]
15260#[cfg_attr(feature = "derive_default", derive(Default))]
15261#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15262#[cfg_attr(feature = "derive_clone", derive(Clone))]
15263#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15264pub struct UnderlyingTransaction22 {
15265	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInfAndSts", skip_serializing_if = "Option::is_none") )]
15266	pub orgnl_grp_inf_and_sts: Option<OriginalGroupHeader14>,
15267	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfAndSts", skip_serializing_if = "Option::is_none") )]
15268	pub orgnl_pmt_inf_and_sts: Option<Vec<OriginalPaymentInstruction30>>,
15269	#[cfg_attr( feature = "derive_serde", serde(rename = "TxInfAndSts", skip_serializing_if = "Option::is_none") )]
15270	pub tx_inf_and_sts: Option<Vec<PaymentTransaction102>>,
15271}
15272
15273impl UnderlyingTransaction22 {
15274	pub fn validate(&self) -> Result<(), ValidationError> {
15275		if let Some(ref val) = self.orgnl_grp_inf_and_sts { val.validate()? }
15276		if let Some(ref vec) = self.orgnl_pmt_inf_and_sts { for item in vec { item.validate()? } }
15277		if let Some(ref vec) = self.tx_inf_and_sts { for item in vec { item.validate()? } }
15278		Ok(())
15279	}
15280}
15281
15282
15283// UnderlyingTransaction23 ...
15284#[cfg_attr(feature = "derive_debug", derive(Debug))]
15285#[cfg_attr(feature = "derive_default", derive(Default))]
15286#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15287#[cfg_attr(feature = "derive_clone", derive(Clone))]
15288#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15289pub struct UnderlyingTransaction23 {
15290	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInfAndCxl", skip_serializing_if = "Option::is_none") )]
15291	pub orgnl_grp_inf_and_cxl: Option<OriginalGroupHeader15>,
15292	#[cfg_attr( feature = "derive_serde", serde(rename = "TxInf", skip_serializing_if = "Option::is_none") )]
15293	pub tx_inf: Option<Vec<PaymentTransaction106>>,
15294}
15295
15296impl UnderlyingTransaction23 {
15297	pub fn validate(&self) -> Result<(), ValidationError> {
15298		if let Some(ref val) = self.orgnl_grp_inf_and_cxl { val.validate()? }
15299		if let Some(ref vec) = self.tx_inf { for item in vec { item.validate()? } }
15300		Ok(())
15301	}
15302}
15303
15304
15305// UnderlyingTransaction27 ...
15306#[cfg_attr(feature = "derive_debug", derive(Debug))]
15307#[cfg_attr(feature = "derive_default", derive(Default))]
15308#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15309#[cfg_attr(feature = "derive_clone", derive(Clone))]
15310#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15311pub struct UnderlyingTransaction27 {
15312	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlGrpInfAndCxl", skip_serializing_if = "Option::is_none") )]
15313	pub orgnl_grp_inf_and_cxl: Option<OriginalGroupHeader15>,
15314	#[cfg_attr( feature = "derive_serde", serde(rename = "OrgnlPmtInfAndCxl", skip_serializing_if = "Option::is_none") )]
15315	pub orgnl_pmt_inf_and_cxl: Option<Vec<OriginalPaymentInstruction36>>,
15316}
15317
15318impl UnderlyingTransaction27 {
15319	pub fn validate(&self) -> Result<(), ValidationError> {
15320		if let Some(ref val) = self.orgnl_grp_inf_and_cxl { val.validate()? }
15321		if let Some(ref vec) = self.orgnl_pmt_inf_and_cxl { for item in vec { item.validate()? } }
15322		Ok(())
15323	}
15324}
15325
15326
15327// UnderlyingTransaction5Choice ...
15328#[cfg_attr(feature = "derive_debug", derive(Debug))]
15329#[cfg_attr(feature = "derive_default", derive(Default))]
15330#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15331#[cfg_attr(feature = "derive_clone", derive(Clone))]
15332#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15333pub struct UnderlyingTransaction5Choice {
15334	#[cfg_attr( feature = "derive_serde", serde(rename = "Initn", skip_serializing_if = "Option::is_none") )]
15335	pub initn: Option<UnderlyingPaymentInstruction5>,
15336	#[cfg_attr( feature = "derive_serde", serde(rename = "IntrBk", skip_serializing_if = "Option::is_none") )]
15337	pub intr_bk: Option<UnderlyingPaymentTransaction4>,
15338	#[cfg_attr( feature = "derive_serde", serde(rename = "StmtNtry", skip_serializing_if = "Option::is_none") )]
15339	pub stmt_ntry: Option<UnderlyingStatementEntry3>,
15340}
15341
15342impl UnderlyingTransaction5Choice {
15343	pub fn validate(&self) -> Result<(), ValidationError> {
15344		if let Some(ref val) = self.initn { val.validate()? }
15345		if let Some(ref val) = self.intr_bk { val.validate()? }
15346		if let Some(ref val) = self.stmt_ntry { val.validate()? }
15347		Ok(())
15348	}
15349}
15350
15351
15352// UnitOfMeasure1Code ...
15353#[cfg_attr(feature = "derive_debug", derive(Debug))]
15354#[cfg_attr(feature = "derive_default", derive(Default))]
15355#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15356#[cfg_attr(feature = "derive_clone", derive(Clone))]
15357#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15358pub enum UnitOfMeasure1Code {
15359	#[cfg_attr(feature = "derive_default", default)]
15360	#[cfg_attr( feature = "derive_serde", serde(rename = "PIEC") )]
15361	CodePIEC,
15362	#[cfg_attr( feature = "derive_serde", serde(rename = "TONS") )]
15363	CodeTONS,
15364	#[cfg_attr( feature = "derive_serde", serde(rename = "FOOT") )]
15365	CodeFOOT,
15366	#[cfg_attr( feature = "derive_serde", serde(rename = "GBGA") )]
15367	CodeGBGA,
15368	#[cfg_attr( feature = "derive_serde", serde(rename = "USGA") )]
15369	CodeUSGA,
15370	#[cfg_attr( feature = "derive_serde", serde(rename = "GRAM") )]
15371	CodeGRAM,
15372	#[cfg_attr( feature = "derive_serde", serde(rename = "INCH") )]
15373	CodeINCH,
15374	#[cfg_attr( feature = "derive_serde", serde(rename = "KILO") )]
15375	CodeKILO,
15376	#[cfg_attr( feature = "derive_serde", serde(rename = "PUND") )]
15377	CodePUND,
15378	#[cfg_attr( feature = "derive_serde", serde(rename = "METR") )]
15379	CodeMETR,
15380	#[cfg_attr( feature = "derive_serde", serde(rename = "CMET") )]
15381	CodeCMET,
15382	#[cfg_attr( feature = "derive_serde", serde(rename = "MMET") )]
15383	CodeMMET,
15384	#[cfg_attr( feature = "derive_serde", serde(rename = "LITR") )]
15385	CodeLITR,
15386	#[cfg_attr( feature = "derive_serde", serde(rename = "CELI") )]
15387	CodeCELI,
15388	#[cfg_attr( feature = "derive_serde", serde(rename = "MILI") )]
15389	CodeMILI,
15390	#[cfg_attr( feature = "derive_serde", serde(rename = "GBOU") )]
15391	CodeGBOU,
15392	#[cfg_attr( feature = "derive_serde", serde(rename = "USOU") )]
15393	CodeUSOU,
15394	#[cfg_attr( feature = "derive_serde", serde(rename = "GBQA") )]
15395	CodeGBQA,
15396	#[cfg_attr( feature = "derive_serde", serde(rename = "USQA") )]
15397	CodeUSQA,
15398	#[cfg_attr( feature = "derive_serde", serde(rename = "GBPI") )]
15399	CodeGBPI,
15400	#[cfg_attr( feature = "derive_serde", serde(rename = "USPI") )]
15401	CodeUSPI,
15402	#[cfg_attr( feature = "derive_serde", serde(rename = "MILE") )]
15403	CodeMILE,
15404	#[cfg_attr( feature = "derive_serde", serde(rename = "KMET") )]
15405	CodeKMET,
15406	#[cfg_attr( feature = "derive_serde", serde(rename = "YARD") )]
15407	CodeYARD,
15408	#[cfg_attr( feature = "derive_serde", serde(rename = "SQKI") )]
15409	CodeSQKI,
15410	#[cfg_attr( feature = "derive_serde", serde(rename = "HECT") )]
15411	CodeHECT,
15412	#[cfg_attr( feature = "derive_serde", serde(rename = "ARES") )]
15413	CodeARES,
15414	#[cfg_attr( feature = "derive_serde", serde(rename = "SMET") )]
15415	CodeSMET,
15416	#[cfg_attr( feature = "derive_serde", serde(rename = "SCMT") )]
15417	CodeSCMT,
15418	#[cfg_attr( feature = "derive_serde", serde(rename = "SMIL") )]
15419	CodeSMIL,
15420	#[cfg_attr( feature = "derive_serde", serde(rename = "SQMI") )]
15421	CodeSQMI,
15422	#[cfg_attr( feature = "derive_serde", serde(rename = "SQYA") )]
15423	CodeSQYA,
15424	#[cfg_attr( feature = "derive_serde", serde(rename = "SQFO") )]
15425	CodeSQFO,
15426	#[cfg_attr( feature = "derive_serde", serde(rename = "SQIN") )]
15427	CodeSQIN,
15428	#[cfg_attr( feature = "derive_serde", serde(rename = "ACRE") )]
15429	CodeACRE,
15430}
15431
15432impl UnitOfMeasure1Code {
15433	pub fn validate(&self) -> Result<(), ValidationError> {
15434		Ok(())
15435	}
15436}
15437
15438
15439// UserInterface2Code ...
15440#[cfg_attr(feature = "derive_debug", derive(Debug))]
15441#[cfg_attr(feature = "derive_default", derive(Default))]
15442#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15443#[cfg_attr(feature = "derive_clone", derive(Clone))]
15444#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15445pub enum UserInterface2Code {
15446	#[cfg_attr(feature = "derive_default", default)]
15447	#[cfg_attr( feature = "derive_serde", serde(rename = "MDSP") )]
15448	CodeMDSP,
15449	#[cfg_attr( feature = "derive_serde", serde(rename = "CDSP") )]
15450	CodeCDSP,
15451}
15452
15453impl UserInterface2Code {
15454	pub fn validate(&self) -> Result<(), ValidationError> {
15455		Ok(())
15456	}
15457}
15458
15459
15460// YieldedOrValueType1Choice ...
15461#[cfg_attr(feature = "derive_debug", derive(Debug))]
15462#[cfg_attr(feature = "derive_default", derive(Default))]
15463#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15464#[cfg_attr(feature = "derive_clone", derive(Clone))]
15465#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15466pub struct YieldedOrValueType1Choice {
15467	#[cfg_attr( feature = "derive_serde", serde(rename = "Yldd", skip_serializing_if = "Option::is_none") )]
15468	pub yldd: Option<bool>,
15469	#[cfg_attr( feature = "derive_serde", serde(rename = "ValTp", skip_serializing_if = "Option::is_none") )]
15470	pub val_tp: Option<PriceValueType1Code>,
15471}
15472
15473impl YieldedOrValueType1Choice {
15474	pub fn validate(&self) -> Result<(), ValidationError> {
15475		if let Some(ref val) = self.val_tp { val.validate()? }
15476		Ok(())
15477	}
15478}
15479
15480
15481// FedNowMessageSignatureKey ...
15482#[cfg_attr(feature = "derive_debug", derive(Debug))]
15483#[cfg_attr(feature = "derive_default", derive(Default))]
15484#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15485#[cfg_attr(feature = "derive_clone", derive(Clone))]
15486#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15487pub struct FedNowMessageSignatureKey {
15488	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowKeyID") )]
15489	pub fed_now_key_id: String,
15490	#[cfg_attr( feature = "derive_serde", serde(rename = "Name") )]
15491	pub name: String,
15492	#[cfg_attr( feature = "derive_serde", serde(rename = "EncodedPublicKey") )]
15493	pub encoded_public_key: String,
15494	#[cfg_attr( feature = "derive_serde", serde(rename = "Encoding") )]
15495	pub encoding: String,
15496	#[cfg_attr( feature = "derive_serde", serde(rename = "Algorithm", skip_serializing_if = "Option::is_none") )]
15497	pub algorithm: Option<String>,
15498	#[cfg_attr( feature = "derive_serde", serde(rename = "KeyCreationDateTime", skip_serializing_if = "Option::is_none") )]
15499	pub key_creation_date_time: Option<String>,
15500}
15501
15502impl FedNowMessageSignatureKey {
15503	pub fn validate(&self) -> Result<(), ValidationError> {
15504		let pattern = Regex::new("[A-Za-z0-9\\-_]{1,300}").unwrap();
15505		if !pattern.is_match(&self.fed_now_key_id) {
15506			return Err(ValidationError::new(1005, "fed_now_key_id does not match the required pattern".to_string()));
15507		}
15508		let pattern = Regex::new("[A-Za-z0-9\\-_]{1,300}").unwrap();
15509		if !pattern.is_match(&self.name) {
15510			return Err(ValidationError::new(1005, "name does not match the required pattern".to_string()));
15511		}
15512		let pattern = Regex::new("[A-Za-z0-9\\-_]{1,50}").unwrap();
15513		if !pattern.is_match(&self.encoding) {
15514			return Err(ValidationError::new(1005, "encoding does not match the required pattern".to_string()));
15515		}
15516		if let Some(ref val) = self.algorithm {
15517			let pattern = Regex::new("[A-Za-z0-9\\-_]{1,50}").unwrap();
15518			if !pattern.is_match(val) {
15519				return Err(ValidationError::new(1005, "algorithm does not match the required pattern".to_string()));
15520			}
15521		}
15522		Ok(())
15523	}
15524}
15525
15526
15527// FedNowMessageSignatureKeyStatus ...
15528#[cfg_attr(feature = "derive_debug", derive(Debug))]
15529#[cfg_attr(feature = "derive_default", derive(Default))]
15530#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15531#[cfg_attr(feature = "derive_clone", derive(Clone))]
15532#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15533pub struct FedNowMessageSignatureKeyStatus {
15534	#[cfg_attr( feature = "derive_serde", serde(rename = "KeyStatus") )]
15535	pub key_status: String,
15536	#[cfg_attr( feature = "derive_serde", serde(rename = "StatusDateTime") )]
15537	pub status_date_time: String,
15538}
15539
15540impl FedNowMessageSignatureKeyStatus {
15541	pub fn validate(&self) -> Result<(), ValidationError> {
15542		Ok(())
15543	}
15544}
15545
15546
15547// FedNowPublicKeyResponse ...
15548#[cfg_attr(feature = "derive_debug", derive(Debug))]
15549#[cfg_attr(feature = "derive_default", derive(Default))]
15550#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15551#[cfg_attr(feature = "derive_clone", derive(Clone))]
15552#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15553pub struct FedNowPublicKeyResponse {
15554	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowMessageSignatureKeyStatus") )]
15555	pub fed_now_message_signature_key_status: FedNowMessageSignatureKeyStatus,
15556	#[cfg_attr( feature = "derive_serde", serde(rename = "FedNowMessageSignatureKey") )]
15557	pub fed_now_message_signature_key: FedNowMessageSignatureKey,
15558}
15559
15560impl FedNowPublicKeyResponse {
15561	pub fn validate(&self) -> Result<(), ValidationError> {
15562		self.fed_now_message_signature_key_status.validate()?;
15563		self.fed_now_message_signature_key.validate()?;
15564		Ok(())
15565	}
15566}
15567
15568
15569// KeyAddition ...
15570#[cfg_attr(feature = "derive_debug", derive(Debug))]
15571#[cfg_attr(feature = "derive_default", derive(Default))]
15572#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
15573#[cfg_attr(feature = "derive_clone", derive(Clone))]
15574#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
15575pub struct KeyAddition {
15576	#[cfg_attr( feature = "derive_serde", serde(rename = "Key", skip_serializing_if = "Option::is_none") )]
15577	pub key: Option<FedNowMessageSignatureKey>,
15578}
15579
15580impl KeyAddition {
15581	pub fn validate(&self) -> Result<(), ValidationError> {
15582		if let Some(ref val) = self.key { val.validate()? }
15583		Ok(())
15584	}
15585}