// Copyright 2023 Emergent Financial, LLC - All Rights Reserved // // // This software is licensed under the Emergent Financial Limited Public License Version 1.0 // (EF-LPLv1). You may use, copy, modify, and distribute this software under the terms and // conditions of the EF-LPL. For more information, please refer to the full text of the license // at https://github.com/emergentfinancial/ef-lpl. // // // THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // See ISO-20022 Intellectual Property Rights Policy at // // for more information. use validator::Validate; ::lazy_static::lazy_static! { static ref EXACT_4_ALPHA_NUMERIC_TEXT_REGEX: ::regex::Regex = ::regex::Regex::new(r#"[a-zA-Z0-9]{4}"#).unwrap(); } ::lazy_static::lazy_static! { static ref LEI_IDENTIFIER_REGEX: ::regex::Regex = ::regex::Regex::new(r#"[A-Z0-9]{18,18}[0-9]{2,2}"#).unwrap(); } ::lazy_static::lazy_static! { static ref ANY_BIC_DEC_2014_IDENTIFIER_REGEX: ::regex::Regex = ::regex::Regex::new(r#"[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}"#).unwrap(); } ::lazy_static::lazy_static! { static ref ISIN_OCT_2015_IDENTIFIER_REGEX: ::regex::Regex = ::regex::Regex::new(r#"[A-Z]{2,2}[A-Z0-9]{9,9}[0-9]{1,1}"#).unwrap(); } /// Returns the namespace of the schema pub fn namespace() -> String { "urn:iso:std:iso:20022:tech:xsd:seev.049.001.01".to_string() } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct Max35Text { #[validate(length(min = 1, max = 35,))] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct ResponseProcessingStatus1ChoiceEnum { #[serde(rename = "Rjctd", skip_serializing_if = "Option::is_none")] pub rjctd: Option, #[serde(rename = "Accptd", skip_serializing_if = "Option::is_none")] pub accptd: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct ResponseProcessingStatus1Choice { #[serde(flatten)] pub value: ResponseProcessingStatus1ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct SupplementaryDataEnvelope1< A: std::fmt::Debug + Default + Clone + PartialEq + ::serde::Serialize + ::validator::Validate, > { #[validate] #[serde(flatten)] pub value: A, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct ShareholderIdentificationDisclosureResponseStatusAdviceV01< A: std::fmt::Debug + Default + Clone + PartialEq + ::serde::Serialize + ::validator::Validate, > { #[validate] #[serde(rename = "DsclsrRspnId")] pub dsclsr_rspn_id: Max35Text, #[validate] #[serde(rename = "IssrDsclsrReqRef")] pub issr_dsclsr_req_ref: DisclosureRequestIdentification1, #[validate] #[serde(rename = "RspndgIntrmy")] pub rspndg_intrmy: PartyIdentification215, #[serde(rename = "RspnRcptnSts")] pub rspn_rcptn_sts: ResponseProcessingStatus1Choice, #[validate(length(min = 0,))] #[serde(rename = "SplmtryData", default)] pub splmtry_data: Vec>, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct Exact4AlphaNumericText { #[validate(regex = "EXACT_4_ALPHA_NUMERIC_TEXT_REGEX")] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct IsoDate { #[serde(rename = "$text")] pub value: ::chrono::NaiveDate, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateFormat46ChoiceEnum { #[serde(rename = "Dt", skip_serializing_if = "Option::is_none")] pub dt: Option, #[serde(rename = "DtCd", skip_serializing_if = "Option::is_none")] pub dt_cd: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateFormat46Choice { #[serde(flatten)] pub value: DateFormat46ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct IdentificationSource3ChoiceEnum { #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")] pub prtry: Option, #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")] pub cd: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct IdentificationSource3Choice { #[serde(flatten)] pub value: IdentificationSource3ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct IsoDateTime { #[serde(rename = "$text")] pub value: ::chrono::DateTime<::chrono::Utc>, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct RejectedStatus29ChoiceEnum { #[serde(rename = "NoSpcfdRsn", skip_serializing_if = "Option::is_none")] pub no_spcfd_rsn: Option, #[serde(rename = "Rsn", skip_serializing_if = "Option::is_none")] pub rsn: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct RejectedStatus29Choice { #[serde(flatten)] pub value: RejectedStatus29ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DisclosureRequestIdentification1 { #[validate] #[serde(rename = "IssrDsclsrReqId")] pub issr_dsclsr_req_id: Max35Text, #[validate] #[serde(rename = "FinInstrmId")] pub fin_instrm_id: SecurityIdentification19, #[serde(rename = "ShrhldrsDsclsrRcrdDt")] pub shrhldrs_dsclsr_rcrd_dt: DateFormat46Choice, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateCode20ChoiceEnum { #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")] pub prtry: Option, #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")] pub cd: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateCode20Choice { #[serde(flatten)] pub value: DateCode20ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct SecurityIdentification19 { #[serde(rename = "ISIN", skip_serializing_if = "Option::is_none")] pub isin: Option, #[validate(length(min = 0,))] #[serde(rename = "OthrId", default)] pub othr_id: Vec, #[serde(rename = "Desc", skip_serializing_if = "Option::is_none")] pub desc: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct SupplementaryData1< A: std::fmt::Debug + Default + Clone + PartialEq + ::serde::Serialize + ::validator::Validate, > { #[serde(rename = "PlcAndNm", skip_serializing_if = "Option::is_none")] pub plc_and_nm: Option, #[validate] #[serde(rename = "Envlp")] pub envlp: SupplementaryDataEnvelope1, } #[derive(Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)] pub enum NoReasonCode { #[serde(rename = "NORE")] Nore, #[default] Unknown, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct LeiIdentifier { #[validate(regex = "LEI_IDENTIFIER_REGEX")] #[serde(rename = "$text")] pub value: String, } #[derive(Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)] pub enum DateType1Code { #[serde(rename = "UKWN")] Ukwn, #[default] Unknown, } #[derive(Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize)] pub enum RejectionReason52Code { #[serde(rename = "IDRI")] Idri, #[serde(rename = "IDRJ")] Idrj, #[serde(rename = "SVNO")] Svno, #[default] Unknown, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct AcceptedStatus1 { #[serde(rename = "NoSpcfdRsn")] pub no_spcfd_rsn: NoReasonCode, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct OtherIdentification1 { #[validate] #[serde(rename = "Id")] pub id: Max35Text, #[serde(rename = "Sfx", skip_serializing_if = "Option::is_none")] pub sfx: Option, #[serde(rename = "Tp")] pub tp: IdentificationSource3Choice, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct RejectedReason30ChoiceEnum { #[serde(rename = "Cd", skip_serializing_if = "Option::is_none")] pub cd: Option, #[serde(rename = "Prtry", skip_serializing_if = "Option::is_none")] pub prtry: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct RejectedReason30Choice { #[serde(flatten)] pub value: RejectedReason30ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct AnyBicDec2014Identifier { #[validate(regex = "ANY_BIC_DEC_2014_IDENTIFIER_REGEX")] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] #[serde(rename = "Document")] pub struct Document< A: std::fmt::Debug + Default + Clone + PartialEq + ::serde::Serialize + ::validator::Validate, > { #[serde(rename = "ShrhldrIdDsclsrRspnStsAdvc")] pub shrhldr_id_dsclsr_rspn_sts_advc: ShareholderIdentificationDisclosureResponseStatusAdviceV01, #[serde(rename = "@xmlns", default = "namespace")] pub xmlns: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct GenericIdentification30 { #[validate] #[serde(rename = "Id")] pub id: Exact4AlphaNumericText, #[validate] #[serde(rename = "Issr")] pub issr: Max35Text, #[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")] pub schme_nm: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct GenericIdentification36 { #[validate] #[serde(rename = "Id")] pub id: Max35Text, #[validate] #[serde(rename = "Issr")] pub issr: Max35Text, #[serde(rename = "SchmeNm", skip_serializing_if = "Option::is_none")] pub schme_nm: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct IsinOct2015Identifier { #[validate(regex = "ISIN_OCT_2015_IDENTIFIER_REGEX")] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct Max350Text { #[validate(length(min = 1, max = 350,))] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct Max16Text { #[validate(length(min = 1, max = 16,))] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct PartyIdentification195ChoiceEnum { #[serde(rename = "PrtryId", skip_serializing_if = "Option::is_none")] pub prtry_id: Option, #[serde(rename = "AnyBIC", skip_serializing_if = "Option::is_none")] pub any_bic: Option, #[serde(rename = "LEI", skip_serializing_if = "Option::is_none")] pub lei: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct PartyIdentification195Choice { #[serde(flatten)] pub value: PartyIdentification195ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct PartyIdentification215 { #[validate] #[serde(rename = "Nm")] pub nm: Max350Text, #[serde(rename = "Id")] pub id: PartyIdentification195Choice, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct RejectedStatusReason29 { #[serde(rename = "RsnCd")] pub rsn_cd: RejectedReason30Choice, #[serde(rename = "AddtlRsnInf", skip_serializing_if = "Option::is_none")] pub addtl_rsn_inf: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateAndDateTime2ChoiceEnum { #[serde(rename = "DtTm", skip_serializing_if = "Option::is_none")] pub dt_tm: Option, #[serde(rename = "Dt", skip_serializing_if = "Option::is_none")] pub dt: Option, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct DateAndDateTime2Choice { #[serde(flatten)] pub value: DateAndDateTime2ChoiceEnum, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct ExternalFinancialInstrumentIdentificationType1Code { #[validate(length(min = 1, max = 4,))] #[serde(rename = "$text")] pub value: String, } #[derive( Debug, Default, Clone, PartialEq, ::serde::Serialize, ::serde::Deserialize, ::derive_builder::Builder, ::validator::Validate, )] pub struct Max140Text { #[validate(length(min = 1, max = 140,))] #[serde(rename = "$text")] pub value: String, }