open_payments_iso20022_auth/auth_079_001_02.rs
1// Open Payment Message Parsing Library
2// https://github.com/Open-Payments/iso20022-rs
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
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/iso20022-rs
24
25
26#![allow(unused_imports)]
27use regex::Regex;
28use iso20022_common::{common::*, ValidationError};
29#[cfg(feature = "derive_serde")]
30use serde::{Deserialize, Serialize};
31
32// SecuritiesFinancingReportingTransactionStateReportV02 ...
33#[cfg_attr(feature = "derive_debug", derive(Debug))]
34#[cfg_attr(feature = "derive_default", derive(Default))]
35#[cfg_attr(feature = "derive_serde", derive(Serialize, Deserialize))]
36#[cfg_attr(feature = "derive_clone", derive(Clone))]
37#[cfg_attr(feature = "derive_partial_eq", derive(PartialEq))]
38pub struct SecuritiesFinancingReportingTransactionStateReportV02 {
39 #[cfg_attr( feature = "derive_serde", serde(rename = "TradData") )]
40 pub trad_data: TradeStateReport5Choice,
41 #[cfg_attr( feature = "derive_serde", serde(rename = "SplmtryData", skip_serializing_if = "Option::is_none") )]
42 pub splmtry_data: Option<Vec<SupplementaryData1>>,
43}
44
45impl SecuritiesFinancingReportingTransactionStateReportV02 {
46 pub fn validate(&self) -> Result<(), ValidationError> {
47 self.trad_data.validate()?;
48 if let Some(ref vec) = self.splmtry_data { for item in vec { item.validate()? } }
49 Ok(())
50 }
51}