// This file is auto-generated by the revolut-codegen tool.
// Do not edit manually.

#![allow(clippy::all, dead_code)]

/// Error types.
pub mod error {
    /// Error from a `TryFrom` or `FromStr` implementation.
    pub struct ConversionError(::std::borrow::Cow<'static, str>);
    impl ::std::error::Error for ConversionError {}
    impl ::std::fmt::Display for ConversionError {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
            ::std::fmt::Display::fmt(&self.0, f)
        }
    }
    impl ::std::fmt::Debug for ConversionError {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
            ::std::fmt::Debug::fmt(&self.0, f)
        }
    }
    impl From<&'static str> for ConversionError {
        fn from(value: &'static str) -> Self {
            Self(value.into())
        }
    }
    impl From<String> for ConversionError {
        fn from(value: String) -> Self {
            Self(value.into())
        }
    }
}
/// The unique and immutable ID to identify the account resource.
/// This ID has no meaning to the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID to identify the account resource.\nThis ID has no meaning to the account owner.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AccountId(::std::string::String);
impl ::std::ops::Deref for AccountId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AccountId> for ::std::string::String {
    fn from(value: AccountId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AccountId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AccountId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AccountId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AccountId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for AccountId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of money.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money.",
///  "type": "string",
///  "pattern": "^\\d{1,13}\\.\\d{1,5}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Amount(::std::string::String);
impl ::std::ops::Deref for Amount {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Amount> for ::std::string::String {
    fn from(value: Amount) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for Amount {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d{1,13}\\.\\d{1,5}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^\\d{1,13}\\.\\d{1,5}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for Amount {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Amount {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Amount {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for Amount {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`CsvError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Code",
///    "Id",
///    "Message"
///  ],
///  "properties": {
///    "Code": {
///      "description": "The error code in high level that helps categorize the error.",
///      "type": "integer"
///    },
///    "Errors": {
///      "$ref": "#/components/schemas/ErrorDetails"
///    },
///    "Id": {
///      "description": "The ID of the error. You can share this ID with Revolut support for troubleshooting.",
///      "type": "string"
///    },
///    "Message": {
///      "description": "The error message.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CsvError {
    ///The error code in high level that helps categorize the error.
    #[serde(rename = "Code")]
    pub code: i64,
    #[serde(
        rename = "Errors",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub errors: ::std::option::Option<ErrorDetails>,
    ///The ID of the error. You can share this ID with Revolut support for troubleshooting.
    #[serde(rename = "Id")]
    pub id: ::std::string::String,
    ///The error message.
    #[serde(rename = "Message")]
    pub message: ::std::string::String,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Currency(::std::string::String);
impl ::std::ops::Deref for Currency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Currency> for ::std::string::String {
    fn from(value: Currency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for Currency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for Currency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Currency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Currency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for Currency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`DraftPaymentListResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Items",
///    "Links"
///  ],
///  "properties": {
///    "Items": {
///      "type": "array",
///      "items": {
///        "type": "object",
///        "required": [
///          "CreatedAt",
///          "Id",
///          "Status"
///        ],
///        "properties": {
///          "CreatedAt": {
///            "description": "Date time when the draft payment was created.",
///            "type": "string",
///            "format": "date-time"
///          },
///          "Id": {
///            "description": "The ID of the draft payment.",
///            "type": "string",
///            "format": "UUID"
///          },
///          "RequestedExecutionDate": {
///            "description": "The execution date the draft payment is requested.",
///            "type": "string",
///            "format": "YYYY-MM-DD"
///          },
///          "Status": {
///            "$ref": "#/components/schemas/DraftPaymentStatus"
///          },
///          "Title": {
///            "description": "Title of the draft payment.",
///            "type": "string"
///          }
///        }
///      }
///    },
///    "Links": {
///      "description": "Links relevant to the payload.",
///      "type": "object",
///      "properties": {
///        "Next": {
///          "description": "Relative URI to the next page.",
///          "type": "string",
///          "format": "uri"
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DraftPaymentListResponse {
    #[serde(rename = "Items")]
    pub items: ::std::vec::Vec<DraftPaymentListResponseItemsItem>,
    #[serde(rename = "Links")]
    pub links: DraftPaymentListResponseLinks,
}
///`DraftPaymentListResponseItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "CreatedAt",
///    "Id",
///    "Status"
///  ],
///  "properties": {
///    "CreatedAt": {
///      "description": "Date time when the draft payment was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Id": {
///      "description": "The ID of the draft payment.",
///      "type": "string",
///      "format": "UUID"
///    },
///    "RequestedExecutionDate": {
///      "description": "The execution date the draft payment is requested.",
///      "type": "string",
///      "format": "YYYY-MM-DD"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/DraftPaymentStatus"
///    },
///    "Title": {
///      "description": "Title of the draft payment.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DraftPaymentListResponseItemsItem {
    ///Date time when the draft payment was created.
    #[serde(rename = "CreatedAt")]
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the draft payment.
    #[serde(rename = "Id")]
    pub id: ::std::string::String,
    ///The execution date the draft payment is requested.
    #[serde(
        rename = "RequestedExecutionDate",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date: ::std::option::Option<::std::string::String>,
    #[serde(rename = "Status")]
    pub status: DraftPaymentStatus,
    ///Title of the draft payment.
    #[serde(
        rename = "Title",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub title: ::std::option::Option<::std::string::String>,
}
///Links relevant to the payload.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Links relevant to the payload.",
///  "type": "object",
///  "properties": {
///    "Next": {
///      "description": "Relative URI to the next page.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DraftPaymentListResponseLinks {
    ///Relative URI to the next page.
    #[serde(
        rename = "Next",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub next: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for DraftPaymentListResponseLinks {
    fn default() -> Self {
        Self {
            next: Default::default(),
        }
    }
}
///`DraftPaymentResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "DraftPaymentId",
///    "Status",
///    "Transfers"
///  ],
///  "properties": {
///    "DraftPaymentId": {
///      "description": "The ID of the draft payment.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "RequestedExecutionDate": {
///      "description": "The execution date the draft payment is requested.",
///      "type": "string",
///      "format": "YYYY-MM-DD"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/DraftPaymentStatus"
///    },
///    "Transfers": {
///      "$ref": "#/components/schemas/DraftPaymentTransfers"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DraftPaymentResponse {
    ///The ID of the draft payment.
    #[serde(rename = "DraftPaymentId")]
    pub draft_payment_id: ::uuid::Uuid,
    ///The execution date the draft payment is requested.
    #[serde(
        rename = "RequestedExecutionDate",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date: ::std::option::Option<::std::string::String>,
    #[serde(rename = "Status")]
    pub status: DraftPaymentStatus,
    #[serde(rename = "Transfers")]
    pub transfers: DraftPaymentTransfers,
}
///The status of the draft payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the draft payment.",
///  "type": "string",
///  "enum": [
///    "Awaiting",
///    "Processed",
///    "Approved",
///    "Deleted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DraftPaymentStatus {
    Awaiting,
    Processed,
    Approved,
    Deleted,
}
impl ::std::fmt::Display for DraftPaymentStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Awaiting => f.write_str("Awaiting"),
            Self::Processed => f.write_str("Processed"),
            Self::Approved => f.write_str("Approved"),
            Self::Deleted => f.write_str("Deleted"),
        }
    }
}
impl ::std::str::FromStr for DraftPaymentStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Awaiting" => Ok(Self::Awaiting),
            "Processed" => Ok(Self::Processed),
            "Approved" => Ok(Self::Approved),
            "Deleted" => Ok(Self::Deleted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DraftPaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DraftPaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DraftPaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`DraftPaymentTransfer`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Id",
///    "InstructedAmount",
///    "Reference",
///    "Status"
///  ],
///  "properties": {
///    "FailedReason": {
///      "description": "The reason of the `failed` draft payment.",
///      "type": "string"
///    },
///    "FailedReasonCode": {
///      "description": "The reason code for the `failed` draft payment.",
///      "type": "integer"
///    },
///    "Id": {
///      "description": "The ID of the transfer.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "Index": {
///      "description": "The row number the draft payment represents in the CSV file.",
///      "type": "integer"
///    },
///    "InstructedAmount": {
///      "$ref": "#/components/schemas/InstructedAmount"
///    },
///    "Reference": {
///      "description": "The reference of the draft payment.",
///      "type": "string"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/DraftPaymentTransferStatus"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DraftPaymentTransfer {
    ///The reason of the `failed` draft payment.
    #[serde(
        rename = "FailedReason",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub failed_reason: ::std::option::Option<::std::string::String>,
    ///The reason code for the `failed` draft payment.
    #[serde(
        rename = "FailedReasonCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub failed_reason_code: ::std::option::Option<i64>,
    ///The ID of the transfer.
    #[serde(rename = "Id")]
    pub id: ::uuid::Uuid,
    ///The row number the draft payment represents in the CSV file.
    #[serde(
        rename = "Index",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub index: ::std::option::Option<i64>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: InstructedAmount,
    ///The reference of the draft payment.
    #[serde(rename = "Reference")]
    pub reference: ::std::string::String,
    #[serde(rename = "Status")]
    pub status: DraftPaymentTransferStatus,
}
///The status of the draft payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the draft payment.",
///  "type": "string",
///  "enum": [
///    "Created",
///    "Pending",
///    "Completed",
///    "Failed",
///    "Deleted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DraftPaymentTransferStatus {
    Created,
    Pending,
    Completed,
    Failed,
    Deleted,
}
impl ::std::fmt::Display for DraftPaymentTransferStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("Created"),
            Self::Pending => f.write_str("Pending"),
            Self::Completed => f.write_str("Completed"),
            Self::Failed => f.write_str("Failed"),
            Self::Deleted => f.write_str("Deleted"),
        }
    }
}
impl ::std::str::FromStr for DraftPaymentTransferStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Created" => Ok(Self::Created),
            "Pending" => Ok(Self::Pending),
            "Completed" => Ok(Self::Completed),
            "Failed" => Ok(Self::Failed),
            "Deleted" => Ok(Self::Deleted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DraftPaymentTransferStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DraftPaymentTransferStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DraftPaymentTransferStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`DraftPaymentTransfers`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/DraftPaymentTransfer"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DraftPaymentTransfers(pub ::std::vec::Vec<DraftPaymentTransfer>);
impl ::std::ops::Deref for DraftPaymentTransfers {
    type Target = ::std::vec::Vec<DraftPaymentTransfer>;
    fn deref(&self) -> &::std::vec::Vec<DraftPaymentTransfer> {
        &self.0
    }
}
impl ::std::convert::From<DraftPaymentTransfers> for ::std::vec::Vec<DraftPaymentTransfer> {
    fn from(value: DraftPaymentTransfers) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<DraftPaymentTransfer>> for DraftPaymentTransfers {
    fn from(value: ::std::vec::Vec<DraftPaymentTransfer>) -> Self {
        Self(value)
    }
}
///An empty JSON object (`{}`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "An empty JSON object (`{}`).",
///  "type": [
///    "object",
///    "null"
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct EmptyBody(
    pub ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
);
impl ::std::ops::Deref for EmptyBody {
    type Target =
        ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>;
    fn deref(
        &self,
    ) -> &::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>> {
        &self.0
    }
}
impl ::std::convert::From<EmptyBody>
    for ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>
{
    fn from(value: EmptyBody) -> Self {
        value.0
    }
}
impl
    ::std::convert::From<
        ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
    > for EmptyBody
{
    fn from(
        value: ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
    ) -> Self {
        Self(value)
    }
}
///`Error`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Code",
///    "Id",
///    "Message"
///  ],
///  "properties": {
///    "Code": {
///      "description": "The error code in high level that helps categorize the error.",
///      "type": "integer"
///    },
///    "Id": {
///      "description": "The ID of the error. You can share this ID with Revolut support for troubleshooting.",
///      "type": "string"
///    },
///    "Message": {
///      "description": "The error message.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Error {
    ///The error code in high level that helps categorize the error.
    #[serde(rename = "Code")]
    pub code: i64,
    ///The ID of the error. You can share this ID with Revolut support for troubleshooting.
    #[serde(rename = "Id")]
    pub id: ::std::string::String,
    ///The error message.
    #[serde(rename = "Message")]
    pub message: ::std::string::String,
}
///`ErrorDetail`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Errors",
///    "Row"
///  ],
///  "properties": {
///    "Errors": {
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/FieldError"
///      }
///    },
///    "Row": {
///      "description": "The number of the row.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorDetail {
    #[serde(rename = "Errors")]
    pub errors: ::std::vec::Vec<FieldError>,
    ///The number of the row.
    #[serde(rename = "Row")]
    pub row: i64,
}
///The  details of the error.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The  details of the error.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/ErrorDetail"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ErrorDetails(pub ::std::vec::Vec<ErrorDetail>);
impl ::std::ops::Deref for ErrorDetails {
    type Target = ::std::vec::Vec<ErrorDetail>;
    fn deref(&self) -> &::std::vec::Vec<ErrorDetail> {
        &self.0
    }
}
impl ::std::convert::From<ErrorDetails> for ::std::vec::Vec<ErrorDetail> {
    fn from(value: ErrorDetails) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<ErrorDetail>> for ErrorDetails {
    fn from(value: ::std::vec::Vec<ErrorDetail>) -> Self {
        Self(value)
    }
}
///`FieldError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Code",
///    "Message"
///  ],
///  "properties": {
///    "Code": {
///      "description": "The error code in high level that helps categorize the error.",
///      "type": "integer"
///    },
///    "Field": {
///      "description": "The name of the field.",
///      "type": "string"
///    },
///    "Message": {
///      "description": "The error message for the field.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct FieldError {
    ///The error code in high level that helps categorize the error.
    #[serde(rename = "Code")]
    pub code: i64,
    ///The name of the field.
    #[serde(
        rename = "Field",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub field: ::std::option::Option<::std::string::String>,
    ///The error message for the field.
    #[serde(rename = "Message")]
    pub message: ::std::string::String,
}
///`GetApplicationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "client_id": {
///      "description": "The Client ID used to identify the application.",
///      "type": "string"
///    },
///    "id_token_signed_response_alg": {
///      "description": "The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.",
///      "type": "string",
///      "enum": [
///        "tls_client_auth"
///      ]
///    },
///    "org_jwks_endpoint": {
///      "description": "Public URI endpoint where the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has uploaded their JWKS in JSON format.",
///      "type": "string",
///      "format": "uri"
///    },
///    "org_name": {
///      "description": "Legal Entity Identifier or other known organisation name.",
///      "type": "string"
///    },
///    "redirect_uris": {
///      "description": "List of the registered URIs that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will use to interact with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uri"
///      }
///    },
///    "request_object_signing_alg": {
///      "description": "The signing algorithm used to sign request objects. Currently, only `PS256` is supported.",
///      "type": "string",
///      "enum": [
///        "tls_client_auth"
///      ]
///    },
///    "scope": {
///      "description": "List of scopes that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has access to, provided as a **space-separated string**.\nFor example, `\"openid accounts payments\"`.\nPossible scopes to list: `openid`, `accounts`, `payments`, `fundsconfirmation`.",
///      "type": "string"
///    },
///    "tls_client_auth_dn": {
///      "description": "Distinguished name (DN) of the transport certificate used by the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).",
///      "type": "string"
///    },
///    "token_endpoint_auth_method": {
///      "description": "Specifies the authentication method for the `/token` endpoint.\n\nCurrently, only `tls_client_auth` is supported.",
///      "type": "string",
///      "enum": [
///        "tls_client_auth"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetApplicationResponse {
    ///The Client ID used to identify the application.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub client_id: ::std::option::Option<::std::string::String>,
    ///The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id_token_signed_response_alg:
        ::std::option::Option<GetApplicationResponseIdTokenSignedResponseAlg>,
    ///Public URI endpoint where the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has uploaded their JWKS in JSON format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub org_jwks_endpoint: ::std::option::Option<::std::string::String>,
    ///Legal Entity Identifier or other known organisation name.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub org_name: ::std::option::Option<::std::string::String>,
    ///List of the registered URIs that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will use to interact with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub redirect_uris: ::std::vec::Vec<::std::string::String>,
    ///The signing algorithm used to sign request objects. Currently, only `PS256` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub request_object_signing_alg:
        ::std::option::Option<GetApplicationResponseRequestObjectSigningAlg>,
    /// List of scopes that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has access to, provided as a **space-separated string**.
    /// For example, `"openid accounts payments"`.
    /// Possible scopes to list: `openid`, `accounts`, `payments`, `fundsconfirmation`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub scope: ::std::option::Option<::std::string::String>,
    ///Distinguished name (DN) of the transport certificate used by the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub tls_client_auth_dn: ::std::option::Option<::std::string::String>,
    /// Specifies the authentication method for the `/token` endpoint.
    ///
    /// Currently, only `tls_client_auth` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token_endpoint_auth_method:
        ::std::option::Option<GetApplicationResponseTokenEndpointAuthMethod>,
}
impl ::std::default::Default for GetApplicationResponse {
    fn default() -> Self {
        Self {
            client_id: Default::default(),
            id_token_signed_response_alg: Default::default(),
            org_jwks_endpoint: Default::default(),
            org_name: Default::default(),
            redirect_uris: Default::default(),
            request_object_signing_alg: Default::default(),
            scope: Default::default(),
            tls_client_auth_dn: Default::default(),
            token_endpoint_auth_method: Default::default(),
        }
    }
}
///The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.",
///  "type": "string",
///  "enum": [
///    "tls_client_auth"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum GetApplicationResponseIdTokenSignedResponseAlg {
    #[serde(rename = "tls_client_auth")]
    TlsClientAuth,
}
impl ::std::fmt::Display for GetApplicationResponseIdTokenSignedResponseAlg {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TlsClientAuth => f.write_str("tls_client_auth"),
        }
    }
}
impl ::std::str::FromStr for GetApplicationResponseIdTokenSignedResponseAlg {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "tls_client_auth" => Ok(Self::TlsClientAuth),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for GetApplicationResponseIdTokenSignedResponseAlg {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for GetApplicationResponseIdTokenSignedResponseAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for GetApplicationResponseIdTokenSignedResponseAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The signing algorithm used to sign request objects. Currently, only `PS256` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The signing algorithm used to sign request objects. Currently, only `PS256` is supported.",
///  "type": "string",
///  "enum": [
///    "tls_client_auth"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum GetApplicationResponseRequestObjectSigningAlg {
    #[serde(rename = "tls_client_auth")]
    TlsClientAuth,
}
impl ::std::fmt::Display for GetApplicationResponseRequestObjectSigningAlg {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TlsClientAuth => f.write_str("tls_client_auth"),
        }
    }
}
impl ::std::str::FromStr for GetApplicationResponseRequestObjectSigningAlg {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "tls_client_auth" => Ok(Self::TlsClientAuth),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for GetApplicationResponseRequestObjectSigningAlg {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for GetApplicationResponseRequestObjectSigningAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for GetApplicationResponseRequestObjectSigningAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Specifies the authentication method for the `/token` endpoint.
///
/// Currently, only `tls_client_auth` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Specifies the authentication method for the `/token` endpoint.\n\nCurrently, only `tls_client_auth` is supported.",
///  "type": "string",
///  "enum": [
///    "tls_client_auth"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum GetApplicationResponseTokenEndpointAuthMethod {
    #[serde(rename = "tls_client_auth")]
    TlsClientAuth,
}
impl ::std::fmt::Display for GetApplicationResponseTokenEndpointAuthMethod {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TlsClientAuth => f.write_str("tls_client_auth"),
        }
    }
}
impl ::std::str::FromStr for GetApplicationResponseTokenEndpointAuthMethod {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "tls_client_auth" => Ok(Self::TlsClientAuth),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for GetApplicationResponseTokenEndpointAuthMethod {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for GetApplicationResponseTokenEndpointAuthMethod
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for GetApplicationResponseTokenEndpointAuthMethod
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`InstructedAmount`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/Amount"
///    },
///    "Currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: Amount,
    #[serde(rename = "Currency")]
    pub currency: Currency,
}
///Links relevant to the payload.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Links relevant to the payload.",
///  "type": "object",
///  "required": [
///    "Self"
///  ],
///  "properties": {
///    "Next": {
///      "description": "The absolute URI to the next pagination resource.",
///      "type": "string",
///      "format": "uri"
///    },
///    "Prev": {
///      "description": "The absolute URI to the previous pagination resource.",
///      "type": "string",
///      "format": "uri"
///    },
///    "Self": {
///      "description": "The absolute URI to the resource.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Links {
    ///The absolute URI to the next pagination resource.
    #[serde(
        rename = "Next",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub next: ::std::option::Option<::std::string::String>,
    ///The absolute URI to the previous pagination resource.
    #[serde(
        rename = "Prev",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub prev: ::std::option::Option<::std::string::String>,
    ///The absolute URI to the resource.
    #[serde(rename = "Self")]
    pub self_: ::std::string::String,
}
///Meta data relevant to the payload.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "MetaData",
///  "description": "Meta data relevant to the payload.",
///  "type": "object",
///  "properties": {
///    "TotalPages": {
///      "description": "Used for pagination. Indicates how many pages of results are available.",
///      "type": "integer",
///      "format": "int32"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Meta {
    ///Used for pagination. Indicates how many pages of results are available.
    #[serde(
        rename = "TotalPages",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub total_pages: ::std::option::Option<i32>,
}
impl ::std::default::Default for Meta {
    fn default() -> Self {
        Self {
            total_pages: Default::default(),
        }
    }
}
///The unique ID of the account that credit and debit entries are made to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID of the account that credit and debit entries are made to.",
///  "type": "object",
///  "required": [
///    "AccountId",
///    "AccountSubType",
///    "AccountType",
///    "Currency"
///  ],
///  "properties": {
///    "Account": {
///      "description": "The details to identify an account.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBCashAccount5"
///      }
///    },
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "AccountSubType": {
///      "$ref": "#/components/schemas/OBExternalAccountSubType1Code"
///    },
///    "AccountType": {
///      "$ref": "#/components/schemas/OBExternalAccountType1Code"
///    },
///    "Currency": {
///      "description": "The currency that the account is held in ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case).\n\nThis value is used only when one account number covers multiple accounts for different currencies, and the initiating party needs to identify which currency to use for settlement on the account.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "Nickname": {
///      "description": "The nickname of the account that the account owner assigns to easily identify the account.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObAccount3 {
    ///The details to identify an account.
    #[serde(
        rename = "Account",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub account: ::std::vec::Vec<ObCashAccount5>,
    #[serde(rename = "AccountId")]
    pub account_id: AccountId,
    #[serde(rename = "AccountSubType")]
    pub account_sub_type: ObExternalAccountSubType1Code,
    #[serde(rename = "AccountType")]
    pub account_type: ObExternalAccountType1Code,
    /// The currency that the account is held in ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case).
    ///
    /// This value is used only when one account number covers multiple accounts for different currencies, and the initiating party needs to identify which currency to use for settlement on the account.
    #[serde(rename = "Currency")]
    pub currency: ObAccount3Currency,
    ///The nickname of the account that the account owner assigns to easily identify the account.
    #[serde(
        rename = "Nickname",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub nickname: ::std::option::Option<ObAccount3Nickname>,
}
/// The currency that the account is held in ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case).
///
/// This value is used only when one account number covers multiple accounts for different currencies, and the initiating party needs to identify which currency to use for settlement on the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that the account is held in ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case).\n\nThis value is used only when one account number covers multiple accounts for different currencies, and the initiating party needs to identify which currency to use for settlement on the account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObAccount3Currency(::std::string::String);
impl ::std::ops::Deref for ObAccount3Currency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObAccount3Currency> for ::std::string::String {
    fn from(value: ObAccount3Currency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObAccount3Currency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObAccount3Currency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObAccount3Currency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObAccount3Currency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObAccount3Currency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The nickname of the account that the account owner assigns to easily identify the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The nickname of the account that the account owner assigns to easily identify the account.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObAccount3Nickname(::std::string::String);
impl ::std::ops::Deref for ObAccount3Nickname {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObAccount3Nickname> for ::std::string::String {
    fn from(value: ObAccount3Nickname) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObAccount3Nickname {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObAccount3Nickname {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObAccount3Nickname {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObAccount3Nickname {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObAccount3Nickname {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of money where the unit of currency is explicit and compliant with [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money where the unit of currency is explicit and compliant with [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).",
///  "type": "string",
///  "pattern": "^\\d{1,13}\\.\\d{1,5}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObActiveCurrencyAndAmountSimpleType(::std::string::String);
impl ::std::ops::Deref for ObActiveCurrencyAndAmountSimpleType {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObActiveCurrencyAndAmountSimpleType> for ::std::string::String {
    fn from(value: ObActiveCurrencyAndAmountSimpleType) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObActiveCurrencyAndAmountSimpleType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d{1,13}\\.\\d{1,5}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^\\d{1,13}\\.\\d{1,5}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObActiveCurrencyAndAmountSimpleType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObActiveCurrencyAndAmountSimpleType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObActiveCurrencyAndAmountSimpleType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObActiveCurrencyAndAmountSimpleType {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the cash balance after a transaction entry is applied to the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the cash balance after a transaction entry is applied to the account.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObActiveOrHistoricCurrencyAndAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObActiveOrHistoricCurrencyAndAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObActiveOrHistoricCurrencyAndAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObActiveOrHistoricCurrencyAndAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObActiveOrHistoricCurrencyAndAmountCurrency> for ::std::string::String {
    fn from(value: ObActiveOrHistoricCurrencyAndAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObActiveOrHistoricCurrencyAndAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObActiveOrHistoricCurrencyAndAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObActiveOrHistoricCurrencyAndAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObActiveOrHistoricCurrencyAndAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObActiveOrHistoricCurrencyAndAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The balance type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The balance type.",
///  "type": "string",
///  "enum": [
///    "InterimAvailable",
///    "InterimBooked",
///    "ClosingAvailable",
///    "ClosingBooked",
///    "ClosingCleared",
///    "Expected",
///    "ForwardAvailable",
///    "Information",
///    "InterimCleared",
///    "OpeningAvailable",
///    "OpeningBooked",
///    "OpeningCleared",
///    "PreviouslyClosedBooked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObBalanceType1Code {
    InterimAvailable,
    InterimBooked,
    ClosingAvailable,
    ClosingBooked,
    ClosingCleared,
    Expected,
    ForwardAvailable,
    Information,
    InterimCleared,
    OpeningAvailable,
    OpeningBooked,
    OpeningCleared,
    PreviouslyClosedBooked,
}
impl ::std::fmt::Display for ObBalanceType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::InterimAvailable => f.write_str("InterimAvailable"),
            Self::InterimBooked => f.write_str("InterimBooked"),
            Self::ClosingAvailable => f.write_str("ClosingAvailable"),
            Self::ClosingBooked => f.write_str("ClosingBooked"),
            Self::ClosingCleared => f.write_str("ClosingCleared"),
            Self::Expected => f.write_str("Expected"),
            Self::ForwardAvailable => f.write_str("ForwardAvailable"),
            Self::Information => f.write_str("Information"),
            Self::InterimCleared => f.write_str("InterimCleared"),
            Self::OpeningAvailable => f.write_str("OpeningAvailable"),
            Self::OpeningBooked => f.write_str("OpeningBooked"),
            Self::OpeningCleared => f.write_str("OpeningCleared"),
            Self::PreviouslyClosedBooked => f.write_str("PreviouslyClosedBooked"),
        }
    }
}
impl ::std::str::FromStr for ObBalanceType1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "InterimAvailable" => Ok(Self::InterimAvailable),
            "InterimBooked" => Ok(Self::InterimBooked),
            "ClosingAvailable" => Ok(Self::ClosingAvailable),
            "ClosingBooked" => Ok(Self::ClosingBooked),
            "ClosingCleared" => Ok(Self::ClosingCleared),
            "Expected" => Ok(Self::Expected),
            "ForwardAvailable" => Ok(Self::ForwardAvailable),
            "Information" => Ok(Self::Information),
            "InterimCleared" => Ok(Self::InterimCleared),
            "OpeningAvailable" => Ok(Self::OpeningAvailable),
            "OpeningBooked" => Ok(Self::OpeningBooked),
            "OpeningCleared" => Ok(Self::OpeningCleared),
            "PreviouslyClosedBooked" => Ok(Self::PreviouslyClosedBooked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObBalanceType1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObBalanceType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObBalanceType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ObBeneficiary3`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "BeneficiaryId": {
///      "description": "The unique and immutable ID to identify the beneficiary resource.\nThis ID has no meaning to the account owner.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccount5"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObBeneficiary3 {
    #[serde(
        rename = "AccountId",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub account_id: ::std::option::Option<AccountId>,
    /// The unique and immutable ID to identify the beneficiary resource.
    /// This ID has no meaning to the account owner.
    #[serde(
        rename = "BeneficiaryId",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub beneficiary_id: ::std::option::Option<ObBeneficiary3BeneficiaryId>,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccount5>,
}
impl ::std::default::Default for ObBeneficiary3 {
    fn default() -> Self {
        Self {
            account_id: Default::default(),
            beneficiary_id: Default::default(),
            creditor_account: Default::default(),
        }
    }
}
/// The unique and immutable ID to identify the beneficiary resource.
/// This ID has no meaning to the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID to identify the beneficiary resource.\nThis ID has no meaning to the account owner.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObBeneficiary3BeneficiaryId(::std::string::String);
impl ::std::ops::Deref for ObBeneficiary3BeneficiaryId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObBeneficiary3BeneficiaryId> for ::std::string::String {
    fn from(value: ObBeneficiary3BeneficiaryId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObBeneficiary3BeneficiaryId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObBeneficiary3BeneficiaryId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObBeneficiary3BeneficiaryId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObBeneficiary3BeneficiaryId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObBeneficiary3BeneficiaryId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The party that manages the account on behalf of the account owner by:
/// - Managing the registration and booking of entries on the account.
/// - Calculating balances on the account.
/// - Providing information about the account.
///
/// This is the servicer of the beneficiary account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The party that manages the account on behalf of the account owner by:\n- Managing the registration and booking of entries on the account.\n- Calculating balances on the account.\n- Providing information about the account.\n\nThis is the servicer of the beneficiary account.",
///  "type": "object",
///  "properties": {
///    "Identification": {
///      "description": "The unique ID of the servicing institution.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The name of a known agent used to identify the agent.",
///      "type": "string",
///      "maxLength": 140,
///      "minLength": 1
///    },
///    "PostalAddress": {
///      "$ref": "#/components/schemas/OBPostalAddress6"
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBExternalFinancialInstitutionIdentification4Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObBranchAndFinancialInstitutionIdentification6 {
    ///The unique ID of the servicing institution.
    #[serde(
        rename = "Identification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub identification:
        ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6Identification>,
    ///The name of a known agent used to identify the agent.
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6Name>,
    #[serde(
        rename = "PostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub postal_address: ::std::option::Option<ObPostalAddress6>,
    #[serde(
        rename = "SchemeName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub scheme_name: ::std::option::Option<ObExternalFinancialInstitutionIdentification4Code>,
}
impl ::std::default::Default for ObBranchAndFinancialInstitutionIdentification6 {
    fn default() -> Self {
        Self {
            identification: Default::default(),
            name: Default::default(),
            postal_address: Default::default(),
            scheme_name: Default::default(),
        }
    }
}
///The unique ID of the servicing institution.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID of the servicing institution.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObBranchAndFinancialInstitutionIdentification6Identification(::std::string::String);
impl ::std::ops::Deref for ObBranchAndFinancialInstitutionIdentification6Identification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObBranchAndFinancialInstitutionIdentification6Identification>
    for ::std::string::String
{
    fn from(value: ObBranchAndFinancialInstitutionIdentification6Identification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObBranchAndFinancialInstitutionIdentification6Identification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObBranchAndFinancialInstitutionIdentification6Identification
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObBranchAndFinancialInstitutionIdentification6Identification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObBranchAndFinancialInstitutionIdentification6Identification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObBranchAndFinancialInstitutionIdentification6Identification
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of a known agent used to identify the agent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of a known agent used to identify the agent.",
///  "type": "string",
///  "maxLength": 140,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObBranchAndFinancialInstitutionIdentification6Name(::std::string::String);
impl ::std::ops::Deref for ObBranchAndFinancialInstitutionIdentification6Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObBranchAndFinancialInstitutionIdentification6Name>
    for ::std::string::String
{
    fn from(value: ObBranchAndFinancialInstitutionIdentification6Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObBranchAndFinancialInstitutionIdentification6Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 140usize {
            return Err("longer than 140 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObBranchAndFinancialInstitutionIdentification6Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObBranchAndFinancialInstitutionIdentification6Name
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObBranchAndFinancialInstitutionIdentification6Name
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObBranchAndFinancialInstitutionIdentification6Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The details to identify the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details to identify the account.",
///  "type": "object",
///  "required": [
///    "Identification",
///    "SchemeName"
///  ],
///  "properties": {
///    "Identification": {
///      "description": "The identification of the account.\n\n:::warning[Unique account identifier]\nThis field will typically contain an account number or an IBAN which must not be considered as a unique identifier for the account. Several currency subacounts can share this same identifier.\n\nIf you need a unique identifier for each account, ensure you use the `Data.Account.AccountId` instead.\n:::\n",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBRevolutAccountIdentificationCode"
///    },
///    "SecondaryIdentification": {
///      "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///      "type": "string",
///      "maxLength": 34,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashAccount5 {
    /// The identification of the account.
    ///
    /// :::warning[Unique account identifier]
    /// This field will typically contain an account number or an IBAN which must not be considered as a unique identifier for the account. Several currency subacounts can share this same identifier.
    ///
    /// If you need a unique identifier for each account, ensure you use the `Data.Account.AccountId` instead.
    /// :::
    ///
    #[serde(rename = "Identification")]
    pub identification: ObCashAccount5Identification,
    /// The account name that the account servicing institution assigns.
    ///
    /// The account name is the name or names of the account owner(s) represented at an account level.
    ///
    /// The account name is not the product name or the nickname of the account.
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObCashAccount5Name>,
    #[serde(rename = "SchemeName")]
    pub scheme_name: ObRevolutAccountIdentificationCode,
    /// The secondary account ID that the account servicing institution assigns.
    ///
    /// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
    #[serde(
        rename = "SecondaryIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub secondary_identification: ::std::option::Option<ObCashAccount5SecondaryIdentification>,
}
/// The identification of the account.
///
/// :::warning[Unique account identifier]
/// This field will typically contain an account number or an IBAN which must not be considered as a unique identifier for the account. Several currency subacounts can share this same identifier.
///
/// If you need a unique identifier for each account, ensure you use the `Data.Account.AccountId` instead.
/// :::
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The identification of the account.\n\n:::warning[Unique account identifier]\nThis field will typically contain an account number or an IBAN which must not be considered as a unique identifier for the account. Several currency subacounts can share this same identifier.\n\nIf you need a unique identifier for each account, ensure you use the `Data.Account.AccountId` instead.\n:::\n",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount5Identification(::std::string::String);
impl ::std::ops::Deref for ObCashAccount5Identification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount5Identification> for ::std::string::String {
    fn from(value: ObCashAccount5Identification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount5Identification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount5Identification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount5Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount5Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount5Identification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The account name that the account servicing institution assigns.
///
/// The account name is the name or names of the account owner(s) represented at an account level.
///
/// The account name is not the product name or the nickname of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount5Name(::std::string::String);
impl ::std::ops::Deref for ObCashAccount5Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount5Name> for ::std::string::String {
    fn from(value: ObCashAccount5Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount5Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount5Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount5Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount5Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount5Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The secondary account ID that the account servicing institution assigns.
///
/// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///  "type": "string",
///  "maxLength": 34,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount5SecondaryIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccount5SecondaryIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount5SecondaryIdentification> for ::std::string::String {
    fn from(value: ObCashAccount5SecondaryIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount5SecondaryIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 34usize {
            return Err("longer than 34 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount5SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount5SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount5SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount5SecondaryIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID of the account in the case of a transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID of the account in the case of a transaction.",
///  "type": "object",
///  "properties": {
///    "Identification": {
///      "description": "The account ID that the institution assigns to identify an account, which is known by the account owner.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBExternalAccountIdentification4Code"
///    },
///    "SecondaryIdentification": {
///      "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///      "type": "string",
///      "maxLength": 34,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashAccount6 {
    ///The account ID that the institution assigns to identify an account, which is known by the account owner.
    #[serde(
        rename = "Identification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub identification: ::std::option::Option<ObCashAccount6Identification>,
    /// The account name that the account servicing institution assigns.
    ///
    /// The account name is the name or names of the account owner(s) represented at an account level.
    ///
    /// The account name is not the product name or the nickname of the account.
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObCashAccount6Name>,
    #[serde(
        rename = "SchemeName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub scheme_name: ::std::option::Option<ObExternalAccountIdentification4Code>,
    /// The secondary account ID that the account servicing institution assigns.
    ///
    /// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
    #[serde(
        rename = "SecondaryIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub secondary_identification: ::std::option::Option<ObCashAccount6SecondaryIdentification>,
}
impl ::std::default::Default for ObCashAccount6 {
    fn default() -> Self {
        Self {
            identification: Default::default(),
            name: Default::default(),
            scheme_name: Default::default(),
            secondary_identification: Default::default(),
        }
    }
}
///The account ID that the institution assigns to identify an account, which is known by the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account ID that the institution assigns to identify an account, which is known by the account owner.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount6Identification(::std::string::String);
impl ::std::ops::Deref for ObCashAccount6Identification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount6Identification> for ::std::string::String {
    fn from(value: ObCashAccount6Identification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount6Identification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount6Identification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount6Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount6Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount6Identification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The account name that the account servicing institution assigns.
///
/// The account name is the name or names of the account owner(s) represented at an account level.
///
/// The account name is not the product name or the nickname of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount6Name(::std::string::String);
impl ::std::ops::Deref for ObCashAccount6Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount6Name> for ::std::string::String {
    fn from(value: ObCashAccount6Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount6Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount6Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount6Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount6Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount6Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The secondary account ID that the account servicing institution assigns.
///
/// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///  "type": "string",
///  "maxLength": 34,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccount6SecondaryIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccount6SecondaryIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccount6SecondaryIdentification> for ::std::string::String {
    fn from(value: ObCashAccount6SecondaryIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccount6SecondaryIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 34usize {
            return Err("longer than 34 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccount6SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccount6SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccount6SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccount6SecondaryIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The details to identify the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details to identify the account.",
///  "type": "object",
///  "required": [
///    "Identification",
///    "Name",
///    "SchemeName"
///  ],
///  "properties": {
///    "Identification": {
///      "description": "The account ID that the institution assigns to identify an account, which is known by the account owner.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::note\n[ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary)s might optionally validate this name to confirm the payee.\n:::",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBExternalAccountIdentification4Code"
///    },
///    "SecondaryIdentification": {
///      "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///      "type": "string",
///      "maxLength": 34,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashAccountCreditor3 {
    ///The account ID that the institution assigns to identify an account, which is known by the account owner.
    #[serde(rename = "Identification")]
    pub identification: ObCashAccountCreditor3Identification,
    /// The account name that the account servicing institution assigns.
    ///
    /// The account name is the name or names of the account owner(s) represented at an account level.
    ///
    /// The account name is not the product name or the nickname of the account.
    ///
    /// :::note
    /// [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary)s might optionally validate this name to confirm the payee.
    /// :::
    #[serde(rename = "Name")]
    pub name: ObCashAccountCreditor3Name,
    #[serde(rename = "SchemeName")]
    pub scheme_name: ObExternalAccountIdentification4Code,
    /// The secondary account ID that the account servicing institution assigns.
    ///
    /// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
    #[serde(
        rename = "SecondaryIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub secondary_identification:
        ::std::option::Option<ObCashAccountCreditor3SecondaryIdentification>,
}
///The account ID that the institution assigns to identify an account, which is known by the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account ID that the institution assigns to identify an account, which is known by the account owner.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountCreditor3Identification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountCreditor3Identification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountCreditor3Identification> for ::std::string::String {
    fn from(value: ObCashAccountCreditor3Identification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountCreditor3Identification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountCreditor3Identification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountCreditor3Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountCreditor3Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountCreditor3Identification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The account name that the account servicing institution assigns.
///
/// The account name is the name or names of the account owner(s) represented at an account level.
///
/// The account name is not the product name or the nickname of the account.
///
/// :::note
/// [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary)s might optionally validate this name to confirm the payee.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account name that the account servicing institution assigns.\n\nThe account name is the name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::note\n[ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary)s might optionally validate this name to confirm the payee.\n:::",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountCreditor3Name(::std::string::String);
impl ::std::ops::Deref for ObCashAccountCreditor3Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountCreditor3Name> for ::std::string::String {
    fn from(value: ObCashAccountCreditor3Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountCreditor3Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountCreditor3Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountCreditor3Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountCreditor3Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountCreditor3Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The secondary account ID that the account servicing institution assigns.
///
/// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///  "type": "string",
///  "maxLength": 34,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountCreditor3SecondaryIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountCreditor3SecondaryIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountCreditor3SecondaryIdentification> for ::std::string::String {
    fn from(value: ObCashAccountCreditor3SecondaryIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountCreditor3SecondaryIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 34usize {
            return Err("longer than 34 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountCreditor3SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObCashAccountCreditor3SecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObCashAccountCreditor3SecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountCreditor3SecondaryIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The details to identify the account from which the payment consent can be approved.
///
/// If provided in the consent, the [PSU](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will only be able to approve the payment consent from an account which matches the provided account identifier.
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details to identify the account from which the payment consent can be approved.\n\nIf provided in the consent, the [PSU](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will only be able to approve the payment consent from an account which matches the provided account identifier.\n",
///  "type": "object",
///  "required": [
///    "Identification",
///    "SchemeName"
///  ],
///  "properties": {
///    "Identification": {
///      "description": "The identifier assigned to the account, which is known by the account owner.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::warning\nThe name value is not validated against the actual owner name of the account.\n:::",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBExternalAccountIdentification4Code"
///    },
///    "SecondaryIdentification": {
///      "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///      "type": "string",
///      "maxLength": 34,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashAccountDebtor4 {
    ///The identifier assigned to the account, which is known by the account owner.
    #[serde(rename = "Identification")]
    pub identification: ObCashAccountDebtor4Identification,
    /// The name or names of the account owner(s) represented at an account level.
    ///
    /// The account name is not the product name or the nickname of the account.
    ///
    /// :::warning
    /// The name value is not validated against the actual owner name of the account.
    /// :::
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObCashAccountDebtor4Name>,
    #[serde(rename = "SchemeName")]
    pub scheme_name: ObExternalAccountIdentification4Code,
    /// The secondary account ID that the account servicing institution assigns.
    ///
    /// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
    #[serde(
        rename = "SecondaryIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub secondary_identification:
        ::std::option::Option<ObCashAccountDebtor4SecondaryIdentification>,
}
///The identifier assigned to the account, which is known by the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The identifier assigned to the account, which is known by the account owner.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtor4Identification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtor4Identification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtor4Identification> for ::std::string::String {
    fn from(value: ObCashAccountDebtor4Identification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtor4Identification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtor4Identification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountDebtor4Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountDebtor4Identification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtor4Identification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The name or names of the account owner(s) represented at an account level.
///
/// The account name is not the product name or the nickname of the account.
///
/// :::warning
/// The name value is not validated against the actual owner name of the account.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::warning\nThe name value is not validated against the actual owner name of the account.\n:::",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtor4Name(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtor4Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtor4Name> for ::std::string::String {
    fn from(value: ObCashAccountDebtor4Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtor4Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtor4Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountDebtor4Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountDebtor4Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtor4Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The secondary account ID that the account servicing institution assigns.
///
/// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///  "type": "string",
///  "maxLength": 34,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtor4SecondaryIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtor4SecondaryIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtor4SecondaryIdentification> for ::std::string::String {
    fn from(value: ObCashAccountDebtor4SecondaryIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtor4SecondaryIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 34usize {
            return Err("longer than 34 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtor4SecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObCashAccountDebtor4SecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObCashAccountDebtor4SecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtor4SecondaryIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The details to identify the account which was used to approve the payment consent.
///
/// This information can be used as a refund address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details to identify the account which was used to approve the payment consent.\n\nThis information can be used as a refund address.",
///  "type": "object",
///  "required": [
///    "Identification",
///    "SchemeName"
///  ],
///  "properties": {
///    "Identification": {
///      "description": "The identifier assigned to the account, which is known by the account owner.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::warning[Name validation]\nThis field will only return the actual owner(s) name if `DebtorAccount` was not defined in the consent.\n\nIf it was defined in the consent, the same value from the consent will be returned.\n:::",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SchemeName": {
///      "$ref": "#/components/schemas/OBExternalAccountIdentification4Code"
///    },
///    "SecondaryIdentification": {
///      "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///      "type": "string",
///      "maxLength": 34,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashAccountDebtorResponse {
    ///The identifier assigned to the account, which is known by the account owner.
    #[serde(rename = "Identification")]
    pub identification: ObCashAccountDebtorResponseIdentification,
    /// The name or names of the account owner(s) represented at an account level.
    ///
    /// The account name is not the product name or the nickname of the account.
    ///
    /// :::warning[Name validation]
    /// This field will only return the actual owner(s) name if `DebtorAccount` was not defined in the consent.
    ///
    /// If it was defined in the consent, the same value from the consent will be returned.
    /// :::
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObCashAccountDebtorResponseName>,
    #[serde(rename = "SchemeName")]
    pub scheme_name: ObExternalAccountIdentification4Code,
    /// The secondary account ID that the account servicing institution assigns.
    ///
    /// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
    #[serde(
        rename = "SecondaryIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub secondary_identification:
        ::std::option::Option<ObCashAccountDebtorResponseSecondaryIdentification>,
}
///The identifier assigned to the account, which is known by the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The identifier assigned to the account, which is known by the account owner.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtorResponseIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtorResponseIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtorResponseIdentification> for ::std::string::String {
    fn from(value: ObCashAccountDebtorResponseIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtorResponseIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtorResponseIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountDebtorResponseIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountDebtorResponseIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtorResponseIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The name or names of the account owner(s) represented at an account level.
///
/// The account name is not the product name or the nickname of the account.
///
/// :::warning[Name validation]
/// This field will only return the actual owner(s) name if `DebtorAccount` was not defined in the consent.
///
/// If it was defined in the consent, the same value from the consent will be returned.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name or names of the account owner(s) represented at an account level.\n\nThe account name is not the product name or the nickname of the account.\n\n:::warning[Name validation]\nThis field will only return the actual owner(s) name if `DebtorAccount` was not defined in the consent.\n\nIf it was defined in the consent, the same value from the consent will be returned.\n:::",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtorResponseName(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtorResponseName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtorResponseName> for ::std::string::String {
    fn from(value: ObCashAccountDebtorResponseName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtorResponseName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtorResponseName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashAccountDebtorResponseName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashAccountDebtorResponseName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtorResponseName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The secondary account ID that the account servicing institution assigns.
///
/// Building societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secondary account ID that the account servicing institution assigns.\n\nBuilding societies can use this ID to identify accounts with a roll number in addition to a sort code and account number combination.",
///  "type": "string",
///  "maxLength": 34,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCashAccountDebtorResponseSecondaryIdentification(::std::string::String);
impl ::std::ops::Deref for ObCashAccountDebtorResponseSecondaryIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCashAccountDebtorResponseSecondaryIdentification>
    for ::std::string::String
{
    fn from(value: ObCashAccountDebtorResponseSecondaryIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCashAccountDebtorResponseSecondaryIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 34usize {
            return Err("longer than 34 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCashAccountDebtorResponseSecondaryIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObCashAccountDebtorResponseSecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObCashAccountDebtorResponseSecondaryIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCashAccountDebtorResponseSecondaryIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///A list of elements to define the balance details.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of elements to define the balance details.",
///  "type": "object",
///  "required": [
///    "AccountId",
///    "Amount",
///    "CreditDebitIndicator",
///    "DateTime",
///    "Type"
///  ],
///  "properties": {
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
///    },
///    "CreditDebitIndicator": {
///      "description": "Indicates whether the balance is a credit or a debit balance.\n\n:::note\nA zero balance is considered a credit balance.\n:::",
///      "type": "string",
///      "enum": [
///        "Credit",
///        "Debit"
///      ]
///    },
///    "CreditLine": {
///      "description": "A list of elements to provide details on the credit line.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBCreditLine1"
///      }
///    },
///    "DateTime": {
///      "description": "The date and time for the balance.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Type": {
///      "$ref": "#/components/schemas/OBBalanceType1Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCashBalance1 {
    #[serde(rename = "AccountId")]
    pub account_id: AccountId,
    #[serde(rename = "Amount")]
    pub amount: ObActiveOrHistoricCurrencyAndAmount,
    /// Indicates whether the balance is a credit or a debit balance.
    ///
    /// :::note
    /// A zero balance is considered a credit balance.
    /// :::
    #[serde(rename = "CreditDebitIndicator")]
    pub credit_debit_indicator: ObCashBalance1CreditDebitIndicator,
    ///A list of elements to provide details on the credit line.
    #[serde(
        rename = "CreditLine",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub credit_line: ::std::vec::Vec<ObCreditLine1>,
    /// The date and time for the balance.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "DateTime")]
    pub date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Type")]
    pub type_: ObBalanceType1Code,
}
/// Indicates whether the balance is a credit or a debit balance.
///
/// :::note
/// A zero balance is considered a credit balance.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the balance is a credit or a debit balance.\n\n:::note\nA zero balance is considered a credit balance.\n:::",
///  "type": "string",
///  "enum": [
///    "Credit",
///    "Debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObCashBalance1CreditDebitIndicator {
    Credit,
    Debit,
}
impl ::std::fmt::Display for ObCashBalance1CreditDebitIndicator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("Credit"),
            Self::Debit => f.write_str("Debit"),
        }
    }
}
impl ::std::str::FromStr for ObCashBalance1CreditDebitIndicator {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Credit" => Ok(Self::Credit),
            "Debit" => Ok(Self::Debit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObCashBalance1CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCashBalance1CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCashBalance1CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The party or parties bear the charges associated with the processing of the payment transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The party or parties bear the charges associated with the processing of the payment transaction.",
///  "type": "string",
///  "enum": [
///    "BorneByDebtor",
///    "FollowingServiceLevel"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObChargeBearerType1Code {
    BorneByDebtor,
    FollowingServiceLevel,
}
impl ::std::fmt::Display for ObChargeBearerType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::BorneByDebtor => f.write_str("BorneByDebtor"),
            Self::FollowingServiceLevel => f.write_str("FollowingServiceLevel"),
        }
    }
}
impl ::std::str::FromStr for ObChargeBearerType1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "BorneByDebtor" => Ok(Self::BorneByDebtor),
            "FollowingServiceLevel" => Ok(Self::FollowingServiceLevel),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObChargeBearerType1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObChargeBearerType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObChargeBearerType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Set of elements used to provide details on the credit line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Set of elements used to provide details on the credit line.",
///  "type": "object",
///  "required": [
///    "Included"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
///    },
///    "Included": {
///      "description": "Indicates whether the credit line is included in the balance of the account.\n\n:::note\nIf set to `false`, credit line is not included in the account balance.\n:::",
///      "type": "boolean"
///    },
///    "Type": {
///      "$ref": "#/components/schemas/OBExternalLimitType1Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCreditLine1 {
    #[serde(
        rename = "Amount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub amount: ::std::option::Option<ObActiveOrHistoricCurrencyAndAmount>,
    /// Indicates whether the credit line is included in the balance of the account.
    ///
    /// :::note
    /// If set to `false`, credit line is not included in the account balance.
    /// :::
    #[serde(rename = "Included")]
    pub included: bool,
    #[serde(
        rename = "Type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<ObExternalLimitType1Code>,
}
///A list of elements to provide details on the currency exchange.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of elements to provide details on the currency exchange.",
///  "type": "object",
///  "required": [
///    "ExchangeRate",
///    "SourceCurrency"
///  ],
///  "properties": {
///    "ExchangeRate": {
///      "description": "The exchange rate used to convert an amount of money from one currency into another.\n\nThis reflects the price that one currency was bought at with another currency.\n\n:::note\n`ExchangeRate` expresses the ratio between `UnitCurrency` and `QuotedCurrency`:\n**`ExchangeRate` = `UnitCurrency`/`QuotedCurrency`**.\n:::",
///      "type": "string"
///    },
///    "InstructedAmount": {
///      "description": "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "SourceCurrency": {
///      "description": "The currency that is exchanged from.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "TargetCurrency": {
///      "description": "The currency that is exchanged to.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "UnitCurrency": {
///      "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCurrencyExchange5 {
    /// The exchange rate used to convert an amount of money from one currency into another.
    ///
    /// This reflects the price that one currency was bought at with another currency.
    ///
    /// :::note
    /// `ExchangeRate` expresses the ratio between `UnitCurrency` and `QuotedCurrency`:
    /// **`ExchangeRate` = `UnitCurrency`/`QuotedCurrency`**.
    /// :::
    #[serde(rename = "ExchangeRate")]
    pub exchange_rate: ::std::string::String,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObCurrencyExchange5InstructedAmount>,
    ///The currency that is exchanged from.
    #[serde(rename = "SourceCurrency")]
    pub source_currency: ObCurrencyExchange5SourceCurrency,
    ///The currency that is exchanged to.
    #[serde(
        rename = "TargetCurrency",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub target_currency: ::std::option::Option<ObCurrencyExchange5TargetCurrency>,
    /// The currency that the exchange rate is expressed in.
    /// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
    #[serde(
        rename = "UnitCurrency",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub unit_currency: ::std::option::Option<ObCurrencyExchange5UnitCurrency>,
}
///Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObCurrencyExchange5InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: Currency,
}
///The currency that is exchanged from.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that is exchanged from.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCurrencyExchange5SourceCurrency(::std::string::String);
impl ::std::ops::Deref for ObCurrencyExchange5SourceCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCurrencyExchange5SourceCurrency> for ::std::string::String {
    fn from(value: ObCurrencyExchange5SourceCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCurrencyExchange5SourceCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCurrencyExchange5SourceCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCurrencyExchange5SourceCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCurrencyExchange5SourceCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCurrencyExchange5SourceCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The currency that is exchanged to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that is exchanged to.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCurrencyExchange5TargetCurrency(::std::string::String);
impl ::std::ops::Deref for ObCurrencyExchange5TargetCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCurrencyExchange5TargetCurrency> for ::std::string::String {
    fn from(value: ObCurrencyExchange5TargetCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCurrencyExchange5TargetCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCurrencyExchange5TargetCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCurrencyExchange5TargetCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCurrencyExchange5TargetCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCurrencyExchange5TargetCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The currency that the exchange rate is expressed in.
/// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObCurrencyExchange5UnitCurrency(::std::string::String);
impl ::std::ops::Deref for ObCurrencyExchange5UnitCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObCurrencyExchange5UnitCurrency> for ::std::string::String {
    fn from(value: ObCurrencyExchange5UnitCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObCurrencyExchange5UnitCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObCurrencyExchange5UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObCurrencyExchange5UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObCurrencyExchange5UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObCurrencyExchange5UnitCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The account that a cash entry is made to or from.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The account that a cash entry is made to or from.",
///  "type": "object",
///  "required": [
///    "AccountId",
///    "MandateIdentification",
///    "Name"
///  ],
///  "properties": {
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "DirectDebitId": {
///      "description": "The unique and immutable ID to identify the direct debit resource.\nThis ID has no meaning to the account owner.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "DirectDebitStatusCode": {
///      "$ref": "#/components/schemas/OBExternalDirectDebitStatus1Code"
///    },
///    "MandateIdentification": {
///      "description": "The direct debit reference.\n\n- For AUDDIS (Automated Direct Debit Instruction Service), users provide core reference.\n- For non AUDDIS, users provide core reference if possible, or last used reference.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Name": {
///      "description": "The name of service user.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "PreviousPaymentAmount": {
///      "$ref": "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDirectDebit1 {
    #[serde(rename = "AccountId")]
    pub account_id: AccountId,
    /// The unique and immutable ID to identify the direct debit resource.
    /// This ID has no meaning to the account owner.
    #[serde(
        rename = "DirectDebitId",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub direct_debit_id: ::std::option::Option<ObDirectDebit1DirectDebitId>,
    #[serde(
        rename = "DirectDebitStatusCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub direct_debit_status_code: ::std::option::Option<ObExternalDirectDebitStatus1Code>,
    /// The direct debit reference.
    ///
    /// - For AUDDIS (Automated Direct Debit Instruction Service), users provide core reference.
    /// - For non AUDDIS, users provide core reference if possible, or last used reference.
    #[serde(rename = "MandateIdentification")]
    pub mandate_identification: ObDirectDebit1MandateIdentification,
    ///The name of service user.
    #[serde(rename = "Name")]
    pub name: ObDirectDebit1Name,
    #[serde(
        rename = "PreviousPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub previous_payment_amount: ::std::option::Option<ObActiveOrHistoricCurrencyAndAmount>,
}
/// The unique and immutable ID to identify the direct debit resource.
/// This ID has no meaning to the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID to identify the direct debit resource.\nThis ID has no meaning to the account owner.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDirectDebit1DirectDebitId(::std::string::String);
impl ::std::ops::Deref for ObDirectDebit1DirectDebitId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDirectDebit1DirectDebitId> for ::std::string::String {
    fn from(value: ObDirectDebit1DirectDebitId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDirectDebit1DirectDebitId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDirectDebit1DirectDebitId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDirectDebit1DirectDebitId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDirectDebit1DirectDebitId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDirectDebit1DirectDebitId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The direct debit reference.
///
/// - For AUDDIS (Automated Direct Debit Instruction Service), users provide core reference.
/// - For non AUDDIS, users provide core reference if possible, or last used reference.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The direct debit reference.\n\n- For AUDDIS (Automated Direct Debit Instruction Service), users provide core reference.\n- For non AUDDIS, users provide core reference if possible, or last used reference.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDirectDebit1MandateIdentification(::std::string::String);
impl ::std::ops::Deref for ObDirectDebit1MandateIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDirectDebit1MandateIdentification> for ::std::string::String {
    fn from(value: ObDirectDebit1MandateIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDirectDebit1MandateIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDirectDebit1MandateIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDirectDebit1MandateIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDirectDebit1MandateIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDirectDebit1MandateIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of service user.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of service user.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDirectDebit1Name(::std::string::String);
impl ::std::ops::Deref for ObDirectDebit1Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDirectDebit1Name> for ::std::string::String {
    fn from(value: ObDirectDebit1Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDirectDebit1Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDirectDebit1Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDirectDebit1Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDirectDebit1Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDirectDebit1Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticInitiationBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "EndToEndIdentification",
///        "InstructedAmount",
///        "InstructionIdentification"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomestic2 {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(rename = "EndToEndIdentification")]
    pub end_to_end_identification: ObDomestic2EndToEndIdentification,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObDomestic2InstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObDomestic2InstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    #[serde(
        rename = "SupplementaryData",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub supplementary_data: ::std::option::Option<ObSupplementaryData1>,
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomestic2EndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomestic2EndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomestic2EndToEndIdentification> for ::std::string::String {
    fn from(value: ObDomestic2EndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomestic2EndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomestic2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomestic2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomestic2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomestic2EndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomestic2InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomestic2InstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomestic2InstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomestic2InstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomestic2InstructedAmountCurrency> for ::std::string::String {
    fn from(value: ObDomestic2InstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomestic2InstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomestic2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomestic2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomestic2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomestic2InstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomestic2InstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomestic2InstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomestic2InstructionIdentification> for ::std::string::String {
    fn from(value: ObDomestic2InstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomestic2InstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomestic2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomestic2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomestic2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomestic2InstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.",
///  "type": "object",
///  "properties": {
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "CreditorPostalAddress": {
///      "$ref": "#/components/schemas/OBPostalAddress6"
///    },
///    "EndToEndIdentification": {
///      "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "InstructedAmount": {
///      "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "InstructionIdentification": {
///      "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "RemittanceInformation": {
///      "$ref": "#/components/schemas/OBRemittanceInformation1"
///    },
///    "SupplementaryData": {
///      "$ref": "#/components/schemas/OBSupplementaryData1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticInitiationBase {
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObDomesticInitiationBaseEndToEndIdentification>,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObDomesticInitiationBaseInstructedAmount>,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(
        rename = "InstructionIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instruction_identification:
        ::std::option::Option<ObDomesticInitiationBaseInstructionIdentification>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    #[serde(
        rename = "SupplementaryData",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub supplementary_data: ::std::option::Option<ObSupplementaryData1>,
}
impl ::std::default::Default for ObDomesticInitiationBase {
    fn default() -> Self {
        Self {
            creditor_account: Default::default(),
            creditor_postal_address: Default::default(),
            end_to_end_identification: Default::default(),
            instructed_amount: Default::default(),
            instruction_identification: Default::default(),
            remittance_information: Default::default(),
            supplementary_data: Default::default(),
        }
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationBaseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationBaseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationBaseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationBaseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationBaseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationBaseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticInitiationBaseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticInitiationBaseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationBaseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationBaseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationBaseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationBaseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationBaseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationBaseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationBaseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationBaseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationBaseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationBaseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationBaseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationBaseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationBaseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationBaseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single domestic payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticInitiationBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "DebtorAccount",
///        "EndToEndIdentification",
///        "InstructedAmount",
///        "InstructionIdentification"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticInitiationResponse {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(rename = "EndToEndIdentification")]
    pub end_to_end_identification: ObDomesticInitiationResponseEndToEndIdentification,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObDomesticInitiationResponseInstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObDomesticInitiationResponseInstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    #[serde(
        rename = "SupplementaryData",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub supplementary_data: ::std::option::Option<ObSupplementaryData1>,
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationResponseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationResponseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationResponseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationResponseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationResponseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationResponseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationResponseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticInitiationResponseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticInitiationResponseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationResponseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationResponseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationResponseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationResponseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationResponseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationResponseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationResponseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticInitiationResponseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticInitiationResponseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticInitiationResponseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticInitiationResponseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticInitiationResponseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticInitiationResponseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticInitiationResponseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticScheduledBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "InstructedAmount",
///        "InstructionIdentification",
///        "RequestedExecutionDateTime"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduled2 {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObDomesticScheduled2EndToEndIdentification>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObDomesticScheduled2InstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObDomesticScheduled2InstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    ///
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "RequestedExecutionDateTime")]
    pub requested_execution_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduled2EndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduled2EndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduled2EndToEndIdentification> for ::std::string::String {
    fn from(value: ObDomesticScheduled2EndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduled2EndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduled2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduled2EndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticScheduled2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduled2EndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduled2InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticScheduled2InstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduled2InstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduled2InstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduled2InstructedAmountCurrency> for ::std::string::String {
    fn from(value: ObDomesticScheduled2InstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduled2InstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduled2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduled2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduled2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduled2InstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduled2InstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduled2InstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduled2InstructionIdentification> for ::std::string::String {
    fn from(value: ObDomesticScheduled2InstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduled2InstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduled2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduled2InstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduled2InstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduled2InstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.",
///  "type": "object",
///  "properties": {
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "CreditorPostalAddress": {
///      "$ref": "#/components/schemas/OBPostalAddress6"
///    },
///    "EndToEndIdentification": {
///      "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "InstructedAmount": {
///      "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "InstructionIdentification": {
///      "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "RemittanceInformation": {
///      "$ref": "#/components/schemas/OBRemittanceInformation1"
///    },
///    "RequestedExecutionDateTime": {
///      "description": "The date and time when the initiating party requests the clearing agent to process the payment.\n\nThis is the date the debtor's account is to be debited.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduledBase {
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObDomesticScheduledBaseEndToEndIdentification>,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObDomesticScheduledBaseInstructedAmount>,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(
        rename = "InstructionIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instruction_identification:
        ::std::option::Option<ObDomesticScheduledBaseInstructionIdentification>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    ///
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "RequestedExecutionDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for ObDomesticScheduledBase {
    fn default() -> Self {
        Self {
            creditor_account: Default::default(),
            creditor_postal_address: Default::default(),
            end_to_end_identification: Default::default(),
            instructed_amount: Default::default(),
            instruction_identification: Default::default(),
            remittance_information: Default::default(),
            requested_execution_date_time: Default::default(),
        }
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledBaseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledBaseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledBaseEndToEndIdentification> for ::std::string::String {
    fn from(value: ObDomesticScheduledBaseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledBaseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduledBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduledBaseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduledBaseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticScheduledBaseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledBaseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledBaseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledBaseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticScheduledBaseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledBaseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduledBaseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduledBaseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledBaseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledBaseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledBaseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticScheduledBaseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledBaseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduledBaseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticScheduledBaseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled domestic payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticScheduledBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "DebtorAccount",
///        "InstructedAmount",
///        "InstructionIdentification",
///        "RequestedExecutionDateTime"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduledInitiationResponse {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorPostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_postal_address: ::std::option::Option<ObPostalAddress6>,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObDomesticScheduledInitiationResponseEndToEndIdentification>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObDomesticScheduledInitiationResponseInstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObDomesticScheduledInitiationResponseInstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    ///
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "RequestedExecutionDateTime")]
    pub requested_execution_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledInitiationResponseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledInitiationResponseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledInitiationResponseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticScheduledInitiationResponseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledInitiationResponseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticScheduledInitiationResponseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticScheduledInitiationResponseEndToEndIdentification
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticScheduledInitiationResponseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticScheduledInitiationResponseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledInitiationResponseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledInitiationResponseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledInitiationResponseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticScheduledInitiationResponseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledInitiationResponseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObDomesticScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticScheduledInitiationResponseInstructedAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to an individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to an individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticScheduledInitiationResponseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObDomesticScheduledInitiationResponseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticScheduledInitiationResponseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObDomesticScheduledInitiationResponseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticScheduledInitiationResponseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObDomesticScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticScheduledInitiationResponseInstructionIdentification
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticStandingOrderBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "FirstPaymentAmount",
///        "FirstPaymentDateTime",
///        "Frequency"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrder2 {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    #[serde(
        rename = "FinalPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_amount: ::std::option::Option<ObDomesticStandingOrder2FinalPaymentAmount>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(rename = "FirstPaymentAmount")]
    pub first_payment_amount: ObDomesticStandingOrder2FirstPaymentAmount,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "FirstPaymentDateTime")]
    pub first_payment_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "Frequency")]
    pub frequency: ObDomesticStandingOrder2Frequency,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments: ::std::option::Option<ObDomesticStandingOrder2NumberOfPayments>,
    #[serde(
        rename = "RecurringPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub recurring_payment_amount:
        ::std::option::Option<ObDomesticStandingOrder2RecurringPaymentAmount>,
    /// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObDomesticStandingOrder2Reference>,
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so this field is ignored.
/// :::
///
/// The amount of the final standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe amount of the final standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrder2FinalPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrder2FinalPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2FinalPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2FinalPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2FinalPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrder2FinalPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2FinalPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2FinalPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrder2FinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrder2FinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2FinalPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the first standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the first standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrder2FirstPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrder2FirstPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2FirstPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2FirstPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2FirstPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrder2FirstPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2FirstPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2FirstPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrder2FirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrder2FirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2FirstPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2Frequency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2Frequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2Frequency> for ::std::string::String {
    fn from(value: ObDomesticStandingOrder2Frequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2Frequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomesticStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2Frequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2NumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2NumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2NumberOfPayments> for ::std::string::String {
    fn from(value: ObDomesticStandingOrder2NumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2NumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2NumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomesticStandingOrder2NumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticStandingOrder2NumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2NumberOfPayments {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrder2RecurringPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrder2RecurringPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2RecurringPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2RecurringPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2RecurringPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrder2RecurringPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2RecurringPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2RecurringPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrder2RecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrder2RecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2RecurringPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrder2Reference(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrder2Reference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrder2Reference> for ::std::string::String {
    fn from(value: ObDomesticStandingOrder2Reference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrder2Reference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomesticStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrder2Reference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.",
///  "type": "object",
///  "properties": {
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "FinalPaymentAmount": {
///      "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe amount of the final standing order.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "FinalPaymentDateTime": {
///      "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe date and time when the final payment for a standing order schedule is made.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "FirstPaymentAmount": {
///      "description": "The amount of the first standing order.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "FirstPaymentDateTime": {
///      "description": "The date and time when the first payment for a standing order schedule is made.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.\n\n:::caution\nThe day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Frequency": {
///      "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "NumberOfPayments": {
///      "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "RecurringPaymentAmount": {
///      "description": "The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "Reference": {
///      "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderBase {
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "FinalPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_amount: ::std::option::Option<ObDomesticStandingOrderBaseFinalPaymentAmount>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(
        rename = "FirstPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub first_payment_amount: ::std::option::Option<ObDomesticStandingOrderBaseFirstPaymentAmount>,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(
        rename = "FirstPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub first_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(
        rename = "Frequency",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub frequency: ::std::option::Option<ObDomesticStandingOrderBaseFrequency>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments: ::std::option::Option<ObDomesticStandingOrderBaseNumberOfPayments>,
    #[serde(
        rename = "RecurringPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub recurring_payment_amount:
        ::std::option::Option<ObDomesticStandingOrderBaseRecurringPaymentAmount>,
    /// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObDomesticStandingOrderBaseReference>,
}
impl ::std::default::Default for ObDomesticStandingOrderBase {
    fn default() -> Self {
        Self {
            creditor_account: Default::default(),
            final_payment_amount: Default::default(),
            final_payment_date_time: Default::default(),
            first_payment_amount: Default::default(),
            first_payment_date_time: Default::default(),
            frequency: Default::default(),
            number_of_payments: Default::default(),
            recurring_payment_amount: Default::default(),
            reference: Default::default(),
        }
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so this field is ignored.
/// :::
///
/// The amount of the final standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe amount of the final standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderBaseFinalPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderBaseFinalPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseFinalPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseFinalPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderBaseFinalPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseFinalPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the first standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the first standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderBaseFirstPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderBaseFirstPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseFirstPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseFirstPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderBaseFirstPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseFirstPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseFrequency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseFrequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseFrequency> for ::std::string::String {
    fn from(value: ObDomesticStandingOrderBaseFrequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseFrequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomesticStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseFrequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseNumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseNumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseNumberOfPayments> for ::std::string::String {
    fn from(value: ObDomesticStandingOrderBaseNumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseNumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseNumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderBaseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderBaseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseNumberOfPayments {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderBaseRecurringPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseRecurringPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderBaseReference(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderBaseReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderBaseReference> for ::std::string::String {
    fn from(value: ObDomesticStandingOrderBaseReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderBaseReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObDomesticStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObDomesticStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderBaseReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a domestic standing order.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBDomesticStandingOrderBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "DebtorAccount",
///        "FirstPaymentAmount",
///        "FirstPaymentDateTime",
///        "Frequency"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderInitiationResponse {
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    #[serde(
        rename = "FinalPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_amount:
        ::std::option::Option<ObDomesticStandingOrderInitiationResponseFinalPaymentAmount>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(rename = "FirstPaymentAmount")]
    pub first_payment_amount: ObDomesticStandingOrderInitiationResponseFirstPaymentAmount,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "FirstPaymentDateTime")]
    pub first_payment_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "Frequency")]
    pub frequency: ObDomesticStandingOrderInitiationResponseFrequency,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments:
        ::std::option::Option<ObDomesticStandingOrderInitiationResponseNumberOfPayments>,
    #[serde(
        rename = "RecurringPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub recurring_payment_amount:
        ::std::option::Option<ObDomesticStandingOrderInitiationResponseRecurringPaymentAmount>,
    /// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObDomesticStandingOrderInitiationResponseReference>,
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so this field is ignored.
/// :::
///
/// The amount of the final standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe amount of the final standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderInitiationResponseFinalPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency(
    ::std::string::String,
);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticStandingOrderInitiationResponseFinalPaymentAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the first standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the first standing order.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderInitiationResponseFirstPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency(
    ::std::string::String,
);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticStandingOrderInitiationResponseFirstPaymentAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseFrequency(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseFrequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseFrequency>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderInitiationResponseFrequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderInitiationResponseFrequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderInitiationResponseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFrequency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseFrequency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderInitiationResponseFrequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseNumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseNumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseNumberOfPayments>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderInitiationResponseNumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderInitiationResponseNumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderInitiationResponseNumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderInitiationResponseNumberOfPayments {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the recurring standing order. If provided, must be equal to `FirstPaymentAmount`.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObDomesticStandingOrderInitiationResponseRecurringPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency(
    ::std::string::String,
);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency>
    for ::std::string::String
{
    fn from(
        value: ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency,
    ) -> Self {
        value.0
    }
}
impl ::std::str::FromStr
    for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency
{
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObDomesticStandingOrderInitiationResponseRecurringPaymentAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObDomesticStandingOrderInitiationResponseReference(::std::string::String);
impl ::std::ops::Deref for ObDomesticStandingOrderInitiationResponseReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObDomesticStandingOrderInitiationResponseReference>
    for ::std::string::String
{
    fn from(value: ObDomesticStandingOrderInitiationResponseReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObDomesticStandingOrderInitiationResponseReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObDomesticStandingOrderInitiationResponseReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObDomesticStandingOrderInitiationResponseReference
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObDomesticStandingOrderInitiationResponseReference
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObDomesticStandingOrderInitiationResponseReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The status of a transaction entry on the books of the account servicer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of a transaction entry on the books of the account servicer.",
///  "type": "string",
///  "enum": [
///    "Booked",
///    "Pending"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObEntryStatus1Code {
    Booked,
    Pending,
}
impl ::std::fmt::Display for ObEntryStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Booked => f.write_str("Booked"),
            Self::Pending => f.write_str("Pending"),
        }
    }
}
impl ::std::str::FromStr for ObEntryStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Booked" => Ok(Self::Booked),
            "Pending" => Ok(Self::Pending),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObEntryStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObEntryStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObEntryStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ObError1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ErrorCode",
///    "Message"
///  ],
///  "properties": {
///    "ErrorCode": {
///      "description": "The error code in low level, for example, `UK.OBIE.Field.Missing`.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Message": {
///      "description": "The description of the error that occurred.\nFor example, `A mandatory field isn't supplied`, `RequestedExecutionDateTime must be in future`, and `OBIE doesn't standardise this field`.",
///      "type": "string",
///      "maxLength": 500,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObError1 {
    ///The error code in low level, for example, `UK.OBIE.Field.Missing`.
    #[serde(rename = "ErrorCode")]
    pub error_code: ObError1ErrorCode,
    /// The description of the error that occurred.
    /// For example, `A mandatory field isn't supplied`, `RequestedExecutionDateTime must be in future`, and `OBIE doesn't standardise this field`.
    #[serde(rename = "Message")]
    pub message: ObError1Message,
}
///The error code in low level, for example, `UK.OBIE.Field.Missing`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The error code in low level, for example, `UK.OBIE.Field.Missing`.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObError1ErrorCode(::std::string::String);
impl ::std::ops::Deref for ObError1ErrorCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObError1ErrorCode> for ::std::string::String {
    fn from(value: ObError1ErrorCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObError1ErrorCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObError1ErrorCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObError1ErrorCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObError1ErrorCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObError1ErrorCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The description of the error that occurred.
/// For example, `A mandatory field isn't supplied`, `RequestedExecutionDateTime must be in future`, and `OBIE doesn't standardise this field`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The description of the error that occurred.\nFor example, `A mandatory field isn't supplied`, `RequestedExecutionDateTime must be in future`, and `OBIE doesn't standardise this field`.",
///  "type": "string",
///  "maxLength": 500,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObError1Message(::std::string::String);
impl ::std::ops::Deref for ObError1Message {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObError1Message> for ::std::string::String {
    fn from(value: ObError1Message) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObError1Message {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObError1Message {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObError1Message {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObError1Message {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObError1Message {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The detailed information about the error to help troubleshooting.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The detailed information about the error to help troubleshooting.",
///  "type": "object",
///  "required": [
///    "Code",
///    "Errors",
///    "Message"
///  ],
///  "properties": {
///    "Code": {
///      "description": "The error code in high level that helps categorize the error.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Errors": {
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBError1"
///      },
///      "minItems": 1
///    },
///    "Id": {
///      "description": "The ID of the error. You can share this ID with Revolut support for troubleshooting.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Message": {
///      "description": "The error message.\nFor example, `There is something wrong with the request parameters provided`.",
///      "type": "string",
///      "maxLength": 500,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObErrorResponse1 {
    ///The error code in high level that helps categorize the error.
    #[serde(rename = "Code")]
    pub code: ObErrorResponse1Code,
    #[serde(rename = "Errors")]
    pub errors: ::std::vec::Vec<ObError1>,
    ///The ID of the error. You can share this ID with Revolut support for troubleshooting.
    #[serde(
        rename = "Id",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub id: ::std::option::Option<ObErrorResponse1Id>,
    /// The error message.
    /// For example, `There is something wrong with the request parameters provided`.
    #[serde(rename = "Message")]
    pub message: ObErrorResponse1Message,
}
///The error code in high level that helps categorize the error.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The error code in high level that helps categorize the error.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObErrorResponse1Code(::std::string::String);
impl ::std::ops::Deref for ObErrorResponse1Code {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObErrorResponse1Code> for ::std::string::String {
    fn from(value: ObErrorResponse1Code) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObErrorResponse1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObErrorResponse1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObErrorResponse1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObErrorResponse1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObErrorResponse1Code {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The ID of the error. You can share this ID with Revolut support for troubleshooting.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the error. You can share this ID with Revolut support for troubleshooting.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObErrorResponse1Id(::std::string::String);
impl ::std::ops::Deref for ObErrorResponse1Id {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObErrorResponse1Id> for ::std::string::String {
    fn from(value: ObErrorResponse1Id) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObErrorResponse1Id {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObErrorResponse1Id {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObErrorResponse1Id {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObErrorResponse1Id {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObErrorResponse1Id {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The error message.
/// For example, `There is something wrong with the request parameters provided`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The error message.\nFor example, `There is something wrong with the request parameters provided`.",
///  "type": "string",
///  "maxLength": 500,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObErrorResponse1Message(::std::string::String);
impl ::std::ops::Deref for ObErrorResponse1Message {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObErrorResponse1Message> for ::std::string::String {
    fn from(value: ObErrorResponse1Message) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObErrorResponse1Message {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObErrorResponse1Message {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObErrorResponse1Message {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObErrorResponse1Message {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObErrorResponse1Message {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The details on the currency exchange rate and contract.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details on the currency exchange rate and contract.",
///  "type": "object",
///  "required": [
///    "RateType",
///    "UnitCurrency"
///  ],
///  "properties": {
///    "ContractIdentification": {
///      "description": "The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "ExchangeRate": {
///      "description": "The exchange rate used to convert an amount from one currency into another.\nThis reflects the price that one currency was bought at with another currency.\n",
///      "type": "number"
///    },
///    "RateType": {
///      "$ref": "#/components/schemas/OBExchangeRateType2Code"
///    },
///    "UnitCurrency": {
///      "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObExchangeRate1 {
    ///The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
    #[serde(
        rename = "ContractIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub contract_identification: ::std::option::Option<ObExchangeRate1ContractIdentification>,
    /// The exchange rate used to convert an amount from one currency into another.
    /// This reflects the price that one currency was bought at with another currency.
    ///
    #[serde(
        rename = "ExchangeRate",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate: ::std::option::Option<f64>,
    #[serde(rename = "RateType")]
    pub rate_type: ObExchangeRateType2Code,
    /// The currency that the exchange rate is expressed in.
    /// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
    #[serde(rename = "UnitCurrency")]
    pub unit_currency: ObExchangeRate1UnitCurrency,
}
///The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExchangeRate1ContractIdentification(::std::string::String);
impl ::std::ops::Deref for ObExchangeRate1ContractIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExchangeRate1ContractIdentification> for ::std::string::String {
    fn from(value: ObExchangeRate1ContractIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExchangeRate1ContractIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRate1ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRate1ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRate1ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExchangeRate1ContractIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The currency that the exchange rate is expressed in.
/// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExchangeRate1UnitCurrency(::std::string::String);
impl ::std::ops::Deref for ObExchangeRate1UnitCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExchangeRate1UnitCurrency> for ::std::string::String {
    fn from(value: ObExchangeRate1UnitCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExchangeRate1UnitCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRate1UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRate1UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRate1UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExchangeRate1UnitCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Further detailed information on the exchange rate that is used in the payment transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Further detailed information on the exchange rate that is used in the payment transaction.",
///  "type": "object",
///  "required": [
///    "ExchangeRate",
///    "RateType",
///    "UnitCurrency"
///  ],
///  "properties": {
///    "ContractIdentification": {
///      "description": "The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.",
///      "type": "string",
///      "maxLength": 256,
///      "minLength": 1
///    },
///    "ExchangeRate": {
///      "description": "The exchange rate used to convert an amount from one currency into another.\nThis reflects the price that one currency was bought at with another currency.",
///      "type": "string",
///      "pattern": "^[0-9]+\\.[0-9]+$"
///    },
///    "ExpirationDateTime": {
///      "description": "The date and time when the exchange rate agreement expires.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "RateType": {
///      "$ref": "#/components/schemas/OBExchangeRateType2Code"
///    },
///    "UnitCurrency": {
///      "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObExchangeRate2 {
    ///The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
    #[serde(
        rename = "ContractIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub contract_identification: ::std::option::Option<ObExchangeRate2ContractIdentification>,
    /// The exchange rate used to convert an amount from one currency into another.
    /// This reflects the price that one currency was bought at with another currency.
    #[serde(rename = "ExchangeRate")]
    pub exchange_rate: ObExchangeRate2ExchangeRate,
    /// The date and time when the exchange rate agreement expires.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "ExpirationDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub expiration_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(rename = "RateType")]
    pub rate_type: ObExchangeRateType2Code,
    /// The currency that the exchange rate is expressed in.
    /// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
    #[serde(rename = "UnitCurrency")]
    pub unit_currency: ObExchangeRate2UnitCurrency,
}
///The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference to the foreign exchange contract agreed between the initiating party/creditor and the debtor agent.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExchangeRate2ContractIdentification(::std::string::String);
impl ::std::ops::Deref for ObExchangeRate2ContractIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExchangeRate2ContractIdentification> for ::std::string::String {
    fn from(value: ObExchangeRate2ContractIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExchangeRate2ContractIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRate2ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRate2ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRate2ContractIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExchangeRate2ContractIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The exchange rate used to convert an amount from one currency into another.
/// This reflects the price that one currency was bought at with another currency.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The exchange rate used to convert an amount from one currency into another.\nThis reflects the price that one currency was bought at with another currency.",
///  "type": "string",
///  "pattern": "^[0-9]+\\.[0-9]+$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExchangeRate2ExchangeRate(::std::string::String);
impl ::std::ops::Deref for ObExchangeRate2ExchangeRate {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExchangeRate2ExchangeRate> for ::std::string::String {
    fn from(value: ObExchangeRate2ExchangeRate) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExchangeRate2ExchangeRate {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[0-9]+\\.[0-9]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[0-9]+\\.[0-9]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRate2ExchangeRate {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRate2ExchangeRate {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRate2ExchangeRate {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExchangeRate2ExchangeRate {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The currency that the exchange rate is expressed in.
/// For example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency that the exchange rate is expressed in.\nFor example, for 1 GBP = xxx EUR, the `UnitCurrency` value is GBP.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExchangeRate2UnitCurrency(::std::string::String);
impl ::std::ops::Deref for ObExchangeRate2UnitCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExchangeRate2UnitCurrency> for ::std::string::String {
    fn from(value: ObExchangeRate2UnitCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExchangeRate2UnitCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRate2UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRate2UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRate2UnitCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExchangeRate2UnitCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type used to complete the currency exchange.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type used to complete the currency exchange.",
///  "type": "string",
///  "enum": [
///    "Actual",
///    "Agreed",
///    "Indicative"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExchangeRateType2Code {
    Actual,
    Agreed,
    Indicative,
}
impl ::std::fmt::Display for ObExchangeRateType2Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Actual => f.write_str("Actual"),
            Self::Agreed => f.write_str("Agreed"),
            Self::Indicative => f.write_str("Indicative"),
        }
    }
}
impl ::std::str::FromStr for ObExchangeRateType2Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Actual" => Ok(Self::Actual),
            "Agreed" => Ok(Self::Agreed),
            "Indicative" => Ok(Self::Indicative),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExchangeRateType2Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExchangeRateType2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExchangeRateType2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The name of the identification scheme.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the identification scheme.",
///  "type": "string",
///  "enum": [
///    "UK.OBIE.IBAN",
///    "UK.OBIE.SortCodeAccountNumber",
///    "US.RoutingNumberAccountNumber",
///    "US.BranchCodeAccountNumber"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalAccountIdentification4Code {
    #[serde(rename = "UK.OBIE.IBAN")]
    UkObieIban,
    #[serde(rename = "UK.OBIE.SortCodeAccountNumber")]
    UkObieSortCodeAccountNumber,
    #[serde(rename = "US.RoutingNumberAccountNumber")]
    UsRoutingNumberAccountNumber,
    #[serde(rename = "US.BranchCodeAccountNumber")]
    UsBranchCodeAccountNumber,
}
impl ::std::fmt::Display for ObExternalAccountIdentification4Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkObieIban => f.write_str("UK.OBIE.IBAN"),
            Self::UkObieSortCodeAccountNumber => f.write_str("UK.OBIE.SortCodeAccountNumber"),
            Self::UsRoutingNumberAccountNumber => f.write_str("US.RoutingNumberAccountNumber"),
            Self::UsBranchCodeAccountNumber => f.write_str("US.BranchCodeAccountNumber"),
        }
    }
}
impl ::std::str::FromStr for ObExternalAccountIdentification4Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "UK.OBIE.IBAN" => Ok(Self::UkObieIban),
            "UK.OBIE.SortCodeAccountNumber" => Ok(Self::UkObieSortCodeAccountNumber),
            "US.RoutingNumberAccountNumber" => Ok(Self::UsRoutingNumberAccountNumber),
            "US.BranchCodeAccountNumber" => Ok(Self::UsBranchCodeAccountNumber),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalAccountIdentification4Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalAccountIdentification4Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalAccountIdentification4Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The sub-type of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The sub-type of the account.",
///  "type": "string",
///  "enum": [
///    "CurrentAccount",
///    "Savings",
///    "CreditCard"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalAccountSubType1Code {
    CurrentAccount,
    Savings,
    CreditCard,
}
impl ::std::fmt::Display for ObExternalAccountSubType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CurrentAccount => f.write_str("CurrentAccount"),
            Self::Savings => f.write_str("Savings"),
            Self::CreditCard => f.write_str("CreditCard"),
        }
    }
}
impl ::std::str::FromStr for ObExternalAccountSubType1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "CurrentAccount" => Ok(Self::CurrentAccount),
            "Savings" => Ok(Self::Savings),
            "CreditCard" => Ok(Self::CreditCard),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalAccountSubType1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalAccountSubType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalAccountSubType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The type of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the account.",
///  "type": "string",
///  "enum": [
///    "Business",
///    "Personal"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalAccountType1Code {
    Business,
    Personal,
}
impl ::std::fmt::Display for ObExternalAccountType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Business => f.write_str("Business"),
            Self::Personal => f.write_str("Personal"),
        }
    }
}
impl ::std::str::FromStr for ObExternalAccountType1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Business" => Ok(Self::Business),
            "Personal" => Ok(Self::Personal),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalAccountType1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalAccountType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalAccountType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the consent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the consent.",
///  "type": "string",
///  "enum": [
///    "Authorised",
///    "AwaitingAuthorisation",
///    "Consumed",
///    "Rejected"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalConsentStatus1Code {
    Authorised,
    AwaitingAuthorisation,
    Consumed,
    Rejected,
}
impl ::std::fmt::Display for ObExternalConsentStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Authorised => f.write_str("Authorised"),
            Self::AwaitingAuthorisation => f.write_str("AwaitingAuthorisation"),
            Self::Consumed => f.write_str("Consumed"),
            Self::Rejected => f.write_str("Rejected"),
        }
    }
}
impl ::std::str::FromStr for ObExternalConsentStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Authorised" => Ok(Self::Authorised),
            "AwaitingAuthorisation" => Ok(Self::AwaitingAuthorisation),
            "Consumed" => Ok(Self::Consumed),
            "Rejected" => Ok(Self::Rejected),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalConsentStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalConsentStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalConsentStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the consent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the consent.",
///  "type": "string",
///  "enum": [
///    "Authorised",
///    "AwaitingAuthorisation",
///    "AwaitingUpload",
///    "Consumed",
///    "Rejected"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalConsentStatus2Code {
    Authorised,
    AwaitingAuthorisation,
    AwaitingUpload,
    Consumed,
    Rejected,
}
impl ::std::fmt::Display for ObExternalConsentStatus2Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Authorised => f.write_str("Authorised"),
            Self::AwaitingAuthorisation => f.write_str("AwaitingAuthorisation"),
            Self::AwaitingUpload => f.write_str("AwaitingUpload"),
            Self::Consumed => f.write_str("Consumed"),
            Self::Rejected => f.write_str("Rejected"),
        }
    }
}
impl ::std::str::FromStr for ObExternalConsentStatus2Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Authorised" => Ok(Self::Authorised),
            "AwaitingAuthorisation" => Ok(Self::AwaitingAuthorisation),
            "AwaitingUpload" => Ok(Self::AwaitingUpload),
            "Consumed" => Ok(Self::Consumed),
            "Rejected" => Ok(Self::Rejected),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalConsentStatus2Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalConsentStatus2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalConsentStatus2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the direct debit.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the direct debit.",
///  "type": "string",
///  "enum": [
///    "Active",
///    "Inactive"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalDirectDebitStatus1Code {
    Active,
    Inactive,
}
impl ::std::fmt::Display for ObExternalDirectDebitStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Active => f.write_str("Active"),
            Self::Inactive => f.write_str("Inactive"),
        }
    }
}
impl ::std::str::FromStr for ObExternalDirectDebitStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Active" => Ok(Self::Active),
            "Inactive" => Ok(Self::Inactive),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalDirectDebitStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalDirectDebitStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalDirectDebitStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The payment file type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The payment file type.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ObExternalFileType1Code(pub ::std::string::String);
impl ::std::ops::Deref for ObExternalFileType1Code {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExternalFileType1Code> for ::std::string::String {
    fn from(value: ObExternalFileType1Code) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ObExternalFileType1Code {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ObExternalFileType1Code {
    type Err = ::std::convert::Infallible;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.to_string()))
    }
}
impl ::std::fmt::Display for ObExternalFileType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The name of the identification scheme, which is published in an external list.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the identification scheme, which is published in an external list.",
///  "type": "array",
///  "items": {
///    "type": "string"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ObExternalFinancialInstitutionIdentification4Code(
    pub ::std::vec::Vec<::std::string::String>,
);
impl ::std::ops::Deref for ObExternalFinancialInstitutionIdentification4Code {
    type Target = ::std::vec::Vec<::std::string::String>;
    fn deref(&self) -> &::std::vec::Vec<::std::string::String> {
        &self.0
    }
}
impl ::std::convert::From<ObExternalFinancialInstitutionIdentification4Code>
    for ::std::vec::Vec<::std::string::String>
{
    fn from(value: ObExternalFinancialInstitutionIdentification4Code) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<::std::string::String>>
    for ObExternalFinancialInstitutionIdentification4Code
{
    fn from(value: ::std::vec::Vec<::std::string::String>) -> Self {
        Self(value)
    }
}
///The limit type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The limit type.",
///  "type": "string",
///  "enum": [
///    "Available"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalLimitType1Code {
    Available,
}
impl ::std::fmt::Display for ObExternalLimitType1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Available => f.write_str("Available"),
        }
    }
}
impl ::std::str::FromStr for ObExternalLimitType1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Available" => Ok(Self::Available),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalLimitType1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalLimitType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalLimitType1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// User community specific instrument.
///
/// Use this element to specify a local instrument, local clearing option and/or further qualify the service or service level.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "User community specific instrument.\n\nUse this element to specify a local instrument, local clearing option and/or further qualify the service or service level.",
///  "type": "string",
///  "maxLength": 50,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObExternalLocalInstrument1Code(::std::string::String);
impl ::std::ops::Deref for ObExternalLocalInstrument1Code {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExternalLocalInstrument1Code> for ::std::string::String {
    fn from(value: ObExternalLocalInstrument1Code) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObExternalLocalInstrument1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 50usize {
            return Err("longer than 50 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalLocalInstrument1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalLocalInstrument1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalLocalInstrument1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObExternalLocalInstrument1Code {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The merchant category code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The merchant category code.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ObExternalMerchantCategoryCode(pub ::std::string::String);
impl ::std::ops::Deref for ObExternalMerchantCategoryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExternalMerchantCategoryCode> for ::std::string::String {
    fn from(value: ObExternalMerchantCategoryCode) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ObExternalMerchantCategoryCode {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ObExternalMerchantCategoryCode {
    type Err = ::std::convert::Infallible;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.to_string()))
    }
}
impl ::std::fmt::Display for ObExternalMerchantCategoryCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The merchant customer identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The merchant customer identification.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ObExternalMerchantCustomerIdentification(pub ::std::string::String);
impl ::std::ops::Deref for ObExternalMerchantCustomerIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObExternalMerchantCustomerIdentification> for ::std::string::String {
    fn from(value: ObExternalMerchantCustomerIdentification) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ObExternalMerchantCustomerIdentification {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ObExternalMerchantCustomerIdentification {
    type Err = ::std::convert::Infallible;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.to_string()))
    }
}
impl ::std::fmt::Display for ObExternalMerchantCustomerIdentification {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The payment context.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The payment context.",
///  "type": "string",
///  "enum": [
///    "BillPayment",
///    "EcommerceGoods",
///    "EcommerceServices",
///    "Other",
///    "PartyToParty"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalPaymentContext1Code {
    BillPayment,
    EcommerceGoods,
    EcommerceServices,
    Other,
    PartyToParty,
}
impl ::std::fmt::Display for ObExternalPaymentContext1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::BillPayment => f.write_str("BillPayment"),
            Self::EcommerceGoods => f.write_str("EcommerceGoods"),
            Self::EcommerceServices => f.write_str("EcommerceServices"),
            Self::Other => f.write_str("Other"),
            Self::PartyToParty => f.write_str("PartyToParty"),
        }
    }
}
impl ::std::str::FromStr for ObExternalPaymentContext1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "BillPayment" => Ok(Self::BillPayment),
            "EcommerceGoods" => Ok(Self::EcommerceGoods),
            "EcommerceServices" => Ok(Self::EcommerceServices),
            "Other" => Ok(Self::Other),
            "PartyToParty" => Ok(Self::PartyToParty),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalPaymentContext1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalPaymentContext1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalPaymentContext1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The type of data access to the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of data access to the account.",
///  "type": "string",
///  "enum": [
///    "ReadAccountsBasic",
///    "ReadAccountsDetail",
///    "ReadBalances",
///    "ReadBeneficiariesBasic",
///    "ReadBeneficiariesDetail",
///    "ReadDirectDebits",
///    "ReadOffers",
///    "ReadPAN",
///    "ReadParty",
///    "ReadPartyPSU",
///    "ReadProducts",
///    "ReadScheduledPaymentsBasic",
///    "ReadScheduledPaymentsDetail",
///    "ReadStandingOrdersBasic",
///    "ReadStandingOrdersDetail",
///    "ReadStatementsBasic",
///    "ReadStatementsDetail",
///    "ReadTransactionsBasic",
///    "ReadTransactionsCredits",
///    "ReadTransactionsDebits",
///    "ReadTransactionsDetail"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalPermissions1Code {
    ReadAccountsBasic,
    ReadAccountsDetail,
    ReadBalances,
    ReadBeneficiariesBasic,
    ReadBeneficiariesDetail,
    ReadDirectDebits,
    ReadOffers,
    #[serde(rename = "ReadPAN")]
    ReadPan,
    ReadParty,
    #[serde(rename = "ReadPartyPSU")]
    ReadPartyPsu,
    ReadProducts,
    ReadScheduledPaymentsBasic,
    ReadScheduledPaymentsDetail,
    ReadStandingOrdersBasic,
    ReadStandingOrdersDetail,
    ReadStatementsBasic,
    ReadStatementsDetail,
    ReadTransactionsBasic,
    ReadTransactionsCredits,
    ReadTransactionsDebits,
    ReadTransactionsDetail,
}
impl ::std::fmt::Display for ObExternalPermissions1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::ReadAccountsBasic => f.write_str("ReadAccountsBasic"),
            Self::ReadAccountsDetail => f.write_str("ReadAccountsDetail"),
            Self::ReadBalances => f.write_str("ReadBalances"),
            Self::ReadBeneficiariesBasic => f.write_str("ReadBeneficiariesBasic"),
            Self::ReadBeneficiariesDetail => f.write_str("ReadBeneficiariesDetail"),
            Self::ReadDirectDebits => f.write_str("ReadDirectDebits"),
            Self::ReadOffers => f.write_str("ReadOffers"),
            Self::ReadPan => f.write_str("ReadPAN"),
            Self::ReadParty => f.write_str("ReadParty"),
            Self::ReadPartyPsu => f.write_str("ReadPartyPSU"),
            Self::ReadProducts => f.write_str("ReadProducts"),
            Self::ReadScheduledPaymentsBasic => f.write_str("ReadScheduledPaymentsBasic"),
            Self::ReadScheduledPaymentsDetail => f.write_str("ReadScheduledPaymentsDetail"),
            Self::ReadStandingOrdersBasic => f.write_str("ReadStandingOrdersBasic"),
            Self::ReadStandingOrdersDetail => f.write_str("ReadStandingOrdersDetail"),
            Self::ReadStatementsBasic => f.write_str("ReadStatementsBasic"),
            Self::ReadStatementsDetail => f.write_str("ReadStatementsDetail"),
            Self::ReadTransactionsBasic => f.write_str("ReadTransactionsBasic"),
            Self::ReadTransactionsCredits => f.write_str("ReadTransactionsCredits"),
            Self::ReadTransactionsDebits => f.write_str("ReadTransactionsDebits"),
            Self::ReadTransactionsDetail => f.write_str("ReadTransactionsDetail"),
        }
    }
}
impl ::std::str::FromStr for ObExternalPermissions1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "ReadAccountsBasic" => Ok(Self::ReadAccountsBasic),
            "ReadAccountsDetail" => Ok(Self::ReadAccountsDetail),
            "ReadBalances" => Ok(Self::ReadBalances),
            "ReadBeneficiariesBasic" => Ok(Self::ReadBeneficiariesBasic),
            "ReadBeneficiariesDetail" => Ok(Self::ReadBeneficiariesDetail),
            "ReadDirectDebits" => Ok(Self::ReadDirectDebits),
            "ReadOffers" => Ok(Self::ReadOffers),
            "ReadPAN" => Ok(Self::ReadPan),
            "ReadParty" => Ok(Self::ReadParty),
            "ReadPartyPSU" => Ok(Self::ReadPartyPsu),
            "ReadProducts" => Ok(Self::ReadProducts),
            "ReadScheduledPaymentsBasic" => Ok(Self::ReadScheduledPaymentsBasic),
            "ReadScheduledPaymentsDetail" => Ok(Self::ReadScheduledPaymentsDetail),
            "ReadStandingOrdersBasic" => Ok(Self::ReadStandingOrdersBasic),
            "ReadStandingOrdersDetail" => Ok(Self::ReadStandingOrdersDetail),
            "ReadStatementsBasic" => Ok(Self::ReadStatementsBasic),
            "ReadStatementsDetail" => Ok(Self::ReadStatementsDetail),
            "ReadTransactionsBasic" => Ok(Self::ReadTransactionsBasic),
            "ReadTransactionsCredits" => Ok(Self::ReadTransactionsCredits),
            "ReadTransactionsDebits" => Ok(Self::ReadTransactionsDebits),
            "ReadTransactionsDetail" => Ok(Self::ReadTransactionsDetail),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalPermissions1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalPermissions1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalPermissions1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The Open Banking service request type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Open Banking service request type.",
///  "type": "string",
///  "enum": [
///    "Create"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalPermissions2Code {
    Create,
}
impl ::std::fmt::Display for ObExternalPermissions2Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Create => f.write_str("Create"),
        }
    }
}
impl ::std::str::FromStr for ObExternalPermissions2Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Create" => Ok(Self::Create),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalPermissions2Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalPermissions2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalPermissions2Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the account access consent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the account access consent.",
///  "type": "string",
///  "enum": [
///    "Authorised",
///    "AwaitingAuthorisation",
///    "Rejected",
///    "Revoked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalRequestStatus1Code {
    Authorised,
    AwaitingAuthorisation,
    Rejected,
    Revoked,
}
impl ::std::fmt::Display for ObExternalRequestStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Authorised => f.write_str("Authorised"),
            Self::AwaitingAuthorisation => f.write_str("AwaitingAuthorisation"),
            Self::Rejected => f.write_str("Rejected"),
            Self::Revoked => f.write_str("Revoked"),
        }
    }
}
impl ::std::str::FromStr for ObExternalRequestStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Authorised" => Ok(Self::Authorised),
            "AwaitingAuthorisation" => Ok(Self::AwaitingAuthorisation),
            "Rejected" => Ok(Self::Rejected),
            "Revoked" => Ok(Self::Revoked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalRequestStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalRequestStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalRequestStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the standing order.",
///  "type": "string",
///  "enum": [
///    "Active",
///    "Inactive"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalStandingOrderStatus1Code {
    Active,
    Inactive,
}
impl ::std::fmt::Display for ObExternalStandingOrderStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Active => f.write_str("Active"),
            Self::Inactive => f.write_str("Inactive"),
        }
    }
}
impl ::std::str::FromStr for ObExternalStandingOrderStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Active" => Ok(Self::Active),
            "Inactive" => Ok(Self::Inactive),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalStandingOrderStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalStandingOrderStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalStandingOrderStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the payment.",
///  "type": "string",
///  "enum": [
///    "InitiationCompleted",
///    "InitiationFailed",
///    "InitiationPending"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObExternalStatus1Code {
    InitiationCompleted,
    InitiationFailed,
    InitiationPending,
}
impl ::std::fmt::Display for ObExternalStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::InitiationCompleted => f.write_str("InitiationCompleted"),
            Self::InitiationFailed => f.write_str("InitiationFailed"),
            Self::InitiationPending => f.write_str("InitiationPending"),
        }
    }
}
impl ::std::str::FromStr for ObExternalStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "InitiationCompleted" => Ok(Self::InitiationCompleted),
            "InitiationFailed" => Ok(Self::InitiationFailed),
            "InitiationPending" => Ok(Self::InitiationPending),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObExternalStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObExternalStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObExternalStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBFileBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "FileHash",
///        "FileType"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObFile2 {
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    ///A base64 encoding of a SHA256 hash of the file to be uploaded.
    #[serde(rename = "FileHash")]
    pub file_hash: ObFile2FileHash,
    ///Reference for the file.
    #[serde(
        rename = "FileReference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub file_reference: ::std::option::Option<ObFile2FileReference>,
    #[serde(rename = "FileType")]
    pub file_type: ObExternalFileType1Code,
    #[serde(
        rename = "LocalInstrument",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub local_instrument: ::std::option::Option<ObExternalLocalInstrument1Code>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "RequestedExecutionDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///A base64 encoding of a SHA256 hash of the file to be uploaded.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A base64 encoding of a SHA256 hash of the file to be uploaded.",
///  "type": "string",
///  "maxLength": 44,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFile2FileHash(::std::string::String);
impl ::std::ops::Deref for ObFile2FileHash {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFile2FileHash> for ::std::string::String {
    fn from(value: ObFile2FileHash) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFile2FileHash {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 44usize {
            return Err("longer than 44 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFile2FileHash {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFile2FileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFile2FileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFile2FileHash {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Reference for the file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Reference for the file.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFile2FileReference(::std::string::String);
impl ::std::ops::Deref for ObFile2FileReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFile2FileReference> for ::std::string::String {
    fn from(value: ObFile2FileReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFile2FileReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFile2FileReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFile2FileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFile2FileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFile2FileReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.",
///  "type": "object",
///  "properties": {
///    "FileHash": {
///      "description": "A base64 encoding of a SHA256 hash of the file to be uploaded.",
///      "type": "string",
///      "maxLength": 44,
///      "minLength": 1
///    },
///    "FileReference": {
///      "description": "Reference for the file.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "FileType": {
///      "$ref": "#/components/schemas/OBExternalFileType1Code"
///    },
///    "LocalInstrument": {
///      "$ref": "#/components/schemas/OBExternalLocalInstrument1Code"
///    },
///    "RemittanceInformation": {
///      "$ref": "#/components/schemas/OBRemittanceInformation1"
///    },
///    "RequestedExecutionDateTime": {
///      "description": "The date and time when the initiating party requests the clearing agent to process the payment.\nThis is the date the debtor's account is to be debited.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObFileBase {
    ///A base64 encoding of a SHA256 hash of the file to be uploaded.
    #[serde(
        rename = "FileHash",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub file_hash: ::std::option::Option<ObFileBaseFileHash>,
    ///Reference for the file.
    #[serde(
        rename = "FileReference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub file_reference: ::std::option::Option<ObFileBaseFileReference>,
    #[serde(
        rename = "FileType",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub file_type: ::std::option::Option<ObExternalFileType1Code>,
    #[serde(
        rename = "LocalInstrument",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub local_instrument: ::std::option::Option<ObExternalLocalInstrument1Code>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "RequestedExecutionDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for ObFileBase {
    fn default() -> Self {
        Self {
            file_hash: Default::default(),
            file_reference: Default::default(),
            file_type: Default::default(),
            local_instrument: Default::default(),
            remittance_information: Default::default(),
            requested_execution_date_time: Default::default(),
        }
    }
}
///A base64 encoding of a SHA256 hash of the file to be uploaded.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A base64 encoding of a SHA256 hash of the file to be uploaded.",
///  "type": "string",
///  "maxLength": 44,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFileBaseFileHash(::std::string::String);
impl ::std::ops::Deref for ObFileBaseFileHash {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFileBaseFileHash> for ::std::string::String {
    fn from(value: ObFileBaseFileHash) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFileBaseFileHash {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 44usize {
            return Err("longer than 44 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFileBaseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFileBaseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFileBaseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFileBaseFileHash {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Reference for the file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Reference for the file.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFileBaseFileReference(::std::string::String);
impl ::std::ops::Deref for ObFileBaseFileReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFileBaseFileReference> for ::std::string::String {
    fn from(value: ObFileBaseFileReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFileBaseFileReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFileBaseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFileBaseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFileBaseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFileBaseFileReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds using a payment file.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBFileBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "DebtorAccount",
///        "FileHash",
///        "FileType"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObFileInitiationResponse {
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    ///A base64 encoding of a SHA256 hash of the file to be uploaded.
    #[serde(rename = "FileHash")]
    pub file_hash: ObFileInitiationResponseFileHash,
    ///Reference for the file.
    #[serde(
        rename = "FileReference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub file_reference: ::std::option::Option<ObFileInitiationResponseFileReference>,
    #[serde(rename = "FileType")]
    pub file_type: ObExternalFileType1Code,
    #[serde(
        rename = "LocalInstrument",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub local_instrument: ::std::option::Option<ObExternalLocalInstrument1Code>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "RequestedExecutionDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///A base64 encoding of a SHA256 hash of the file to be uploaded.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A base64 encoding of a SHA256 hash of the file to be uploaded.",
///  "type": "string",
///  "maxLength": 44,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFileInitiationResponseFileHash(::std::string::String);
impl ::std::ops::Deref for ObFileInitiationResponseFileHash {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFileInitiationResponseFileHash> for ::std::string::String {
    fn from(value: ObFileInitiationResponseFileHash) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFileInitiationResponseFileHash {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 44usize {
            return Err("longer than 44 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFileInitiationResponseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFileInitiationResponseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFileInitiationResponseFileHash {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFileInitiationResponseFileHash {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Reference for the file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Reference for the file.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObFileInitiationResponseFileReference(::std::string::String);
impl ::std::ops::Deref for ObFileInitiationResponseFileReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObFileInitiationResponseFileReference> for ::std::string::String {
    fn from(value: ObFileInitiationResponseFileReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObFileInitiationResponseFileReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObFileInitiationResponseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObFileInitiationResponseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObFileInitiationResponseFileReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObFileInitiationResponseFileReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The results of the funds availability check.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The results of the funds availability check.",
///  "type": "object",
///  "required": [
///    "FundsAvailable",
///    "FundsAvailableDateTime"
///  ],
///  "properties": {
///    "FundsAvailable": {
///      "description": "Indicates whether there are enough funds to pay for the `Amount` in the consent request.",
///      "type": "boolean"
///    },
///    "FundsAvailableDateTime": {
///      "description": "The date and time when the funds availability check was generated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObFundsAvailableResult1 {
    ///Indicates whether there are enough funds to pay for the `Amount` in the consent request.
    #[serde(rename = "FundsAvailable")]
    pub funds_available: bool,
    /// The date and time when the funds availability check was generated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "FundsAvailableDateTime")]
    pub funds_available_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "EndToEndIdentification",
///        "InstructedAmount",
///        "InstructionIdentification"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternational2 {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternational2CurrencyOfTransfer,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(rename = "EndToEndIdentification")]
    pub end_to_end_identification: ObInternational2EndToEndIdentification,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternational2InstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObInternational2InstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternational2CurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternational2CurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternational2CurrencyOfTransfer> for ::std::string::String {
    fn from(value: ObInternational2CurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternational2CurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternational2CurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternational2CurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternational2CurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternational2CurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternational2EndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternational2EndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternational2EndToEndIdentification> for ::std::string::String {
    fn from(value: ObInternational2EndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternational2EndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternational2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternational2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternational2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternational2EndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternational2InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: ObInternational2InstructedAmountCurrency,
}
///`ObInternational2InstructedAmountCurrency`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternational2InstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternational2InstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternational2InstructedAmountCurrency> for ::std::string::String {
    fn from(value: ObInternational2InstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternational2InstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternational2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternational2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternational2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternational2InstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternational2InstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternational2InstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternational2InstructionIdentification> for ::std::string::String {
    fn from(value: ObInternational2InstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternational2InstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternational2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternational2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternational2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternational2InstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.",
///  "type": "object",
///  "properties": {
///    "ChargeBearer": {
///      "$ref": "#/components/schemas/OBChargeBearerType1Code"
///    },
///    "Creditor": {
///      "$ref": "#/components/schemas/OBPartyIdentification43"
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "CreditorAgent": {
///      "$ref": "#/components/schemas/OBBranchAndFinancialInstitutionIdentification6"
///    },
///    "CurrencyOfTransfer": {
///      "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "EndToEndIdentification": {
///      "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate1"
///    },
///    "InstructedAmount": {
///      "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "InstructionIdentification": {
///      "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "RemittanceInformation": {
///      "$ref": "#/components/schemas/OBRemittanceInformation1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalBase {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(
        rename = "CurrencyOfTransfer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub currency_of_transfer: ::std::option::Option<ObInternationalBaseCurrencyOfTransfer>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification: ::std::option::Option<ObInternationalBaseEndToEndIdentification>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObInternationalBaseInstructedAmount>,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(
        rename = "InstructionIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instruction_identification:
        ::std::option::Option<ObInternationalBaseInstructionIdentification>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
}
impl ::std::default::Default for ObInternationalBase {
    fn default() -> Self {
        Self {
            charge_bearer: Default::default(),
            creditor: Default::default(),
            creditor_account: Default::default(),
            creditor_agent: Default::default(),
            currency_of_transfer: Default::default(),
            end_to_end_identification: Default::default(),
            exchange_rate_information: Default::default(),
            instructed_amount: Default::default(),
            instruction_identification: Default::default(),
            remittance_information: Default::default(),
        }
    }
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalBaseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalBaseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalBaseCurrencyOfTransfer> for ::std::string::String {
    fn from(value: ObInternationalBaseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalBaseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalBaseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalBaseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalBaseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalBaseCurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalBaseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalBaseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalBaseEndToEndIdentification> for ::std::string::String {
    fn from(value: ObInternationalBaseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalBaseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalBaseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalBaseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: ObInternationalBaseInstructedAmountCurrency,
}
///`ObInternationalBaseInstructedAmountCurrency`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalBaseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalBaseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalBaseInstructedAmountCurrency> for ::std::string::String {
    fn from(value: ObInternationalBaseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalBaseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalBaseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalBaseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalBaseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalBaseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalBaseInstructionIdentification> for ::std::string::String {
    fn from(value: ObInternationalBaseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalBaseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalBaseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalBaseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single international payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "DebtorAccount",
///        "EndToEndIdentification",
///        "InstructedAmount",
///        "InstructionIdentification"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalInitiationResponse {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternationalInitiationResponseCurrencyOfTransfer,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(rename = "EndToEndIdentification")]
    pub end_to_end_identification: ObInternationalInitiationResponseEndToEndIdentification,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternationalInitiationResponseInstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObInternationalInitiationResponseInstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalInitiationResponseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalInitiationResponseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalInitiationResponseCurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalInitiationResponseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalInitiationResponseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalInitiationResponseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalInitiationResponseCurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalInitiationResponseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalInitiationResponseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalInitiationResponseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalInitiationResponseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalInitiationResponseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalInitiationResponseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalInitiationResponseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalInitiationResponseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: ObInternationalInitiationResponseInstructedAmountCurrency,
}
///`ObInternationalInitiationResponseInstructedAmountCurrency`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalInitiationResponseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalInitiationResponseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalInitiationResponseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalInitiationResponseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalInitiationResponseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalInitiationResponseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalInitiationResponseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalInitiationResponseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalInitiationResponseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalInitiationResponseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalInitiationResponseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalInitiationResponseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalInitiationResponseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalInitiationResponseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalScheduledBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "InstructedAmount",
///        "InstructionIdentification",
///        "RequestedExecutionDateTime"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduled2 {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternationalScheduled2CurrencyOfTransfer,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObInternationalScheduled2EndToEndIdentification>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternationalScheduled2InstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification: ObInternationalScheduled2InstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "RequestedExecutionDateTime")]
    pub requested_execution_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduled2CurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduled2CurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduled2CurrencyOfTransfer> for ::std::string::String {
    fn from(value: ObInternationalScheduled2CurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduled2CurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduled2CurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduled2CurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduled2CurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduled2CurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduled2EndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduled2EndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduled2EndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduled2EndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduled2EndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduled2EndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduled2EndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduled2EndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduled2EndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduled2InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalScheduled2InstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduled2InstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduled2InstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduled2InstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduled2InstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduled2InstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduled2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduled2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduled2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduled2InstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduled2InstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduled2InstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduled2InstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduled2InstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduled2InstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduled2InstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduled2InstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduled2InstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduled2InstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.",
///  "type": "object",
///  "properties": {
///    "ChargeBearer": {
///      "$ref": "#/components/schemas/OBChargeBearerType1Code"
///    },
///    "Creditor": {
///      "$ref": "#/components/schemas/OBPartyIdentification43"
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "CreditorAgent": {
///      "$ref": "#/components/schemas/OBBranchAndFinancialInstitutionIdentification6"
///    },
///    "CurrencyOfTransfer": {
///      "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "EndToEndIdentification": {
///      "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate1"
///    },
///    "InstructedAmount": {
///      "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "InstructionIdentification": {
///      "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "RemittanceInformation": {
///      "$ref": "#/components/schemas/OBRemittanceInformation1"
///    },
///    "RequestedExecutionDateTime": {
///      "description": "The date and time when the initiating party requests the clearing agent to process the payment.\nThis is the date the debtor's account is to be debited.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduledBase {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(
        rename = "CurrencyOfTransfer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub currency_of_transfer: ::std::option::Option<ObInternationalScheduledBaseCurrencyOfTransfer>,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObInternationalScheduledBaseEndToEndIdentification>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObInternationalScheduledBaseInstructedAmount>,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(
        rename = "InstructionIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instruction_identification:
        ::std::option::Option<ObInternationalScheduledBaseInstructionIdentification>,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "RequestedExecutionDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub requested_execution_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for ObInternationalScheduledBase {
    fn default() -> Self {
        Self {
            charge_bearer: Default::default(),
            creditor: Default::default(),
            creditor_account: Default::default(),
            creditor_agent: Default::default(),
            currency_of_transfer: Default::default(),
            end_to_end_identification: Default::default(),
            exchange_rate_information: Default::default(),
            instructed_amount: Default::default(),
            instruction_identification: Default::default(),
            remittance_information: Default::default(),
            requested_execution_date_time: Default::default(),
        }
    }
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledBaseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledBaseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledBaseCurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledBaseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledBaseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduledBaseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledBaseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledBaseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduledBaseCurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledBaseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledBaseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledBaseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledBaseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledBaseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduledBaseEndToEndIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledBaseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduledBaseEndToEndIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduledBaseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalScheduledBaseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledBaseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledBaseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledBaseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledBaseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledBaseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduledBaseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduledBaseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledBaseInstructionIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledBaseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledBaseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledBaseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledBaseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalScheduledBaseInstructionIdentification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledBaseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalScheduledBaseInstructionIdentification {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for a single scheduled international payment.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalScheduledBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "DebtorAccount",
///        "InstructedAmount",
///        "InstructionIdentification",
///        "RequestedExecutionDateTime"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduledInitiationResponse {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternationalScheduledInitiationResponseCurrencyOfTransfer,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    /// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
    ///
    /// This ID is used for reconciliation or to link tasks related to the transaction.
    /// It can be included in the messages related to the transaction.
    ///
    /// :::note
    /// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
    /// :::
    #[serde(
        rename = "EndToEndIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub end_to_end_identification:
        ::std::option::Option<ObInternationalScheduledInitiationResponseEndToEndIdentification>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate1>,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternationalScheduledInitiationResponseInstructedAmount,
    /// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
    ///
    /// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
    /// It can be included in the messages related to the instruction.
    #[serde(rename = "InstructionIdentification")]
    pub instruction_identification:
        ObInternationalScheduledInitiationResponseInstructionIdentification,
    #[serde(
        rename = "RemittanceInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub remittance_information: ::std::option::Option<ObRemittanceInformation1>,
    /// The date and time when the initiating party requests the clearing agent to process the payment.
    /// This is the date the debtor's account is to be debited.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "RequestedExecutionDateTime")]
    pub requested_execution_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledInitiationResponseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledInitiationResponseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledInitiationResponseCurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledInitiationResponseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledInitiationResponseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalScheduledInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalScheduledInitiationResponseCurrencyOfTransfer
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.
///
/// This ID is used for reconciliation or to link tasks related to the transaction.
/// It can be included in the messages related to the transaction.
///
/// :::note
/// Faster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID that the initiating party assigns to unambiguously identify the transaction.\n\nThis ID is used for reconciliation or to link tasks related to the transaction.\nIt can be included in the messages related to the transaction.\n\n:::note\nFaster Payments Scheme can access only 31 characters for the `EndToEndIdentification` field.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledInitiationResponseEndToEndIdentification(::std::string::String);
impl ::std::ops::Deref for ObInternationalScheduledInitiationResponseEndToEndIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledInitiationResponseEndToEndIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledInitiationResponseEndToEndIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledInitiationResponseEndToEndIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalScheduledInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledInitiationResponseEndToEndIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalScheduledInitiationResponseEndToEndIdentification
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalScheduledInitiationResponseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalScheduledInitiationResponseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledInitiationResponseInstructedAmountCurrency(
    ::std::string::String,
);
impl ::std::ops::Deref for ObInternationalScheduledInitiationResponseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledInitiationResponseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledInitiationResponseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledInitiationResponseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalScheduledInitiationResponseInstructedAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.
///
/// This ID is used between the instructing party and the instructed party to refer to the individual instruction.
/// It can be included in the messages related to the instruction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that an instructing party assigns for an instructed party to unambiguously identify the instruction.\n\nThis ID is used between the instructing party and the instructed party to refer to the individual instruction.\nIt can be included in the messages related to the instruction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalScheduledInitiationResponseInstructionIdentification(
    ::std::string::String,
);
impl ::std::ops::Deref for ObInternationalScheduledInitiationResponseInstructionIdentification {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalScheduledInitiationResponseInstructionIdentification>
    for ::std::string::String
{
    fn from(value: ObInternationalScheduledInitiationResponseInstructionIdentification) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalScheduledInitiationResponseInstructionIdentification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalScheduledInitiationResponseInstructionIdentification
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalScheduledInitiationResponseInstructionIdentification
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalStandingOrderBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtor4"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "FirstPaymentDateTime",
///        "Frequency",
///        "InstructedAmount"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrder2 {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternationalStandingOrder2CurrencyOfTransfer,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccountDebtor4>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "FirstPaymentDateTime")]
    pub first_payment_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "Frequency")]
    pub frequency: ObInternationalStandingOrder2Frequency,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternationalStandingOrder2InstructedAmount,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments: ::std::option::Option<ObInternationalStandingOrder2NumberOfPayments>,
    /// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObInternationalStandingOrder2Reference>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrder2CurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrder2CurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrder2CurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrder2CurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrder2CurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrder2CurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrder2CurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrder2CurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrder2CurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrder2Frequency(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrder2Frequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrder2Frequency> for ::std::string::String {
    fn from(value: ObInternationalStandingOrder2Frequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrder2Frequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalStandingOrder2Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrder2Frequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrder2InstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalStandingOrder2InstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrder2InstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrder2InstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrder2InstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrder2InstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrder2InstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrder2InstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrder2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrder2InstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrder2InstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrder2NumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrder2NumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrder2NumberOfPayments> for ::std::string::String {
    fn from(value: ObInternationalStandingOrder2NumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrder2NumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrder2NumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrder2NumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrder2NumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrder2NumberOfPayments {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrder2Reference(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrder2Reference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrder2Reference> for ::std::string::String {
    fn from(value: ObInternationalStandingOrder2Reference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrder2Reference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalStandingOrder2Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrder2Reference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.",
///  "type": "object",
///  "properties": {
///    "ChargeBearer": {
///      "$ref": "#/components/schemas/OBChargeBearerType1Code"
///    },
///    "Creditor": {
///      "$ref": "#/components/schemas/OBPartyIdentification43"
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccountCreditor3"
///    },
///    "CreditorAgent": {
///      "$ref": "#/components/schemas/OBBranchAndFinancialInstitutionIdentification6"
///    },
///    "CurrencyOfTransfer": {
///      "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    },
///    "FinalPaymentDateTime": {
///      "description": ":::caution\nCurrently, standing orders do not support ending conditions, so this field is ignored.\n:::\n\nThe date and time when the final payment for a standing order schedule is made.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "FirstPaymentDateTime": {
///      "description": "The date and time when the first payment for a standing order schedule is made.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.\n\n:::caution\nThe day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Frequency": {
///      "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "InstructedAmount": {
///      "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "NumberOfPayments": {
///      "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Reference": {
///      "description": "The unique reference that the creditor assigns to unambiguously refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrderBase {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccountCreditor3>,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(
        rename = "CurrencyOfTransfer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub currency_of_transfer:
        ::std::option::Option<ObInternationalStandingOrderBaseCurrencyOfTransfer>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(
        rename = "FirstPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub first_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(
        rename = "Frequency",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub frequency: ::std::option::Option<ObInternationalStandingOrderBaseFrequency>,
    #[serde(
        rename = "InstructedAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub instructed_amount: ::std::option::Option<ObInternationalStandingOrderBaseInstructedAmount>,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments: ::std::option::Option<ObInternationalStandingOrderBaseNumberOfPayments>,
    /// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObInternationalStandingOrderBaseReference>,
}
impl ::std::default::Default for ObInternationalStandingOrderBase {
    fn default() -> Self {
        Self {
            charge_bearer: Default::default(),
            creditor: Default::default(),
            creditor_account: Default::default(),
            creditor_agent: Default::default(),
            currency_of_transfer: Default::default(),
            final_payment_date_time: Default::default(),
            first_payment_date_time: Default::default(),
            frequency: Default::default(),
            instructed_amount: Default::default(),
            number_of_payments: Default::default(),
            reference: Default::default(),
        }
    }
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderBaseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderBaseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderBaseCurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderBaseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderBaseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderBaseCurrencyOfTransfer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderBaseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderBaseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderBaseCurrencyOfTransfer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderBaseFrequency(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderBaseFrequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderBaseFrequency> for ::std::string::String {
    fn from(value: ObInternationalStandingOrderBaseFrequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderBaseFrequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalStandingOrderBaseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderBaseFrequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrderBaseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalStandingOrderBaseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderBaseInstructedAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderBaseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderBaseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderBaseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderBaseInstructedAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderBaseInstructedAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderBaseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderBaseInstructedAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderBaseNumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderBaseNumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderBaseNumberOfPayments>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderBaseNumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderBaseNumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderBaseNumberOfPayments {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderBaseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderBaseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderBaseNumberOfPayments {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderBaseReference(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderBaseReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderBaseReference> for ::std::string::String {
    fn from(value: ObInternationalStandingOrderBaseReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderBaseReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObInternationalStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObInternationalStandingOrderBaseReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderBaseReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The initiation payload that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which is used to request movement of funds from the debtor account to the creditor for an international standing order.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBInternationalStandingOrderBase"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "DebtorAccount": {
///          "$ref": "#/components/schemas/OBCashAccountDebtorResponse"
///        }
///      }
///    },
///    {
///      "type": "object",
///      "required": [
///        "CreditorAccount",
///        "CurrencyOfTransfer",
///        "DebtorAccount",
///        "FirstPaymentDateTime",
///        "Frequency",
///        "InstructedAmount"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrderInitiationResponse {
    #[serde(
        rename = "ChargeBearer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_bearer: ::std::option::Option<ObChargeBearerType1Code>,
    #[serde(
        rename = "Creditor",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor: ::std::option::Option<ObPartyIdentification43>,
    #[serde(rename = "CreditorAccount")]
    pub creditor_account: ObCashAccountCreditor3,
    #[serde(
        rename = "CreditorAgent",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_agent: ::std::option::Option<ObBranchAndFinancialInstitutionIdentification6>,
    ///The currency of the money to be transferred, which is different from the currency of the debtor's account.
    #[serde(rename = "CurrencyOfTransfer")]
    pub currency_of_transfer: ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer,
    #[serde(rename = "DebtorAccount")]
    pub debtor_account: ObCashAccountDebtorResponse,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so this field is ignored.
    /// :::
    ///
    /// The date and time when the final payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FinalPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub final_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The date and time when the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    ///
    /// :::caution
    /// The day part of the date must agree with the day of the interval set in `Frequency`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "FirstPaymentDateTime")]
    pub first_payment_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    ///
    /// :::caution
    /// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
    /// For example:
    /// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
    /// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
    /// :::
    #[serde(rename = "Frequency")]
    pub frequency: ObInternationalStandingOrderInitiationResponseFrequency,
    #[serde(rename = "InstructedAmount")]
    pub instructed_amount: ObInternationalStandingOrderInitiationResponseInstructedAmount,
    /// :::caution
    /// Currently, standing orders do not support ending conditions, so using this field will result in an error.
    /// :::
    ///
    /// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
    #[serde(
        rename = "NumberOfPayments",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub number_of_payments:
        ::std::option::Option<ObInternationalStandingOrderInitiationResponseNumberOfPayments>,
    /// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObInternationalStandingOrderInitiationResponseReference>,
}
///The currency of the money to be transferred, which is different from the currency of the debtor's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the money to be transferred, which is different from the currency of the debtor's account.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalStandingOrderInitiationResponseCurrencyOfTransfer
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// :::caution
/// The day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.
/// For example:
/// - Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February
/// - Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`\n\n:::caution\nThe day of the interval must agree with the day from `FirstPaymentDateTime`, otherwise, for `POST` requests, the `Unsupported frequency` error is returned.\nFor example: \n- Correct: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-03T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, and the first occurrence will be on the 3rd of February\n- Incorrect: `Frequency=IntrvlMnthDay:01:03` and `FirstPaymentDateTime=2026-02-17T14:15:22Z` - the day to schedule the payment is the 3rd day of the month, but the first occurrence is set to the 17th of February, so the days don't match.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderInitiationResponseFrequency(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderInitiationResponseFrequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderInitiationResponseFrequency>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderInitiationResponseFrequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderInitiationResponseFrequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderInitiationResponseFrequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderInitiationResponseFrequency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderInitiationResponseFrequency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderInitiationResponseFrequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.
///
/// This amount has to be transported unchanged through the transaction chain.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency that the initiating party instructs.\n\nThis amount has to be transported unchanged through the transaction chain.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObInternationalStandingOrderInitiationResponseInstructedAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency(
    ::std::string::String,
);
impl ::std::ops::Deref for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr
    for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency
{
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalStandingOrderInitiationResponseInstructedAmountCurrency
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// :::caution
/// Currently, standing orders do not support ending conditions, so using this field will result in an error.
/// :::
///
/// The number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": ":::caution\nCurrently, standing orders do not support ending conditions, so using this field will result in an error.\n:::\n\nThe number of payments to make, with the interval set in `frequency`, counting from the start date set in `FirstPaymentDateTime`.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderInitiationResponseNumberOfPayments(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderInitiationResponseNumberOfPayments {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderInitiationResponseNumberOfPayments>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderInitiationResponseNumberOfPayments) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderInitiationResponseNumberOfPayments {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObInternationalStandingOrderInitiationResponseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderInitiationResponseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderInitiationResponseNumberOfPayments
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObInternationalStandingOrderInitiationResponseNumberOfPayments
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to unambiguously refer to the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObInternationalStandingOrderInitiationResponseReference(::std::string::String);
impl ::std::ops::Deref for ObInternationalStandingOrderInitiationResponseReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObInternationalStandingOrderInitiationResponseReference>
    for ::std::string::String
{
    fn from(value: ObInternationalStandingOrderInitiationResponseReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObInternationalStandingOrderInitiationResponseReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObInternationalStandingOrderInitiationResponseReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObInternationalStandingOrderInitiationResponseReference
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObInternationalStandingOrderInitiationResponseReference
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObInternationalStandingOrderInitiationResponseReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The details of the merchant involved in the transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the merchant involved in the transaction.",
///  "type": "object",
///  "properties": {
///    "MerchantName": {
///      "description": "The name of the merchant.",
///      "type": "string",
///      "maxLength": 350,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObMerchantDetails1 {
    ///The name of the merchant.
    #[serde(
        rename = "MerchantName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub merchant_name: ::std::option::Option<ObMerchantDetails1MerchantName>,
}
impl ::std::default::Default for ObMerchantDetails1 {
    fn default() -> Self {
        Self {
            merchant_name: Default::default(),
        }
    }
}
///The name of the merchant.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the merchant.",
///  "type": "string",
///  "maxLength": 350,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObMerchantDetails1MerchantName(::std::string::String);
impl ::std::ops::Deref for ObMerchantDetails1MerchantName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObMerchantDetails1MerchantName> for ::std::string::String {
    fn from(value: ObMerchantDetails1MerchantName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObMerchantDetails1MerchantName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 350usize {
            return Err("longer than 350 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObMerchantDetails1MerchantName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObMerchantDetails1MerchantName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObMerchantDetails1MerchantName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObMerchantDetails1MerchantName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The party that an amount of money is due to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The party that an amount of money is due to.",
///  "type": "object",
///  "properties": {
///    "Name": {
///      "description": "The name of a known party used to identify the party.",
///      "type": "string",
///      "maxLength": 140,
///      "minLength": 1
///    },
///    "PostalAddress": {
///      "$ref": "#/components/schemas/OBPostalAddress6"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObPartyIdentification43 {
    ///The name of a known party used to identify the party.
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<ObPartyIdentification43Name>,
    #[serde(
        rename = "PostalAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub postal_address: ::std::option::Option<ObPostalAddress6>,
}
impl ::std::default::Default for ObPartyIdentification43 {
    fn default() -> Self {
        Self {
            name: Default::default(),
            postal_address: Default::default(),
        }
    }
}
///The name of a known party used to identify the party.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of a known party used to identify the party.",
///  "type": "string",
///  "maxLength": 140,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPartyIdentification43Name(::std::string::String);
impl ::std::ops::Deref for ObPartyIdentification43Name {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPartyIdentification43Name> for ::std::string::String {
    fn from(value: ObPartyIdentification43Name) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPartyIdentification43Name {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 140usize {
            return Err("longer than 140 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPartyIdentification43Name {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPartyIdentification43Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPartyIdentification43Name {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPartyIdentification43Name {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The postal address of the creditor, as defined by postal services.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The postal address of the creditor, as defined by postal services.",
///  "type": "object",
///  "properties": {
///    "AddressLine": {
///      "description": "The information that locates and identifies the address of the creditor, presented in free format text.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "maxLength": 70,
///        "minLength": 1
///      },
///      "maxItems": 7,
///      "minItems": 0
///    },
///    "BuildingNumber": {
///      "description": "The number of the building.",
///      "type": "string",
///      "maxLength": 16,
///      "minLength": 1
///    },
///    "Country": {
///      "description": "The name of the country.",
///      "type": "string",
///      "pattern": "^[A-Z]{2,2}$"
///    },
///    "CountrySubDivision": {
///      "description": "The subdivision of the country, such as state, region, or county.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Department": {
///      "description": "The name of the department.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "PostCode": {
///      "description": "The post code of the address.",
///      "type": "string",
///      "maxLength": 16,
///      "minLength": 1
///    },
///    "StreetName": {
///      "description": "The name of the street.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "SubDepartment": {
///      "description": "The name of the sub-department.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "TownName": {
///      "description": "The name of the town.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObPostalAddress6 {
    ///The information that locates and identifies the address of the creditor, presented in free format text.
    #[serde(
        rename = "AddressLine",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub address_line: ::std::vec::Vec<ObPostalAddress6AddressLineItem>,
    ///The number of the building.
    #[serde(
        rename = "BuildingNumber",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub building_number: ::std::option::Option<ObPostalAddress6BuildingNumber>,
    ///The name of the country.
    #[serde(
        rename = "Country",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub country: ::std::option::Option<ObPostalAddress6Country>,
    ///The subdivision of the country, such as state, region, or county.
    #[serde(
        rename = "CountrySubDivision",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub country_sub_division: ::std::option::Option<ObPostalAddress6CountrySubDivision>,
    ///The name of the department.
    #[serde(
        rename = "Department",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub department: ::std::option::Option<ObPostalAddress6Department>,
    ///The post code of the address.
    #[serde(
        rename = "PostCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub post_code: ::std::option::Option<ObPostalAddress6PostCode>,
    ///The name of the street.
    #[serde(
        rename = "StreetName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub street_name: ::std::option::Option<ObPostalAddress6StreetName>,
    ///The name of the sub-department.
    #[serde(
        rename = "SubDepartment",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub sub_department: ::std::option::Option<ObPostalAddress6SubDepartment>,
    ///The name of the town.
    #[serde(
        rename = "TownName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub town_name: ::std::option::Option<ObPostalAddress6TownName>,
}
impl ::std::default::Default for ObPostalAddress6 {
    fn default() -> Self {
        Self {
            address_line: Default::default(),
            building_number: Default::default(),
            country: Default::default(),
            country_sub_division: Default::default(),
            department: Default::default(),
            post_code: Default::default(),
            street_name: Default::default(),
            sub_department: Default::default(),
            town_name: Default::default(),
        }
    }
}
///`ObPostalAddress6AddressLineItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6AddressLineItem(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6AddressLineItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6AddressLineItem> for ::std::string::String {
    fn from(value: ObPostalAddress6AddressLineItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6AddressLineItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6AddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6AddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6AddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6AddressLineItem {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The number of the building.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The number of the building.",
///  "type": "string",
///  "maxLength": 16,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6BuildingNumber(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6BuildingNumber {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6BuildingNumber> for ::std::string::String {
    fn from(value: ObPostalAddress6BuildingNumber) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6BuildingNumber {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 16usize {
            return Err("longer than 16 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6BuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6BuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6BuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6BuildingNumber {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the country.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the country.",
///  "type": "string",
///  "pattern": "^[A-Z]{2,2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6Country(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6Country {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6Country> for ::std::string::String {
    fn from(value: ObPostalAddress6Country) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6Country {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{2,2}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2,2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6Country {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6Country {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6Country {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6Country {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The subdivision of the country, such as state, region, or county.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The subdivision of the country, such as state, region, or county.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6CountrySubDivision(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6CountrySubDivision {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6CountrySubDivision> for ::std::string::String {
    fn from(value: ObPostalAddress6CountrySubDivision) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6CountrySubDivision {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6CountrySubDivision {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6CountrySubDivision {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6CountrySubDivision {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6CountrySubDivision {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the department.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the department.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6Department(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6Department {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6Department> for ::std::string::String {
    fn from(value: ObPostalAddress6Department) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6Department {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6Department {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6Department {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6Department {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6Department {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The post code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The post code of the address.",
///  "type": "string",
///  "maxLength": 16,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6PostCode(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6PostCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6PostCode> for ::std::string::String {
    fn from(value: ObPostalAddress6PostCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6PostCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 16usize {
            return Err("longer than 16 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6PostCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6PostCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6PostCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6PostCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the street.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the street.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6StreetName(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6StreetName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6StreetName> for ::std::string::String {
    fn from(value: ObPostalAddress6StreetName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6StreetName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6StreetName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6StreetName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6StreetName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6StreetName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the sub-department.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the sub-department.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6SubDepartment(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6SubDepartment {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6SubDepartment> for ::std::string::String {
    fn from(value: ObPostalAddress6SubDepartment) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6SubDepartment {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6SubDepartment {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6SubDepartment {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6SubDepartment {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6SubDepartment {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the town.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the town.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObPostalAddress6TownName(::std::string::String);
impl ::std::ops::Deref for ObPostalAddress6TownName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObPostalAddress6TownName> for ::std::string::String {
    fn from(value: ObPostalAddress6TownName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObPostalAddress6TownName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObPostalAddress6TownName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObPostalAddress6TownName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObPostalAddress6TownName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObPostalAddress6TownName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObReadAccount3`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "type": "object",
///      "properties": {
///        "Account": {
///          "description": "The unique ID of the account that credit and debit entries are made to.",
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBAccount3"
///          }
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadAccount3 {
    #[serde(rename = "Data")]
    pub data: ObReadAccount3Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObReadAccount3Data`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "Account": {
///      "description": "The unique ID of the account that credit and debit entries are made to.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBAccount3"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadAccount3Data {
    ///The unique ID of the account that credit and debit entries are made to.
    #[serde(
        rename = "Account",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub account: ::std::vec::Vec<ObAccount3>,
}
impl ::std::default::Default for ObReadAccount3Data {
    fn default() -> Self {
        Self {
            account: Default::default(),
        }
    }
}
///`ObReadBalance1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "description": "The balance details.",
///      "type": "object",
///      "required": [
///        "Balance"
///      ],
///      "properties": {
///        "Balance": {
///          "description": "A list of elements to define the balance details.",
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBCashBalance1"
///          },
///          "minItems": 1
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadBalance1 {
    #[serde(rename = "Data")]
    pub data: ObReadBalance1Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///The balance details.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The balance details.",
///  "type": "object",
///  "required": [
///    "Balance"
///  ],
///  "properties": {
///    "Balance": {
///      "description": "A list of elements to define the balance details.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBCashBalance1"
///      },
///      "minItems": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadBalance1Data {
    ///A list of elements to define the balance details.
    #[serde(rename = "Balance")]
    pub balance: ::std::vec::Vec<ObCashBalance1>,
}
///`ObReadBeneficiary3`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "description": "A list of beneficiaries.",
///      "type": "object",
///      "properties": {
///        "Beneficiary": {
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBBeneficiary3"
///          }
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadBeneficiary3 {
    #[serde(rename = "Data")]
    pub data: ObReadBeneficiary3Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///A list of beneficiaries.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of beneficiaries.",
///  "type": "object",
///  "properties": {
///    "Beneficiary": {
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBBeneficiary3"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadBeneficiary3Data {
    #[serde(
        rename = "Beneficiary",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub beneficiary: ::std::vec::Vec<ObBeneficiary3>,
}
impl ::std::default::Default for ObReadBeneficiary3Data {
    fn default() -> Self {
        Self {
            beneficiary: Default::default(),
        }
    }
}
///`ObReadConsent1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBReadData1"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadConsent1 {
    #[serde(rename = "Data")]
    pub data: ObReadData1,
    #[serde(rename = "Risk")]
    pub risk: ObRisk2,
}
///`ObReadConsentResponse1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "type": "object",
///      "required": [
///        "ConsentId",
///        "CreationDateTime",
///        "Permissions",
///        "Status",
///        "StatusUpdateDateTime"
///      ],
///      "properties": {
///        "ConsentId": {
///          "description": "The unique ID that is assigned to identify the account access consent resource.",
///          "type": "string",
///          "maxLength": 128,
///          "minLength": 1
///        },
///        "CreationDateTime": {
///          "description": "The date and time when the account access consent was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///          "type": "string",
///          "format": "date-time"
///        },
///        "ExpirationDateTime": {
///          "description": "The date and time when the permission expires.\nIf this is not specified, the permission is open ended.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///          "type": "string",
///          "format": "date-time"
///        },
///        "Permissions": {
///          "description": "The type of data access to the account.",
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBExternalPermissions1Code"
///          },
///          "minItems": 1
///        },
///        "Status": {
///          "$ref": "#/components/schemas/OBExternalRequestStatus1Code"
///        },
///        "StatusUpdateDateTime": {
///          "description": "The date and time when the account access consent was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///          "type": "string",
///          "format": "date-time"
///        },
///        "TransactionFromDateTime": {
///          "description": "The start date and time for the transaction query period.\nIf this is not specified, the start date is open ended, and data is returned from the earliest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///          "type": "string",
///          "format": "date-time"
///        },
///        "TransactionToDateTime": {
///          "description": "The end date and time for the transaction query period.\nIf this is not specified, the end date is open ended, and data is returned to the latest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///          "type": "string",
///          "format": "date-time"
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadConsentResponse1 {
    #[serde(rename = "Data")]
    pub data: ObReadConsentResponse1Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk2,
}
///`ObReadConsentResponse1Data`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Permissions",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that is assigned to identify the account access consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the account access consent was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "ExpirationDateTime": {
///      "description": "The date and time when the permission expires.\nIf this is not specified, the permission is open ended.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Permissions": {
///      "description": "The type of data access to the account.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBExternalPermissions1Code"
///      },
///      "minItems": 1
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalRequestStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the account access consent was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "TransactionFromDateTime": {
///      "description": "The start date and time for the transaction query period.\nIf this is not specified, the start date is open ended, and data is returned from the earliest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "TransactionToDateTime": {
///      "description": "The end date and time for the transaction query period.\nIf this is not specified, the end date is open ended, and data is returned to the latest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadConsentResponse1Data {
    ///The unique ID that is assigned to identify the account access consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObReadConsentResponse1DataConsentId,
    /// The date and time when the account access consent was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The date and time when the permission expires.
    /// If this is not specified, the permission is open ended.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "ExpirationDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub expiration_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The type of data access to the account.
    #[serde(rename = "Permissions")]
    pub permissions: ::std::vec::Vec<ObExternalPermissions1Code>,
    #[serde(rename = "Status")]
    pub status: ObExternalRequestStatus1Code,
    /// The date and time when the account access consent was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The start date and time for the transaction query period.
    /// If this is not specified, the start date is open ended, and data is returned from the earliest available transaction.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "TransactionFromDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_from_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The end date and time for the transaction query period.
    /// If this is not specified, the end date is open ended, and data is returned to the latest available transaction.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "TransactionToDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_to_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///The unique ID that is assigned to identify the account access consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that is assigned to identify the account access consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObReadConsentResponse1DataConsentId(::std::string::String);
impl ::std::ops::Deref for ObReadConsentResponse1DataConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObReadConsentResponse1DataConsentId> for ::std::string::String {
    fn from(value: ObReadConsentResponse1DataConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObReadConsentResponse1DataConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObReadConsentResponse1DataConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObReadConsentResponse1DataConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObReadConsentResponse1DataConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObReadConsentResponse1DataConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObReadData1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Permissions"
///  ],
///  "properties": {
///    "ExpirationDateTime": {
///      "description": "Specifies the date and time the permission expires.\nIf this is not specified, the permission is open ended.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Permissions": {
///      "description": "Specifies the type of data access to the account.\nThis is a list of the data clusters being consented by the [PSU](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), and requested for authorisation with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBExternalPermissions1Code"
///      },
///      "minItems": 1
///    },
///    "TransactionFromDateTime": {
///      "description": "Specifies the start date and time for the transaction query period.\nIf this is not specified, the start date is open ended, and data is returned from the earliest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "TransactionToDateTime": {
///      "description": "Specifies the end date and time for the transaction query period.\nIf this is not specified, the end date is open ended, and data is returned to the latest available transaction.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadData1 {
    /// Specifies the date and time the permission expires.
    /// If this is not specified, the permission is open ended.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "ExpirationDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub expiration_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// Specifies the type of data access to the account.
    /// This is a list of the data clusters being consented by the [PSU](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), and requested for authorisation with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).
    #[serde(rename = "Permissions")]
    pub permissions: ::std::vec::Vec<ObExternalPermissions1Code>,
    /// Specifies the start date and time for the transaction query period.
    /// If this is not specified, the start date is open ended, and data is returned from the earliest available transaction.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "TransactionFromDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_from_date_time:
        ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// Specifies the end date and time for the transaction query period.
    /// If this is not specified, the end date is open ended, and data is returned to the latest available transaction.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "TransactionToDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_to_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`ObReadDirectDebit1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "description": "A list of direct debits.",
///      "type": "object",
///      "properties": {
///        "DirectDebit": {
///          "description": "The account that a cash entry is made to or from.",
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBDirectDebit1"
///          }
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadDirectDebit1 {
    #[serde(rename = "Data")]
    pub data: ObReadDirectDebit1Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///A list of direct debits.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of direct debits.",
///  "type": "object",
///  "properties": {
///    "DirectDebit": {
///      "description": "The account that a cash entry is made to or from.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBDirectDebit1"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadDirectDebit1Data {
    ///The account that a cash entry is made to or from.
    #[serde(
        rename = "DirectDebit",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub direct_debit: ::std::vec::Vec<ObDirectDebit1>,
}
impl ::std::default::Default for ObReadDirectDebit1Data {
    fn default() -> Self {
        Self {
            direct_debit: Default::default(),
        }
    }
}
///`ObReadStandingOrder4`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "type": "object",
///      "properties": {
///        "StandingOrder": {
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBStandingOrder4"
///          }
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadStandingOrder4 {
    #[serde(rename = "Data")]
    pub data: ObReadStandingOrder4Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObReadStandingOrder4Data`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "StandingOrder": {
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBStandingOrder4"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadStandingOrder4Data {
    #[serde(
        rename = "StandingOrder",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub standing_order: ::std::vec::Vec<ObStandingOrder4>,
}
impl ::std::default::Default for ObReadStandingOrder4Data {
    fn default() -> Self {
        Self {
            standing_order: Default::default(),
        }
    }
}
///`ObReadTransaction4`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "type": "object",
///      "properties": {
///        "Transaction": {
///          "description": "The details about the transaction.",
///          "type": "array",
///          "items": {
///            "$ref": "#/components/schemas/OBTransaction4"
///          }
///        }
///      }
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadTransaction4 {
    #[serde(rename = "Data")]
    pub data: ObReadTransaction4Data,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObReadTransaction4Data`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "Transaction": {
///      "description": "The details about the transaction.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/OBTransaction4"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReadTransaction4Data {
    ///The details about the transaction.
    #[serde(
        rename = "Transaction",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub transaction: ::std::vec::Vec<ObTransaction4>,
}
impl ::std::default::Default for ObReadTransaction4Data {
    fn default() -> Self {
        Self {
            transaction: Default::default(),
        }
    }
}
///The information used for matching an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts' receivable system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The information used for matching an entry with the items that the transfer is intended to settle, such as commercial invoices in an accounts' receivable system.",
///  "type": "object",
///  "properties": {
///    "Reference": {
///      "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.\n\n:::note\nFaster Payments Scheme can accept only 18 characters for the `Reference` field.\n:::\n\n:::caution\nOnly one reference should be provided, if both `Reference` and `Unstructured` parameters are provided, then the `Unstructured` parameter will be ignored.\n:::",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Unstructured": {
///      "description": "The information used for matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.",
///      "type": "string",
///      "maxLength": 140,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObRemittanceInformation1 {
    /// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    ///
    /// :::note
    /// Faster Payments Scheme can accept only 18 characters for the `Reference` field.
    /// :::
    ///
    /// :::caution
    /// Only one reference should be provided, if both `Reference` and `Unstructured` parameters are provided, then the `Unstructured` parameter will be ignored.
    /// :::
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObRemittanceInformation1Reference>,
    ///The information used for matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.
    #[serde(
        rename = "Unstructured",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub unstructured: ::std::option::Option<ObRemittanceInformation1Unstructured>,
}
impl ::std::default::Default for ObRemittanceInformation1 {
    fn default() -> Self {
        Self {
            reference: Default::default(),
            unstructured: Default::default(),
        }
    }
}
/// The unique reference that the creditor assigns to unambiguously identify the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// :::note
/// Faster Payments Scheme can accept only 18 characters for the `Reference` field.
/// :::
///
/// :::caution
/// Only one reference should be provided, if both `Reference` and `Unstructured` parameters are provided, then the `Unstructured` parameter will be ignored.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to unambiguously identify the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.\n\n:::note\nFaster Payments Scheme can accept only 18 characters for the `Reference` field.\n:::\n\n:::caution\nOnly one reference should be provided, if both `Reference` and `Unstructured` parameters are provided, then the `Unstructured` parameter will be ignored.\n:::",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRemittanceInformation1Reference(::std::string::String);
impl ::std::ops::Deref for ObRemittanceInformation1Reference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRemittanceInformation1Reference> for ::std::string::String {
    fn from(value: ObRemittanceInformation1Reference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRemittanceInformation1Reference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRemittanceInformation1Reference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRemittanceInformation1Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRemittanceInformation1Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRemittanceInformation1Reference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The information used for matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The information used for matching/reconciliation of an entry with the items that the payment is intended to settle, such as commercial invoices in an accounts' receivable system, in an unstructured form.",
///  "type": "string",
///  "maxLength": 140,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRemittanceInformation1Unstructured(::std::string::String);
impl ::std::ops::Deref for ObRemittanceInformation1Unstructured {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRemittanceInformation1Unstructured> for ::std::string::String {
    fn from(value: ObRemittanceInformation1Unstructured) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRemittanceInformation1Unstructured {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 140usize {
            return Err("longer than 140 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRemittanceInformation1Unstructured {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRemittanceInformation1Unstructured {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRemittanceInformation1Unstructured {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRemittanceInformation1Unstructured {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObReportFileResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Payments"
///  ],
///  "properties": {
///    "Payments": {
///      "description": "The list of payments included in the file payment.\nEach element in the list corresponds to a single payment and contains the amount, reference, and status of that individual payment.",
///      "type": "array",
///      "items": {
///        "description": "Detailes for a single payment.",
///        "type": "object",
///        "required": [
///          "Amount",
///          "Reference",
///          "Status"
///        ],
///        "properties": {
///          "Amount": {
///            "description": "The amount of money paid. Specifies the amount and the currency.",
///            "type": "object",
///            "required": [
///              "Amount",
///              "Currency"
///            ],
///            "properties": {
///              "Amount": {
///                "$ref": "#/components/schemas/Amount"
///              },
///              "Currency": {
///                "$ref": "#/components/schemas/Currency"
///              }
///            }
///          },
///          "Reference": {
///            "description": "The unique reference assigned to the payment.",
///            "type": "string",
///            "maxLength": 100,
///            "minLength": 1
///          },
///          "Status": {
///            "$ref": "#/components/schemas/PaymentStatus"
///          }
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReportFileResponse {
    /// The list of payments included in the file payment.
    /// Each element in the list corresponds to a single payment and contains the amount, reference, and status of that individual payment.
    #[serde(rename = "Payments")]
    pub payments: ::std::vec::Vec<ObReportFileResponsePaymentsItem>,
}
///Detailes for a single payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Detailes for a single payment.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Reference",
///    "Status"
///  ],
///  "properties": {
///    "Amount": {
///      "description": "The amount of money paid. Specifies the amount and the currency.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/Amount"
///        },
///        "Currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "Reference": {
///      "description": "The unique reference assigned to the payment.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    },
///    "Status": {
///      "$ref": "#/components/schemas/PaymentStatus"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReportFileResponsePaymentsItem {
    #[serde(rename = "Amount")]
    pub amount: ObReportFileResponsePaymentsItemAmount,
    ///The unique reference assigned to the payment.
    #[serde(rename = "Reference")]
    pub reference: ObReportFileResponsePaymentsItemReference,
    #[serde(rename = "Status")]
    pub status: PaymentStatus,
}
///The amount of money paid. Specifies the amount and the currency.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money paid. Specifies the amount and the currency.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/Amount"
///    },
///    "Currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObReportFileResponsePaymentsItemAmount {
    #[serde(rename = "Amount")]
    pub amount: Amount,
    #[serde(rename = "Currency")]
    pub currency: Currency,
}
///The unique reference assigned to the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference assigned to the payment.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObReportFileResponsePaymentsItemReference(::std::string::String);
impl ::std::ops::Deref for ObReportFileResponsePaymentsItemReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObReportFileResponsePaymentsItemReference> for ::std::string::String {
    fn from(value: ObReportFileResponsePaymentsItemReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObReportFileResponsePaymentsItemReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 100usize {
            return Err("longer than 100 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObReportFileResponsePaymentsItemReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObReportFileResponsePaymentsItemReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObReportFileResponsePaymentsItemReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObReportFileResponsePaymentsItemReference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The name of the identification scheme.
///
/// Note the scheme `UK.Revolut.InternalAccountId` is an internal account identifier for those accounts which don't have externally available identifiers.
/// It cannot be used to send or receive funds.
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the identification scheme.\n\nNote the scheme `UK.Revolut.InternalAccountId` is an internal account identifier for those accounts which don't have externally available identifiers.\nIt cannot be used to send or receive funds.\n",
///  "type": "string",
///  "enum": [
///    "UK.OBIE.IBAN",
///    "UK.OBIE.SortCodeAccountNumber",
///    "US.RoutingNumberAccountNumber",
///    "US.BranchCodeAccountNumber",
///    "UK.Revolut.InternalAccountId"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObRevolutAccountIdentificationCode {
    #[serde(rename = "UK.OBIE.IBAN")]
    UkObieIban,
    #[serde(rename = "UK.OBIE.SortCodeAccountNumber")]
    UkObieSortCodeAccountNumber,
    #[serde(rename = "US.RoutingNumberAccountNumber")]
    UsRoutingNumberAccountNumber,
    #[serde(rename = "US.BranchCodeAccountNumber")]
    UsBranchCodeAccountNumber,
    #[serde(rename = "UK.Revolut.InternalAccountId")]
    UkRevolutInternalAccountId,
}
impl ::std::fmt::Display for ObRevolutAccountIdentificationCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkObieIban => f.write_str("UK.OBIE.IBAN"),
            Self::UkObieSortCodeAccountNumber => f.write_str("UK.OBIE.SortCodeAccountNumber"),
            Self::UsRoutingNumberAccountNumber => f.write_str("US.RoutingNumberAccountNumber"),
            Self::UsBranchCodeAccountNumber => f.write_str("US.BranchCodeAccountNumber"),
            Self::UkRevolutInternalAccountId => f.write_str("UK.Revolut.InternalAccountId"),
        }
    }
}
impl ::std::str::FromStr for ObRevolutAccountIdentificationCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "UK.OBIE.IBAN" => Ok(Self::UkObieIban),
            "UK.OBIE.SortCodeAccountNumber" => Ok(Self::UkObieSortCodeAccountNumber),
            "US.RoutingNumberAccountNumber" => Ok(Self::UsRoutingNumberAccountNumber),
            "US.BranchCodeAccountNumber" => Ok(Self::UsBranchCodeAccountNumber),
            "UK.Revolut.InternalAccountId" => Ok(Self::UkRevolutInternalAccountId),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObRevolutAccountIdentificationCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRevolutAccountIdentificationCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRevolutAccountIdentificationCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The Risk section contains the risk indicators that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which can be used to specify additional details for risk scoring for account information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Risk section contains the risk indicators that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which can be used to specify additional details for risk scoring for account information.",
///  "type": "object",
///  "properties": {
///    "DeliveryAddress": {
///      "description": "The information that locates and identifies the delivery address, as defined by postal services or in free format text.",
///      "type": "object",
///      "required": [
///        "Country",
///        "TownName"
///      ],
///      "properties": {
///        "AddressLine": {
///          "description": "The information that locates and identifies the delivery address, as defined by postal services, that is presented in free format text.",
///          "type": "array",
///          "items": {
///            "type": "string",
///            "maxLength": 70,
///            "minLength": 1
///          },
///          "maxItems": 2,
///          "minItems": 0
///        },
///        "BuildingNumber": {
///          "description": "The number of the building.",
///          "type": "string",
///          "maxLength": 16,
///          "minLength": 1
///        },
///        "Country": {
///          "description": "The name of the country.",
///          "type": "string",
///          "pattern": "^[A-Z]{2,2}$"
///        },
///        "CountrySubDivision": {
///          "description": "The subdivision of the country, for example, state, region or county.",
///          "type": "array",
///          "items": {
///            "type": "string",
///            "maxLength": 35,
///            "minLength": 1
///          },
///          "maxItems": 2,
///          "minItems": 0
///        },
///        "PostCode": {
///          "description": "The post code of the delivery address.",
///          "type": "string",
///          "maxLength": 16,
///          "minLength": 1
///        },
///        "StreetName": {
///          "description": "The name of the street.",
///          "type": "string",
///          "maxLength": 70,
///          "minLength": 1
///        },
///        "TownName": {
///          "description": "The name of the town.",
///          "type": "string",
///          "maxLength": 35,
///          "minLength": 1
///        }
///      }
///    },
///    "MerchantCategoryCode": {
///      "$ref": "#/components/schemas/OBExternalMerchantCategoryCode"
///    },
///    "MerchantCustomerIdentification": {
///      "$ref": "#/components/schemas/OBExternalMerchantCustomerIdentification"
///    },
///    "PaymentContextCode": {
///      "$ref": "#/components/schemas/OBExternalPaymentContext1Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObRisk1 {
    #[serde(
        rename = "DeliveryAddress",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub delivery_address: ::std::option::Option<ObRisk1DeliveryAddress>,
    #[serde(
        rename = "MerchantCategoryCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub merchant_category_code: ::std::option::Option<ObExternalMerchantCategoryCode>,
    #[serde(
        rename = "MerchantCustomerIdentification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub merchant_customer_identification:
        ::std::option::Option<ObExternalMerchantCustomerIdentification>,
    #[serde(
        rename = "PaymentContextCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub payment_context_code: ::std::option::Option<ObExternalPaymentContext1Code>,
}
impl ::std::default::Default for ObRisk1 {
    fn default() -> Self {
        Self {
            delivery_address: Default::default(),
            merchant_category_code: Default::default(),
            merchant_customer_identification: Default::default(),
            payment_context_code: Default::default(),
        }
    }
}
///The information that locates and identifies the delivery address, as defined by postal services or in free format text.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The information that locates and identifies the delivery address, as defined by postal services or in free format text.",
///  "type": "object",
///  "required": [
///    "Country",
///    "TownName"
///  ],
///  "properties": {
///    "AddressLine": {
///      "description": "The information that locates and identifies the delivery address, as defined by postal services, that is presented in free format text.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "maxLength": 70,
///        "minLength": 1
///      },
///      "maxItems": 2,
///      "minItems": 0
///    },
///    "BuildingNumber": {
///      "description": "The number of the building.",
///      "type": "string",
///      "maxLength": 16,
///      "minLength": 1
///    },
///    "Country": {
///      "description": "The name of the country.",
///      "type": "string",
///      "pattern": "^[A-Z]{2,2}$"
///    },
///    "CountrySubDivision": {
///      "description": "The subdivision of the country, for example, state, region or county.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "maxLength": 35,
///        "minLength": 1
///      },
///      "maxItems": 2,
///      "minItems": 0
///    },
///    "PostCode": {
///      "description": "The post code of the delivery address.",
///      "type": "string",
///      "maxLength": 16,
///      "minLength": 1
///    },
///    "StreetName": {
///      "description": "The name of the street.",
///      "type": "string",
///      "maxLength": 70,
///      "minLength": 1
///    },
///    "TownName": {
///      "description": "The name of the town.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObRisk1DeliveryAddress {
    ///The information that locates and identifies the delivery address, as defined by postal services, that is presented in free format text.
    #[serde(
        rename = "AddressLine",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub address_line: ::std::vec::Vec<ObRisk1DeliveryAddressAddressLineItem>,
    ///The number of the building.
    #[serde(
        rename = "BuildingNumber",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub building_number: ::std::option::Option<ObRisk1DeliveryAddressBuildingNumber>,
    ///The name of the country.
    #[serde(rename = "Country")]
    pub country: ObRisk1DeliveryAddressCountry,
    ///The subdivision of the country, for example, state, region or county.
    #[serde(
        rename = "CountrySubDivision",
        default,
        skip_serializing_if = "::std::vec::Vec::is_empty"
    )]
    pub country_sub_division: ::std::vec::Vec<ObRisk1DeliveryAddressCountrySubDivisionItem>,
    ///The post code of the delivery address.
    #[serde(
        rename = "PostCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub post_code: ::std::option::Option<ObRisk1DeliveryAddressPostCode>,
    ///The name of the street.
    #[serde(
        rename = "StreetName",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub street_name: ::std::option::Option<ObRisk1DeliveryAddressStreetName>,
    ///The name of the town.
    #[serde(rename = "TownName")]
    pub town_name: ObRisk1DeliveryAddressTownName,
}
///`ObRisk1DeliveryAddressAddressLineItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressAddressLineItem(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressAddressLineItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressAddressLineItem> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressAddressLineItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressAddressLineItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressAddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressAddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressAddressLineItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressAddressLineItem {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The number of the building.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The number of the building.",
///  "type": "string",
///  "maxLength": 16,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressBuildingNumber(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressBuildingNumber {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressBuildingNumber> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressBuildingNumber) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressBuildingNumber {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 16usize {
            return Err("longer than 16 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressBuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressBuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressBuildingNumber {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressBuildingNumber {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the country.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the country.",
///  "type": "string",
///  "pattern": "^[A-Z]{2,2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressCountry(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressCountry {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressCountry> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressCountry) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressCountry {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{2,2}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2,2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressCountry {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressCountry {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressCountry {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressCountry {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObRisk1DeliveryAddressCountrySubDivisionItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressCountrySubDivisionItem(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressCountrySubDivisionItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressCountrySubDivisionItem> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressCountrySubDivisionItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressCountrySubDivisionItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressCountrySubDivisionItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObRisk1DeliveryAddressCountrySubDivisionItem
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObRisk1DeliveryAddressCountrySubDivisionItem
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressCountrySubDivisionItem {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The post code of the delivery address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The post code of the delivery address.",
///  "type": "string",
///  "maxLength": 16,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressPostCode(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressPostCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressPostCode> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressPostCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressPostCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 16usize {
            return Err("longer than 16 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressPostCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressPostCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressPostCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressPostCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the street.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the street.",
///  "type": "string",
///  "maxLength": 70,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressStreetName(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressStreetName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressStreetName> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressStreetName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressStreetName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 70usize {
            return Err("longer than 70 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressStreetName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressStreetName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressStreetName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressStreetName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The name of the town.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the town.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObRisk1DeliveryAddressTownName(::std::string::String);
impl ::std::ops::Deref for ObRisk1DeliveryAddressTownName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObRisk1DeliveryAddressTownName> for ::std::string::String {
    fn from(value: ObRisk1DeliveryAddressTownName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObRisk1DeliveryAddressTownName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObRisk1DeliveryAddressTownName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObRisk1DeliveryAddressTownName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObRisk1DeliveryAddressTownName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObRisk1DeliveryAddressTownName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The Risk section contains the risk indicators that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which can be used to specify additional details for risk scoring for account information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Risk section contains the risk indicators that the initiating party sends to the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary), which can be used to specify additional details for risk scoring for account information.",
///  "type": "object"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ObRisk2(pub ::serde_json::Map<::std::string::String, ::serde_json::Value>);
impl ::std::ops::Deref for ObRisk2 {
    type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
    fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
        &self.0
    }
}
impl ::std::convert::From<ObRisk2>
    for ::serde_json::Map<::std::string::String, ::serde_json::Value>
{
    fn from(value: ObRisk2) -> Self {
        value.0
    }
}
impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
    for ObRisk2
{
    fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
        Self(value)
    }
}
///A list of standing orders.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of standing orders.",
///  "type": "object",
///  "required": [
///    "AccountId",
///    "Frequency"
///  ],
///  "properties": {
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccount5"
///    },
///    "FirstPaymentAmount": {
///      "description": "The amount of the first standing order payment.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "FirstPaymentDateTime": {
///      "description": "The date the first payment for a standing order schedule is made.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Frequency": {
///      "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "NextPaymentAmount": {
///      "description": "The amount of the next standing order payment.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///          "type": "string",
///          "pattern": "^[A-Z]{3,3}$"
///        }
///      }
///    },
///    "Reference": {
///      "description": "The unique reference that the creditor assigns to refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "StandingOrderId": {
///      "description": "The unique and immutable ID to identify the standing order resource.\nThis ID has no meaning to the account owner.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "StandingOrderStatusCode": {
///      "$ref": "#/components/schemas/OBExternalStandingOrderStatus1Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObStandingOrder4 {
    #[serde(rename = "AccountId")]
    pub account_id: AccountId,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccount5>,
    #[serde(
        rename = "FirstPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub first_payment_amount: ::std::option::Option<ObStandingOrder4FirstPaymentAmount>,
    /// The date the first payment for a standing order schedule is made.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(
        rename = "FirstPaymentDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub first_payment_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// The frequency of the standing order:
    /// - `EvryDay`: Every day
    /// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
    /// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
    ///
    /// Example values:
    /// - `EvryDay`
    /// - `IntrvlWkDay:01:0[1-7]`
    /// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
    #[serde(rename = "Frequency")]
    pub frequency: ObStandingOrder4Frequency,
    #[serde(
        rename = "NextPaymentAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub next_payment_amount: ::std::option::Option<ObStandingOrder4NextPaymentAmount>,
    /// The unique reference that the creditor assigns to refer to the payment transaction.
    ///
    /// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
    ///
    /// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
    #[serde(
        rename = "Reference",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub reference: ::std::option::Option<ObStandingOrder4Reference>,
    /// The unique and immutable ID to identify the standing order resource.
    /// This ID has no meaning to the account owner.
    #[serde(
        rename = "StandingOrderId",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub standing_order_id: ::std::option::Option<ObStandingOrder4StandingOrderId>,
    #[serde(
        rename = "StandingOrderStatusCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub standing_order_status_code: ::std::option::Option<ObExternalStandingOrderStatus1Code>,
}
///The amount of the first standing order payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the first standing order payment.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObStandingOrder4FirstPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObStandingOrder4FirstPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObStandingOrder4FirstPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObStandingOrder4FirstPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObStandingOrder4FirstPaymentAmountCurrency> for ::std::string::String {
    fn from(value: ObStandingOrder4FirstPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObStandingOrder4FirstPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObStandingOrder4FirstPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObStandingOrder4FirstPaymentAmountCurrency
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObStandingOrder4FirstPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObStandingOrder4FirstPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The frequency of the standing order:
/// - `EvryDay`: Every day
/// - `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)
/// - `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)
///
/// Example values:
/// - `EvryDay`
/// - `IntrvlWkDay:01:0[1-7]`
/// - `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The frequency of the standing order:\n- `EvryDay`: Every day\n- `IntrvlWkDay`: Only one week interval is supported (01) and any day within the week (01 to 07)\n- `IntrvlMnthDay`: Only one month interval is supported (01) and any day within the month (1 to 31)\n\nExample values:\n- `EvryDay`\n- `IntrvlWkDay:01:0[1-7]`\n- `IntrvlMnthDay:01:(0[1-9]|[12][0-9]|3[01])`",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObStandingOrder4Frequency(::std::string::String);
impl ::std::ops::Deref for ObStandingOrder4Frequency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObStandingOrder4Frequency> for ::std::string::String {
    fn from(value: ObStandingOrder4Frequency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObStandingOrder4Frequency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObStandingOrder4Frequency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObStandingOrder4Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObStandingOrder4Frequency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObStandingOrder4Frequency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The amount of the next standing order payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the next standing order payment.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///      "type": "string",
///      "pattern": "^[A-Z]{3,3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObStandingOrder4NextPaymentAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    ///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    #[serde(rename = "Currency")]
    pub currency: ObStandingOrder4NextPaymentAmountCurrency,
}
///[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.",
///  "type": "string",
///  "pattern": "^[A-Z]{3,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObStandingOrder4NextPaymentAmountCurrency(::std::string::String);
impl ::std::ops::Deref for ObStandingOrder4NextPaymentAmountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObStandingOrder4NextPaymentAmountCurrency> for ::std::string::String {
    fn from(value: ObStandingOrder4NextPaymentAmountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObStandingOrder4NextPaymentAmountCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Z]{3,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{3,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObStandingOrder4NextPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObStandingOrder4NextPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObStandingOrder4NextPaymentAmountCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObStandingOrder4NextPaymentAmountCurrency {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique reference that the creditor assigns to refer to the payment transaction.
///
/// If available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.
///
/// If the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique reference that the creditor assigns to refer to the payment transaction.\n\nIf available, the initiating party should provide this reference in the structured remittance information to enable reconciliation by the creditor upon receipt of the amount of money.\n\nIf the business context requires the use of a creditor reference or a payment remit identification, and only one identifier can be passed through the end-to-end chain, the creditor's reference or payment remittance identification should be quoted in the end-to-end transaction identification.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObStandingOrder4Reference(::std::string::String);
impl ::std::ops::Deref for ObStandingOrder4Reference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObStandingOrder4Reference> for ::std::string::String {
    fn from(value: ObStandingOrder4Reference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObStandingOrder4Reference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObStandingOrder4Reference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObStandingOrder4Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObStandingOrder4Reference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObStandingOrder4Reference {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The unique and immutable ID to identify the standing order resource.
/// This ID has no meaning to the account owner.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID to identify the standing order resource.\nThis ID has no meaning to the account owner.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObStandingOrder4StandingOrderId(::std::string::String);
impl ::std::ops::Deref for ObStandingOrder4StandingOrderId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObStandingOrder4StandingOrderId> for ::std::string::String {
    fn from(value: ObStandingOrder4StandingOrderId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObStandingOrder4StandingOrderId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObStandingOrder4StandingOrderId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObStandingOrder4StandingOrderId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObStandingOrder4StandingOrderId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObStandingOrder4StandingOrderId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The additional information that cannot be captured in the structured fields and/or any other specific block.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The additional information that cannot be captured in the structured fields and/or any other specific block.",
///  "type": "object",
///  "maxLength": 40,
///  "minLength": 1,
///  "additionalProperties": {
///    "description": "The additional information that cannot be captured in the structured fields and/or any other specific block.\n\n**`< * >`** acts as a placeholder here, and it represents an optional property (or multiple such properties) with an arbitrary name and data.\n\nTo see an example, check the response body samples.",
///    "type": "string"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ObSupplementaryData1(
    pub ::std::collections::HashMap<::std::string::String, ::std::string::String>,
);
impl ::std::ops::Deref for ObSupplementaryData1 {
    type Target = ::std::collections::HashMap<::std::string::String, ::std::string::String>;
    fn deref(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
        &self.0
    }
}
impl ::std::convert::From<ObSupplementaryData1>
    for ::std::collections::HashMap<::std::string::String, ::std::string::String>
{
    fn from(value: ObSupplementaryData1) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, ::std::string::String>>
    for ObSupplementaryData1
{
    fn from(
        value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
    ) -> Self {
        Self(value)
    }
}
///The details of the transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "",
///  "description": "The details of the transaction.",
///  "type": "object",
///  "required": [
///    "AccountId",
///    "Amount",
///    "BookingDateTime",
///    "CreditDebitIndicator",
///    "Status"
///  ],
///  "properties": {
///    "AccountId": {
///      "$ref": "#/components/schemas/AccountId"
///    },
///    "Amount": {
///      "description": "Amount of money in the cash transaction entry. This amount includes the amount in `ChargeAmount`.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "Balance": {
///      "$ref": "#/components/schemas/OBTransactionCashBalance"
///    },
///    "BookingDateTime": {
///      "description": "The date and time when the transaction entry is created in Revolut's systems.\nRepresented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format including timezone.            \n\n:::note[Offline transactions]\nFor offline transactions, this value reflects when the transaction is recorded by Revolut, not when the transaction was originally initiated.\nThe original transaction date is available in `SupplementaryData.StartedDate`.\n:::",
///      "type": "string",
///      "format": "date-time"
///    },
///    "CardInstrument": {
///      "description": "The set of elements to describe the card instrument used in the transaction.",
///      "type": "object",
///      "required": [
///        "CardSchemeName"
///      ],
///      "properties": {
///        "CardSchemeName": {
///          "description": "The brand of the payment card. Possible values include `VISA`, `MASTERCARD`, and `MAESTRO`.",
///          "type": "string"
///        },
///        "Identification": {
///          "description": "The last four digits of the card's PAN (Primary Account Number).",
///          "type": "string"
///        },
///        "Name": {
///          "description": "The name of the cardholder.",
///          "type": "string"
///        }
///      }
///    },
///    "ChargeAmount": {
///      "description": "Transaction charges to be paid by the charge bearer.",
///      "type": "object",
///      "required": [
///        "Amount",
///        "Currency"
///      ],
///      "properties": {
///        "Amount": {
///          "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///        },
///        "Currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "CreditDebitIndicator": {
///      "description": "Indicates whether the transaction is a credit or a debit entry.",
///      "type": "string",
///      "enum": [
///        "Credit",
///        "Debit"
///      ]
///    },
///    "CreditorAccount": {
///      "$ref": "#/components/schemas/OBCashAccount6"
///    },
///    "CurrencyExchange": {
///      "$ref": "#/components/schemas/OBCurrencyExchange5"
///    },
///    "DebtorAccount": {
///      "$ref": "#/components/schemas/OBCashAccount6"
///    },
///    "MerchantDetails": {
///      "$ref": "#/components/schemas/OBMerchantDetails1"
///    },
///    "ProprietaryBankTransactionCode": {
///      "description": "A list of elements to fully identify a proprietary bank transaction code.",
///      "type": "object",
///      "required": [
///        "Code"
///      ],
///      "properties": {
///        "Code": {
///          "description": "The proprietary bank transaction code to identify the underlying transaction.",
///          "type": "string",
///          "maxLength": 35,
///          "minLength": 1
///        },
///        "Issuer": {
///          "description": "The identification of the issuer of the proprietary bank transaction code.",
///          "type": "string",
///          "maxLength": 35,
///          "minLength": 1
///        }
///      }
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBEntryStatus1Code"
///    },
///    "SupplementaryData": {
///      "description": "Additional information that cannot be captured in the structured fields and/or any other specific block.",
///      "allOf": [
///        {
///          "$ref": "#/components/schemas/OBSupplementaryData1"
///        },
///        {
///          "type": "object",
///          "properties": {
///            "StartedDate": {
///              "description": "The date and time the transaction started in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nReturned if it is different from `BookingDateTime`.\n\nFor example, if the transaction was an offline card transaction made during a flight and would be booked at a later time or date, this field indicates the actual date and time the transaction took place, as provided by the merchant.",
///              "readOnly": true,
///              "type": "string",
///              "format": "date-time"
///            }
///          }
///        }
///      ]
///    },
///    "TransactionId": {
///      "description": "The unique and immutable ID to identify the transaction within an servicing institution.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "TransactionInformation": {
///      "$ref": "#/components/schemas/TransactionInformation"
///    },
///    "ValueDateTime": {
///      "description": "The date and time when the transaction is completed.\nReturned only for transactions with `Status=Booked`.\n\nRepresented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format including timezone.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4 {
    #[serde(rename = "AccountId")]
    pub account_id: AccountId,
    #[serde(rename = "Amount")]
    pub amount: ObTransaction4Amount,
    #[serde(
        rename = "Balance",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub balance: ::std::option::Option<ObTransactionCashBalance>,
    /// The date and time when the transaction entry is created in Revolut's systems.
    /// Represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format including timezone.
    ///
    /// :::note[Offline transactions]
    /// For offline transactions, this value reflects when the transaction is recorded by Revolut, not when the transaction was originally initiated.
    /// The original transaction date is available in `SupplementaryData.StartedDate`.
    /// :::
    #[serde(rename = "BookingDateTime")]
    pub booking_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(
        rename = "CardInstrument",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub card_instrument: ::std::option::Option<ObTransaction4CardInstrument>,
    #[serde(
        rename = "ChargeAmount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub charge_amount: ::std::option::Option<ObTransaction4ChargeAmount>,
    ///Indicates whether the transaction is a credit or a debit entry.
    #[serde(rename = "CreditDebitIndicator")]
    pub credit_debit_indicator: ObTransaction4CreditDebitIndicator,
    #[serde(
        rename = "CreditorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub creditor_account: ::std::option::Option<ObCashAccount6>,
    #[serde(
        rename = "CurrencyExchange",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub currency_exchange: ::std::option::Option<ObCurrencyExchange5>,
    #[serde(
        rename = "DebtorAccount",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub debtor_account: ::std::option::Option<ObCashAccount6>,
    #[serde(
        rename = "MerchantDetails",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub merchant_details: ::std::option::Option<ObMerchantDetails1>,
    #[serde(
        rename = "ProprietaryBankTransactionCode",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub proprietary_bank_transaction_code:
        ::std::option::Option<ObTransaction4ProprietaryBankTransactionCode>,
    #[serde(rename = "Status")]
    pub status: ObEntryStatus1Code,
    #[serde(
        rename = "SupplementaryData",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub supplementary_data: ::std::option::Option<ObTransaction4SupplementaryData>,
    ///The unique and immutable ID to identify the transaction within an servicing institution.
    #[serde(
        rename = "TransactionId",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_id: ::std::option::Option<ObTransaction4TransactionId>,
    #[serde(
        rename = "TransactionInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub transaction_information: ::std::option::Option<TransactionInformation>,
    /// The date and time when the transaction is completed.
    /// Returned only for transactions with `Status=Booked`.
    ///
    /// Represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format including timezone.
    #[serde(
        rename = "ValueDateTime",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub value_date_time: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///Amount of money in the cash transaction entry. This amount includes the amount in `ChargeAmount`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Amount of money in the cash transaction entry. This amount includes the amount in `ChargeAmount`.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4Amount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: Currency,
}
///The set of elements to describe the card instrument used in the transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The set of elements to describe the card instrument used in the transaction.",
///  "type": "object",
///  "required": [
///    "CardSchemeName"
///  ],
///  "properties": {
///    "CardSchemeName": {
///      "description": "The brand of the payment card. Possible values include `VISA`, `MASTERCARD`, and `MAESTRO`.",
///      "type": "string"
///    },
///    "Identification": {
///      "description": "The last four digits of the card's PAN (Primary Account Number).",
///      "type": "string"
///    },
///    "Name": {
///      "description": "The name of the cardholder.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4CardInstrument {
    ///The brand of the payment card. Possible values include `VISA`, `MASTERCARD`, and `MAESTRO`.
    #[serde(rename = "CardSchemeName")]
    pub card_scheme_name: ::std::string::String,
    ///The last four digits of the card's PAN (Primary Account Number).
    #[serde(
        rename = "Identification",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub identification: ::std::option::Option<::std::string::String>,
    ///The name of the cardholder.
    #[serde(
        rename = "Name",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub name: ::std::option::Option<::std::string::String>,
}
///Transaction charges to be paid by the charge bearer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Transaction charges to be paid by the charge bearer.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "Currency"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveCurrencyAndAmount_SimpleType"
///    },
///    "Currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4ChargeAmount {
    #[serde(rename = "Amount")]
    pub amount: ObActiveCurrencyAndAmountSimpleType,
    #[serde(rename = "Currency")]
    pub currency: Currency,
}
///Indicates whether the transaction is a credit or a debit entry.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the transaction is a credit or a debit entry.",
///  "type": "string",
///  "enum": [
///    "Credit",
///    "Debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObTransaction4CreditDebitIndicator {
    Credit,
    Debit,
}
impl ::std::fmt::Display for ObTransaction4CreditDebitIndicator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("Credit"),
            Self::Debit => f.write_str("Debit"),
        }
    }
}
impl ::std::str::FromStr for ObTransaction4CreditDebitIndicator {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Credit" => Ok(Self::Credit),
            "Debit" => Ok(Self::Debit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObTransaction4CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObTransaction4CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObTransaction4CreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A list of elements to fully identify a proprietary bank transaction code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of elements to fully identify a proprietary bank transaction code.",
///  "type": "object",
///  "required": [
///    "Code"
///  ],
///  "properties": {
///    "Code": {
///      "description": "The proprietary bank transaction code to identify the underlying transaction.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    },
///    "Issuer": {
///      "description": "The identification of the issuer of the proprietary bank transaction code.",
///      "type": "string",
///      "maxLength": 35,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4ProprietaryBankTransactionCode {
    ///The proprietary bank transaction code to identify the underlying transaction.
    #[serde(rename = "Code")]
    pub code: ObTransaction4ProprietaryBankTransactionCodeCode,
    ///The identification of the issuer of the proprietary bank transaction code.
    #[serde(
        rename = "Issuer",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub issuer: ::std::option::Option<ObTransaction4ProprietaryBankTransactionCodeIssuer>,
}
///The proprietary bank transaction code to identify the underlying transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The proprietary bank transaction code to identify the underlying transaction.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObTransaction4ProprietaryBankTransactionCodeCode(::std::string::String);
impl ::std::ops::Deref for ObTransaction4ProprietaryBankTransactionCodeCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObTransaction4ProprietaryBankTransactionCodeCode>
    for ::std::string::String
{
    fn from(value: ObTransaction4ProprietaryBankTransactionCodeCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObTransaction4ProprietaryBankTransactionCodeCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObTransaction4ProprietaryBankTransactionCodeCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObTransaction4ProprietaryBankTransactionCodeCode
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObTransaction4ProprietaryBankTransactionCodeCode
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObTransaction4ProprietaryBankTransactionCodeCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The identification of the issuer of the proprietary bank transaction code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The identification of the issuer of the proprietary bank transaction code.",
///  "type": "string",
///  "maxLength": 35,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObTransaction4ProprietaryBankTransactionCodeIssuer(::std::string::String);
impl ::std::ops::Deref for ObTransaction4ProprietaryBankTransactionCodeIssuer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObTransaction4ProprietaryBankTransactionCodeIssuer>
    for ::std::string::String
{
    fn from(value: ObTransaction4ProprietaryBankTransactionCodeIssuer) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObTransaction4ProprietaryBankTransactionCodeIssuer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 35usize {
            return Err("longer than 35 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObTransaction4ProprietaryBankTransactionCodeIssuer {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObTransaction4ProprietaryBankTransactionCodeIssuer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObTransaction4ProprietaryBankTransactionCodeIssuer
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObTransaction4ProprietaryBankTransactionCodeIssuer {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Additional information that cannot be captured in the structured fields and/or any other specific block.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional information that cannot be captured in the structured fields and/or any other specific block.",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/OBSupplementaryData1"
///    },
///    {
///      "type": "object",
///      "properties": {
///        "StartedDate": {
///          "description": "The date and time the transaction started in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nReturned if it is different from `BookingDateTime`.\n\nFor example, if the transaction was an offline card transaction made during a flight and would be booked at a later time or date, this field indicates the actual date and time the transaction took place, as provided by the merchant.",
///          "readOnly": true,
///          "type": "string",
///          "format": "date-time"
///        }
///      }
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransaction4SupplementaryData {
    #[serde(
        rename = "StartedDate",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub started_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(flatten)]
    pub extra: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
}
///The unique and immutable ID to identify the transaction within an servicing institution.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique and immutable ID to identify the transaction within an servicing institution.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObTransaction4TransactionId(::std::string::String);
impl ::std::ops::Deref for ObTransaction4TransactionId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObTransaction4TransactionId> for ::std::string::String {
    fn from(value: ObTransaction4TransactionId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObTransaction4TransactionId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObTransaction4TransactionId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObTransaction4TransactionId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObTransaction4TransactionId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObTransaction4TransactionId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///A list of elements used to define the balance as a numerical representation of the net increases and decreases in an account after a transaction entry is applied to the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of elements used to define the balance as a numerical representation of the net increases and decreases in an account after a transaction entry is applied to the account.",
///  "type": "object",
///  "required": [
///    "Amount",
///    "CreditDebitIndicator",
///    "Type"
///  ],
///  "properties": {
///    "Amount": {
///      "$ref": "#/components/schemas/OBActiveOrHistoricCurrencyAndAmount"
///    },
///    "CreditDebitIndicator": {
///      "description": "Indicates whether the balance is a credit or a debit balance.\n\n:::note\nA zero balance is considered a credit balance.\n:::",
///      "type": "string",
///      "enum": [
///        "Credit",
///        "Debit"
///      ]
///    },
///    "Type": {
///      "$ref": "#/components/schemas/OBBalanceType1Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObTransactionCashBalance {
    #[serde(rename = "Amount")]
    pub amount: ObActiveOrHistoricCurrencyAndAmount,
    /// Indicates whether the balance is a credit or a debit balance.
    ///
    /// :::note
    /// A zero balance is considered a credit balance.
    /// :::
    #[serde(rename = "CreditDebitIndicator")]
    pub credit_debit_indicator: ObTransactionCashBalanceCreditDebitIndicator,
    #[serde(rename = "Type")]
    pub type_: ObBalanceType1Code,
}
/// Indicates whether the balance is a credit or a debit balance.
///
/// :::note
/// A zero balance is considered a credit balance.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the balance is a credit or a debit balance.\n\n:::note\nA zero balance is considered a credit balance.\n:::",
///  "type": "string",
///  "enum": [
///    "Credit",
///    "Debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObTransactionCashBalanceCreditDebitIndicator {
    Credit,
    Debit,
}
impl ::std::fmt::Display for ObTransactionCashBalanceCreditDebitIndicator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("Credit"),
            Self::Debit => f.write_str("Debit"),
        }
    }
}
impl ::std::str::FromStr for ObTransactionCashBalanceCreditDebitIndicator {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Credit" => Ok(Self::Credit),
            "Debit" => Ok(Self::Debit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObTransactionCashBalanceCreditDebitIndicator {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObTransactionCashBalanceCreditDebitIndicator
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObTransactionCashBalanceCreditDebitIndicator
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The status of the payment information group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the payment information group.",
///  "type": "string",
///  "enum": [
///    "AcceptedSettlementCompleted",
///    "AcceptedSettlementInProcess",
///    "Pending",
///    "Rejected"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ObTransactionIndividualStatus1Code {
    AcceptedSettlementCompleted,
    AcceptedSettlementInProcess,
    Pending,
    Rejected,
}
impl ::std::fmt::Display for ObTransactionIndividualStatus1Code {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::AcceptedSettlementCompleted => f.write_str("AcceptedSettlementCompleted"),
            Self::AcceptedSettlementInProcess => f.write_str("AcceptedSettlementInProcess"),
            Self::Pending => f.write_str("Pending"),
            Self::Rejected => f.write_str("Rejected"),
        }
    }
}
impl ::std::str::FromStr for ObTransactionIndividualStatus1Code {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "AcceptedSettlementCompleted" => Ok(Self::AcceptedSettlementCompleted),
            "AcceptedSettlementInProcess" => Ok(Self::AcceptedSettlementInProcess),
            "Pending" => Ok(Self::Pending),
            "Rejected" => Ok(Self::Rejected),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ObTransactionIndividualStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObTransactionIndividualStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObTransactionIndividualStatus1Code {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ObWriteDataDomestic2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomestic2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomestic2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomestic2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomestic2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomestic2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomestic2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomestic2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataDomestic2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomestic2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomestic2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataDomestic2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataDomestic2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomestic2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomestic2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObDomestic2,
}
///`ObWriteDataDomesticConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomestic2"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomestic2,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticConsentResponse2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataDomesticConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "DomesticPaymentId",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the message was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "DomesticPaymentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to uniquely identify the domestic payment resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticInitiationResponse"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBTransactionIndividualStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticResponse2ConsentId,
    /// The date and time when the message was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to uniquely identify the domestic payment resource.
    #[serde(rename = "DomesticPaymentId")]
    pub domestic_payment_id: ObWriteDataDomesticResponse2DomesticPaymentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticInitiationResponse,
    #[serde(rename = "Status")]
    pub status: ObTransactionIndividualStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticResponse2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataDomesticResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataDomesticResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataDomesticResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to uniquely identify the domestic payment resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to uniquely identify the domestic payment resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticResponse2DomesticPaymentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticResponse2DomesticPaymentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticResponse2DomesticPaymentId> for ::std::string::String {
    fn from(value: ObWriteDataDomesticResponse2DomesticPaymentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticResponse2DomesticPaymentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticResponse2DomesticPaymentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticResponse2DomesticPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticResponse2DomesticPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticResponse2DomesticPaymentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticScheduled2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticScheduled2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticScheduled2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticScheduled2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticScheduled2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticScheduled2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticScheduled2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticScheduled2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataDomesticScheduled2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticScheduled2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticScheduled2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataDomesticScheduled2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataDomesticScheduled2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticScheduled2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticScheduledConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation",
///    "Permission"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticScheduled2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticScheduledConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticScheduled2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
}
///`ObWriteDataDomesticScheduledConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Permission",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticScheduled2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the consent resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticScheduledConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticScheduledConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticScheduled2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the consent resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticScheduledConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticScheduledConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticScheduledConsentResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticScheduledConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticScheduledConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticScheduledConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticScheduledConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticScheduledConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticScheduledConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticScheduledResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "DomesticScheduledPaymentId",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the message was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "DomesticScheduledPaymentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic schedule payment resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticScheduledInitiationResponse"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticScheduledResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticScheduledResponse2ConsentId,
    /// The date and time when the message was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic schedule payment resource.
    #[serde(rename = "DomesticScheduledPaymentId")]
    pub domestic_scheduled_payment_id:
        ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticScheduledInitiationResponse,
    #[serde(
        rename = "Permission",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub permission: ::std::option::Option<ObExternalPermissions2Code>,
    #[serde(rename = "Status")]
    pub status: ObExternalStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticScheduledResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticScheduledResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticScheduledResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticScheduledResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticScheduledResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticScheduledResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticScheduledResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticScheduledResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticScheduledResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic schedule payment resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic schedule payment resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObWriteDataDomesticScheduledResponse2DomesticScheduledPaymentId
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticStandingOrder2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticStandingOrder2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticStandingOrder2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticStandingOrder2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticStandingOrder2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticStandingOrder2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticStandingOrder2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticStandingOrder2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataDomesticStandingOrder2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticStandingOrder2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticStandingOrder2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticStandingOrder2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataDomesticStandingOrder2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticStandingOrder2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticStandingOrderConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation",
///    "Permission"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticStandingOrder2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticStandingOrderConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticStandingOrder2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
}
///`ObWriteDataDomesticStandingOrderConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Permission",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticStandingOrder2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticStandingOrderConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticStandingOrderConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticStandingOrder2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticStandingOrderConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticStandingOrderConsentResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticStandingOrderConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticStandingOrderConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataDomesticStandingOrderResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "DomesticStandingOrderId",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "DomesticStandingOrderId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic standing order resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBDomesticStandingOrderInitiationResponse"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataDomesticStandingOrderResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataDomesticStandingOrderResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic standing order resource.
    #[serde(rename = "DomesticStandingOrderId")]
    pub domestic_standing_order_id:
        ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId,
    #[serde(rename = "Initiation")]
    pub initiation: ObDomesticStandingOrderInitiationResponse,
    #[serde(
        rename = "Permission",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub permission: ::std::option::Option<ObExternalPermissions2Code>,
    #[serde(rename = "Status")]
    pub status: ObExternalStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticStandingOrderResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticStandingOrderResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticStandingOrderResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticStandingOrderResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticStandingOrderResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataDomesticStandingOrderResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticStandingOrderResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticStandingOrderResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataDomesticStandingOrderResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic standing order resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the domestic standing order resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId>
    for ::std::string::String
{
    fn from(value: ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObWriteDataDomesticStandingOrderResponse2DomesticStandingOrderId
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataFile2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBFile2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataFile2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataFile2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObFile2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataFile2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataFile2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataFile2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataFile2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataFile2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataFile2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataFile2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataFile2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataFile2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataFileConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBFile2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataFileConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObFile2,
}
///`ObWriteDataFileConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBFile2"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus2Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the consent resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataFileConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataFileConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObFile2,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus2Code,
    /// The date and time when the consent resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataFileConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataFileConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataFileConsentResponse2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataFileConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataFileConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataFileConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataFileConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataFileConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataFileConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataFileResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "FilePaymentId",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the message was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "FilePaymentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the file payment resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBFileInitiationResponse"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the consent resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataFileResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataFileResponse2ConsentId,
    /// The date and time when the message was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the file payment resource.
    #[serde(rename = "FilePaymentId")]
    pub file_payment_id: ObWriteDataFileResponse2FilePaymentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObFileInitiationResponse,
    #[serde(rename = "Status")]
    pub status: ObExternalStatus1Code,
    /// The date and time when the consent resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataFileResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataFileResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataFileResponse2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataFileResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataFileResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataFileResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataFileResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataFileResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataFileResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the file payment resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the file payment resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataFileResponse2FilePaymentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataFileResponse2FilePaymentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataFileResponse2FilePaymentId> for ::std::string::String {
    fn from(value: ObWriteDataFileResponse2FilePaymentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataFileResponse2FilePaymentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataFileResponse2FilePaymentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataFileResponse2FilePaymentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataFileResponse2FilePaymentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataFileResponse2FilePaymentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataFundsConfirmationResponse1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "FundsAvailableResult": {
///      "$ref": "#/components/schemas/OBFundsAvailableResult1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataFundsConfirmationResponse1 {
    #[serde(
        rename = "FundsAvailableResult",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub funds_available_result: ::std::option::Option<ObFundsAvailableResult1>,
}
impl ::std::default::Default for ObWriteDataFundsConfirmationResponse1 {
    fn default() -> Self {
        Self {
            funds_available_result: Default::default(),
        }
    }
}
///`ObWriteDataInternational2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternational2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternational2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternational2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternational2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternational2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternational2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternational2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataInternational2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternational2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternational2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ObWriteDataInternational2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataInternational2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternational2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternational2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObInternational2,
}
///`ObWriteDataInternationalConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate2"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternational2"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate2>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternational2,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalConsentResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "InternationalPaymentId",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the message was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate2"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalInitiationResponse"
///    },
///    "InternationalPaymentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international payment resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBTransactionIndividualStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalResponse2ConsentId,
    /// The date and time when the message was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate2>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalInitiationResponse,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international payment resource.
    #[serde(rename = "InternationalPaymentId")]
    pub international_payment_id: ObWriteDataInternationalResponse2InternationalPaymentId,
    #[serde(rename = "Status")]
    pub status: ObTransactionIndividualStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalResponse2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataInternationalResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ObWriteDataInternationalResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international payment resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international payment resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalResponse2InternationalPaymentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalResponse2InternationalPaymentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalResponse2InternationalPaymentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalResponse2InternationalPaymentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalResponse2InternationalPaymentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalResponse2InternationalPaymentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalResponse2InternationalPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalResponse2InternationalPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalResponse2InternationalPaymentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalScheduled2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalScheduled2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalScheduled2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalScheduled2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalScheduled2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalScheduled2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalScheduled2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalScheduled2ConsentId> for ::std::string::String {
    fn from(value: ObWriteDataInternationalScheduled2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalScheduled2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalScheduled2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalScheduled2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalScheduled2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalScheduled2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalScheduledConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation",
///    "Permission"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalScheduled2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalScheduledConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalScheduled2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
}
///`ObWriteDataInternationalScheduledConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Permission",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate2"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalScheduled2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalScheduledConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalScheduledConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate2>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalScheduled2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalScheduledConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalScheduledConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalScheduledConsentResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalScheduledConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalScheduledConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalScheduledConsentResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalScheduledConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalScheduledConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalScheduledConsentResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalScheduledResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "InternationalScheduledPaymentId",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the message was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "ExchangeRateInformation": {
///      "$ref": "#/components/schemas/OBExchangeRate2"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalScheduledInitiationResponse"
///    },
///    "InternationalScheduledPaymentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international scheduled payment resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalScheduledResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalScheduledResponse2ConsentId,
    /// The date and time when the message was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(
        rename = "ExchangeRateInformation",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub exchange_rate_information: ::std::option::Option<ObExchangeRate2>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalScheduledInitiationResponse,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international scheduled payment resource.
    #[serde(rename = "InternationalScheduledPaymentId")]
    pub international_scheduled_payment_id:
        ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId,
    #[serde(
        rename = "Permission",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub permission: ::std::option::Option<ObExternalPermissions2Code>,
    #[serde(rename = "Status")]
    pub status: ObExternalStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalScheduledResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalScheduledResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalScheduledResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalScheduledResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalScheduledResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalScheduledResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalScheduledResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalScheduledResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalScheduledResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international scheduled payment resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international scheduled payment resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId(
    ::std::string::String,
);
impl ::std::ops::Deref
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId>
    for ::std::string::String
{
    fn from(
        value: ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId,
    ) -> Self {
        value.0
    }
}
impl ::std::str::FromStr
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObWriteDataInternationalScheduledResponse2InternationalScheduledPaymentId
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalStandingOrder2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "Initiation"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalStandingOrder2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalStandingOrder2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalStandingOrder2ConsentId,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalStandingOrder2,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalStandingOrder2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalStandingOrder2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalStandingOrder2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalStandingOrder2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalStandingOrder2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalStandingOrder2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalStandingOrder2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalStandingOrder2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalStandingOrder2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalStandingOrderConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Initiation",
///    "Permission"
///  ],
///  "properties": {
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalStandingOrder2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalStandingOrderConsent2 {
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalStandingOrder2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
}
///`ObWriteDataInternationalStandingOrderConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "Permission",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalStandingOrder2"
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalConsentStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalStandingOrderConsentResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalStandingOrderConsentResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalStandingOrder2,
    #[serde(rename = "Permission")]
    pub permission: ObExternalPermissions2Code,
    #[serde(rename = "Status")]
    pub status: ObExternalConsentStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalStandingOrderConsentResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalStandingOrderConsentResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalStandingOrderConsentResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObWriteDataInternationalStandingOrderConsentResponse2ConsentId
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDataInternationalStandingOrderResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "ConsentId",
///    "CreationDateTime",
///    "Initiation",
///    "InternationalStandingOrderId",
///    "Status",
///    "StatusUpdateDateTime"
///  ],
///  "properties": {
///    "ConsentId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1
///    },
///    "CreationDateTime": {
///      "description": "The date and time when the resource was created.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "Initiation": {
///      "$ref": "#/components/schemas/OBInternationalStandingOrderInitiationResponse"
///    },
///    "InternationalStandingOrderId": {
///      "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international standing order resource.",
///      "type": "string",
///      "maxLength": 40,
///      "minLength": 1
///    },
///    "Permission": {
///      "$ref": "#/components/schemas/OBExternalPermissions2Code"
///    },
///    "Status": {
///      "$ref": "#/components/schemas/OBExternalStatus1Code"
///    },
///    "StatusUpdateDateTime": {
///      "description": "The date and time when the resource status was updated.\n\nAll dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.\nAll date-time fields in responses must include the timezone.\n\nFor example: `2017-04-05T10:43:07+00:00`.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDataInternationalStandingOrderResponse2 {
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
    #[serde(rename = "ConsentId")]
    pub consent_id: ObWriteDataInternationalStandingOrderResponse2ConsentId,
    /// The date and time when the resource was created.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "CreationDateTime")]
    pub creation_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(rename = "Initiation")]
    pub initiation: ObInternationalStandingOrderInitiationResponse,
    ///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international standing order resource.
    #[serde(rename = "InternationalStandingOrderId")]
    pub international_standing_order_id:
        ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId,
    #[serde(
        rename = "Permission",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub permission: ::std::option::Option<ObExternalPermissions2Code>,
    #[serde(rename = "Status")]
    pub status: ObExternalStatus1Code,
    /// The date and time when the resource status was updated.
    ///
    /// All dates in the JSON payloads are represented in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time format.
    /// All date-time fields in responses must include the timezone.
    ///
    /// For example: `2017-04-05T10:43:07+00:00`.
    #[serde(rename = "StatusUpdateDateTime")]
    pub status_update_date_time: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the consent resource.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalStandingOrderResponse2ConsentId(::std::string::String);
impl ::std::ops::Deref for ObWriteDataInternationalStandingOrderResponse2ConsentId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ObWriteDataInternationalStandingOrderResponse2ConsentId>
    for ::std::string::String
{
    fn from(value: ObWriteDataInternationalStandingOrderResponse2ConsentId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ObWriteDataInternationalStandingOrderResponse2ConsentId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ObWriteDataInternationalStandingOrderResponse2ConsentId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalStandingOrderResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalStandingOrderResponse2ConsentId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ObWriteDataInternationalStandingOrderResponse2ConsentId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international standing order resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID that the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) assigns to identify the international standing order resource.",
///  "type": "string",
///  "maxLength": 40,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId(
    ::std::string::String,
);
impl ::std::ops::Deref
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl
    ::std::convert::From<ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId>
    for ::std::string::String
{
    fn from(
        value: ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId,
    ) -> Self {
        value.0
    }
}
impl ::std::str::FromStr
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 40usize {
            return Err("longer than 40 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str>
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de>
    for ObWriteDataInternationalStandingOrderResponse2InternationalStandingOrderId
{
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`ObWriteDomestic2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomestic2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomestic2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomestic2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteDomesticScheduled2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticScheduled2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticScheduled2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticScheduled2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticScheduledConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticScheduledConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticScheduledConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticScheduledConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticScheduledConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticScheduledConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticScheduledConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticScheduledConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticScheduledResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticScheduledResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticScheduledResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticScheduledResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteDomesticStandingOrder2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticStandingOrder2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticStandingOrder2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticStandingOrder2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticStandingOrderConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticStandingOrderConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticStandingOrderConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticStandingOrderConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticStandingOrderConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticStandingOrderConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticStandingOrderConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticStandingOrderConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteDomesticStandingOrderResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataDomesticStandingOrderResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteDomesticStandingOrderResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataDomesticStandingOrderResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteFile2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataFile2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteFile2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataFile2,
}
///`ObWriteFileConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataFileConsent2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteFileConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataFileConsent2,
}
///`ObWriteFileConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataFileConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteFileConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataFileConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteFileResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataFileResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteFileResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataFileResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteFundsConfirmationResponse1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataFundsConfirmationResponse1"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteFundsConfirmationResponse1 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataFundsConfirmationResponse1,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteInternational2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternational2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternational2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternational2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteInternationalScheduled2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalScheduled2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalScheduled2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalScheduled2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalScheduledConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalScheduledConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalScheduledConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalScheduledConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalScheduledConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalScheduledConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalScheduledConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalScheduledConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalScheduledResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalScheduledResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalScheduledResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalScheduledResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///`ObWriteInternationalStandingOrder2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalStandingOrder2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalStandingOrder2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalStandingOrder2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalStandingOrderConsent2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalStandingOrderConsent2"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalStandingOrderConsent2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalStandingOrderConsent2,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalStandingOrderConsentResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta",
///    "Risk"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalStandingOrderConsentResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    },
///    "Risk": {
///      "$ref": "#/components/schemas/OBRisk1"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalStandingOrderConsentResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalStandingOrderConsentResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
    #[serde(rename = "Risk")]
    pub risk: ObRisk1,
}
///`ObWriteInternationalStandingOrderResponse2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "Data",
///    "Links",
///    "Meta"
///  ],
///  "properties": {
///    "Data": {
///      "$ref": "#/components/schemas/OBWriteDataInternationalStandingOrderResponse2"
///    },
///    "Links": {
///      "$ref": "#/components/schemas/Links"
///    },
///    "Meta": {
///      "$ref": "#/components/schemas/Meta"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ObWriteInternationalStandingOrderResponse2 {
    #[serde(rename = "Data")]
    pub data: ObWriteDataInternationalStandingOrderResponse2,
    #[serde(rename = "Links")]
    pub links: Links,
    #[serde(rename = "Meta")]
    pub meta: Meta,
}
///The status of the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the payment.",
///  "type": "string",
///  "enum": [
///    "Created",
///    "Pending",
///    "Completed",
///    "Failed",
///    "Deleted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentStatus {
    Created,
    Pending,
    Completed,
    Failed,
    Deleted,
}
impl ::std::fmt::Display for PaymentStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("Created"),
            Self::Pending => f.write_str("Pending"),
            Self::Completed => f.write_str("Completed"),
            Self::Failed => f.write_str("Failed"),
            Self::Deleted => f.write_str("Deleted"),
        }
    }
}
impl ::std::str::FromStr for PaymentStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "Created" => Ok(Self::Created),
            "Pending" => Ok(Self::Pending),
            "Completed" => Ok(Self::Completed),
            "Failed" => Ok(Self::Failed),
            "Deleted" => Ok(Self::Deleted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`RegisterApplicationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "application_type": {
///      "description": "The type of application. Either `web` or `mobile`.",
///      "type": "string",
///      "enum": [
///        "web",
///        "mobile"
///      ]
///    },
///    "client_id": {
///      "description": "The Client ID used to identify the application.",
///      "type": "string"
///    },
///    "exp": {
///      "description": "The expiration time starting from which the JWT must not be accepted for processing.\nProvided in seconds in Unix timestamp format.",
///      "type": "integer"
///    },
///    "grant_types": {
///      "description": "Accepted grant types.\nA JSON array specifying what the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) can request to be supplied to the `/token` endpoint in exchange for an access token.",
///      "type": "array",
///      "items": {
///        "type": "string"
///      }
///    },
///    "iat": {
///      "description": "The time the JWT was issued, which is used to determine the age of the JWT.\nProvided in seconds in Unix timestamp format.",
///      "type": "integer"
///    },
///    "id_token_signed_response_alg": {
///      "description": "The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.",
///      "type": "string",
///      "enum": [
///        "PS256"
///      ]
///    },
///    "iss": {
///      "description": "The principal that issued the JWT.",
///      "type": "string"
///    },
///    "org_jwks_endpoint": {
///      "description": "Public URI endpoint where the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has uploaded their JWKS in JSON format.",
///      "type": "string",
///      "format": "uri"
///    },
///    "redirect_uris": {
///      "description": "List of registered URIs that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will use to interact with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uri"
///      }
///    },
///    "request_object_signing_alg": {
///      "description": "The signing algorithm used to sign request objects. Currently, only `PS256` is supported.",
///      "type": "string",
///      "enum": [
///        "PS256"
///      ]
///    },
///    "scope": {
///      "description": "List of scopes that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has access to, separated by spaces.",
///      "type": "string"
///    },
///    "software_statement": {
///      "description": "Software statement assertion issued by the issuer.\n\nThe data model for the software statements issued by the Open Banking directory are documented as part of the Directory Specification.",
///      "type": "string"
///    },
///    "tls_client_auth_dn": {
///      "description": "Distinguished name of the transport certificate used by the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).",
///      "type": "string"
///    },
///    "token_endpoint_auth_method": {
///      "description": "Specifies the authentication method for the `/token` endpoint.\nCurrently, only `tls_client_auth` is supported.",
///      "type": "string",
///      "enum": [
///        "tls_client_auth"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RegisterApplicationResponse {
    ///The type of application. Either `web` or `mobile`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub application_type: ::std::option::Option<RegisterApplicationResponseApplicationType>,
    ///The Client ID used to identify the application.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub client_id: ::std::option::Option<::std::string::String>,
    /// The expiration time starting from which the JWT must not be accepted for processing.
    /// Provided in seconds in Unix timestamp format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub exp: ::std::option::Option<i64>,
    /// Accepted grant types.
    /// A JSON array specifying what the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) can request to be supplied to the `/token` endpoint in exchange for an access token.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub grant_types: ::std::vec::Vec<::std::string::String>,
    /// The time the JWT was issued, which is used to determine the age of the JWT.
    /// Provided in seconds in Unix timestamp format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub iat: ::std::option::Option<i64>,
    ///The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id_token_signed_response_alg:
        ::std::option::Option<RegisterApplicationResponseIdTokenSignedResponseAlg>,
    ///The principal that issued the JWT.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub iss: ::std::option::Option<::std::string::String>,
    ///Public URI endpoint where the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has uploaded their JWKS in JSON format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub org_jwks_endpoint: ::std::option::Option<::std::string::String>,
    ///List of registered URIs that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) will use to interact with the [ASPSP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub redirect_uris: ::std::vec::Vec<::std::string::String>,
    ///The signing algorithm used to sign request objects. Currently, only `PS256` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub request_object_signing_alg:
        ::std::option::Option<RegisterApplicationResponseRequestObjectSigningAlg>,
    ///List of scopes that the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary) has access to, separated by spaces.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub scope: ::std::option::Option<::std::string::String>,
    /// Software statement assertion issued by the issuer.
    ///
    /// The data model for the software statements issued by the Open Banking directory are documented as part of the Directory Specification.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub software_statement: ::std::option::Option<::std::string::String>,
    ///Distinguished name of the transport certificate used by the [TPP](https://developer.revolut.com/docs/guides/build-banking-apps/glossary).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub tls_client_auth_dn: ::std::option::Option<::std::string::String>,
    /// Specifies the authentication method for the `/token` endpoint.
    /// Currently, only `tls_client_auth` is supported.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token_endpoint_auth_method:
        ::std::option::Option<RegisterApplicationResponseTokenEndpointAuthMethod>,
}
impl ::std::default::Default for RegisterApplicationResponse {
    fn default() -> Self {
        Self {
            application_type: Default::default(),
            client_id: Default::default(),
            exp: Default::default(),
            grant_types: Default::default(),
            iat: Default::default(),
            id_token_signed_response_alg: Default::default(),
            iss: Default::default(),
            org_jwks_endpoint: Default::default(),
            redirect_uris: Default::default(),
            request_object_signing_alg: Default::default(),
            scope: Default::default(),
            software_statement: Default::default(),
            tls_client_auth_dn: Default::default(),
            token_endpoint_auth_method: Default::default(),
        }
    }
}
///The type of application. Either `web` or `mobile`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of application. Either `web` or `mobile`.",
///  "type": "string",
///  "enum": [
///    "web",
///    "mobile"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RegisterApplicationResponseApplicationType {
    #[serde(rename = "web")]
    Web,
    #[serde(rename = "mobile")]
    Mobile,
}
impl ::std::fmt::Display for RegisterApplicationResponseApplicationType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Web => f.write_str("web"),
            Self::Mobile => f.write_str("mobile"),
        }
    }
}
impl ::std::str::FromStr for RegisterApplicationResponseApplicationType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "web" => Ok(Self::Web),
            "mobile" => Ok(Self::Mobile),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RegisterApplicationResponseApplicationType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for RegisterApplicationResponseApplicationType
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RegisterApplicationResponseApplicationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The signing algorithm used to sign the `id_token` JWTs. Currently, only `PS256` is supported.",
///  "type": "string",
///  "enum": [
///    "PS256"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RegisterApplicationResponseIdTokenSignedResponseAlg {
    #[serde(rename = "PS256")]
    Ps256,
}
impl ::std::fmt::Display for RegisterApplicationResponseIdTokenSignedResponseAlg {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Ps256 => f.write_str("PS256"),
        }
    }
}
impl ::std::str::FromStr for RegisterApplicationResponseIdTokenSignedResponseAlg {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "PS256" => Ok(Self::Ps256),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RegisterApplicationResponseIdTokenSignedResponseAlg {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for RegisterApplicationResponseIdTokenSignedResponseAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for RegisterApplicationResponseIdTokenSignedResponseAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The signing algorithm used to sign request objects. Currently, only `PS256` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The signing algorithm used to sign request objects. Currently, only `PS256` is supported.",
///  "type": "string",
///  "enum": [
///    "PS256"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RegisterApplicationResponseRequestObjectSigningAlg {
    #[serde(rename = "PS256")]
    Ps256,
}
impl ::std::fmt::Display for RegisterApplicationResponseRequestObjectSigningAlg {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Ps256 => f.write_str("PS256"),
        }
    }
}
impl ::std::str::FromStr for RegisterApplicationResponseRequestObjectSigningAlg {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "PS256" => Ok(Self::Ps256),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RegisterApplicationResponseRequestObjectSigningAlg {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for RegisterApplicationResponseRequestObjectSigningAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for RegisterApplicationResponseRequestObjectSigningAlg
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Specifies the authentication method for the `/token` endpoint.
/// Currently, only `tls_client_auth` is supported.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Specifies the authentication method for the `/token` endpoint.\nCurrently, only `tls_client_auth` is supported.",
///  "type": "string",
///  "enum": [
///    "tls_client_auth"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RegisterApplicationResponseTokenEndpointAuthMethod {
    #[serde(rename = "tls_client_auth")]
    TlsClientAuth,
}
impl ::std::fmt::Display for RegisterApplicationResponseTokenEndpointAuthMethod {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TlsClientAuth => f.write_str("tls_client_auth"),
        }
    }
}
impl ::std::str::FromStr for RegisterApplicationResponseTokenEndpointAuthMethod {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "tls_client_auth" => Ok(Self::TlsClientAuth),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RegisterApplicationResponseTokenEndpointAuthMethod {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for RegisterApplicationResponseTokenEndpointAuthMethod
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for RegisterApplicationResponseTokenEndpointAuthMethod
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The additional information of the transaction, which is unstructured text.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The additional information of the transaction, which is unstructured text.",
///  "type": "string",
///  "maxLength": 500,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TransactionInformation(::std::string::String);
impl ::std::ops::Deref for TransactionInformation {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransactionInformation> for ::std::string::String {
    fn from(value: TransactionInformation) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TransactionInformation {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for TransactionInformation {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for TransactionInformation {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for TransactionInformation {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for TransactionInformation {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
