// 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())
        }
    }
}
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "",
///  "type": "object",
///  "required": [
///    "balance",
///    "created_at",
///    "currency",
///    "id",
///    "public",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "balance": {
///      "description": "The current balance on the account.",
///      "type": "number",
///      "format": "double"
///    },
///    "created_at": {
///      "description": "The date and time the account was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/AccountCurrency"
///    },
///    "id": {
///      "description": "The account ID.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The account name.",
///      "type": "string"
///    },
///    "public": {
///      "description": "Indicates whether the account is visible to other businesses on Revolut.",
///      "type": "boolean"
///    },
///    "state": {
///      "description": "Indicates the state of the account.",
///      "type": "string",
///      "enum": [
///        "active",
///        "inactive"
///      ]
///    },
///    "updated_at": {
///      "description": "The date and time the account was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Account {
    ///The current balance on the account.
    pub balance: f64,
    ///The date and time the account was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub currency: AccountCurrency,
    ///The account ID.
    pub id: ::uuid::Uuid,
    ///The account name.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
    ///Indicates whether the account is visible to other businesses on Revolut.
    pub public: bool,
    ///Indicates the state of the account.
    pub state: AccountState,
    ///The date and time the account was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "",
///  "type": "object",
///  "required": [
///    "beneficiary",
///    "beneficiary_address",
///    "estimated_time",
///    "schemes"
///  ],
///  "properties": {
///    "account_no": {
///      "description": "The account number.",
///      "type": "string"
///    },
///    "bank_country": {
///      "$ref": "#/components/schemas/BankCountryCode"
///    },
///    "beneficiary": {
///      "description": "The name of the counterparty.",
///      "type": "string"
///    },
///    "beneficiary_address": {
///      "$ref": "#/components/schemas/BeneficiaryAddress"
///    },
///    "bic": {
///      "description": "The BIC number, also known as SWIFT code.",
///      "type": "string"
///    },
///    "estimated_time": {
///      "$ref": "#/components/schemas/EstimatedTime"
///    },
///    "iban": {
///      "description": "The IBAN number.",
///      "type": "string"
///    },
///    "pooled": {
///      "description": "Indicates whether the account address is pooled or unique.",
///      "type": "boolean"
///    },
///    "routing_number": {
///      "description": "The routing number of the account.",
///      "type": "string"
///    },
///    "schemes": {
///      "description": "The schemes that are available for this currency account.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/PaymentSystem"
///      }
///    },
///    "sort_code": {
///      "description": "The sort code of the account.",
///      "type": "string"
///    },
///    "unique_reference": {
///      "description": "The reference of the pooled account.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountBankDetailsItem {
    ///The account number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account_no: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bank_country: ::std::option::Option<BankCountryCode>,
    ///The name of the counterparty.
    pub beneficiary: ::std::string::String,
    pub beneficiary_address: BeneficiaryAddress,
    ///The BIC number, also known as SWIFT code.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bic: ::std::option::Option<::std::string::String>,
    pub estimated_time: EstimatedTime,
    ///The IBAN number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub iban: ::std::option::Option<::std::string::String>,
    ///Indicates whether the account address is pooled or unique.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub pooled: ::std::option::Option<bool>,
    ///The routing number of the account.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub routing_number: ::std::option::Option<::std::string::String>,
    ///The schemes that are available for this currency account.
    pub schemes: ::std::vec::Vec<PaymentSystem>,
    ///The sort code of the account.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub sort_code: ::std::option::Option<::std::string::String>,
    ///The reference of the pooled account.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub unique_reference: ::std::option::Option<::std::string::String>,
}
///Indicates the payment scheme used to execute transactions.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the payment scheme used to execute transactions.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/AccountBankDetailsItem"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct AccountBankDetailsItems(pub ::std::vec::Vec<AccountBankDetailsItem>);
impl ::std::ops::Deref for AccountBankDetailsItems {
    type Target = ::std::vec::Vec<AccountBankDetailsItem>;
    fn deref(&self) -> &::std::vec::Vec<AccountBankDetailsItem> {
        &self.0
    }
}
impl ::std::convert::From<AccountBankDetailsItems> for ::std::vec::Vec<AccountBankDetailsItem> {
    fn from(value: AccountBankDetailsItems) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<AccountBankDetailsItem>> for AccountBankDetailsItems {
    fn from(value: ::std::vec::Vec<AccountBankDetailsItem>) -> Self {
        Self(value)
    }
}
///[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 AccountCurrency(::std::string::String);
impl ::std::ops::Deref for AccountCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AccountCurrency> for ::std::string::String {
    fn from(value: AccountCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AccountCurrency {
    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 AccountCurrency {
    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 AccountCurrency {
    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 AccountCurrency {
    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 AccountCurrency {
    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 code which explains why a given result was returned, and the service that returned it.
/// In some cases, it may provide more details about the result.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A code which explains why a given result was returned, and the service that returned it.\nIn some cases, it may provide more details about the result.",
///  "type": "object",
///  "properties": {
///    "code": {
///      "description": "The reason code. Possible values for AU:\n- **`close_match`** (business accounts): The provided name is similar to the account name.\n  The actual name is returned. Mismatched account type is corrected.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///      "type": "string",
///      "enum": [
///        "close_match",
///        "individual_account_name_matched",
///        "company_account_name_matched",
///        "individual_account_close_match",
///        "company_account_close_match",
///        "not_matched",
///        "account_does_not_exist",
///        "account_switched",
///        "cannot_be_checked"
///      ]
///    },
///    "type": {
///      "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor AU, the value is: `au_cop`.",
///      "type": "string",
///      "enum": [
///        "uk_cop",
///        "eu_cop",
///        "ro_cop",
///        "au_cop"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountNameValidationReasonAu {
    /// The reason code. Possible values for AU:
    /// - **`close_match`** (business accounts): The provided name is similar to the account name.
    ///   The actual name is returned. Mismatched account type is corrected.
    /// - **`not_matched`**: The account details don't match the provided values.
    /// - **`account_does_not_exist`**: The account does not exist.
    /// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
    ///   Please contact the recipient for updated account details.
    /// - **`cannot_be_checked`**: The account cannot be checked.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<AccountNameValidationReasonAuCode>,
    /// The reason type.
    /// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
    /// For AU, the value is: `au_cop`.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<AccountNameValidationReasonAuType>,
}
impl ::std::default::Default for AccountNameValidationReasonAu {
    fn default() -> Self {
        Self {
            code: Default::default(),
            type_: Default::default(),
        }
    }
}
/// The reason code. Possible values for AU:
/// - **`close_match`** (business accounts): The provided name is similar to the account name.
///   The actual name is returned. Mismatched account type is corrected.
/// - **`not_matched`**: The account details don't match the provided values.
/// - **`account_does_not_exist`**: The account does not exist.
/// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
///   Please contact the recipient for updated account details.
/// - **`cannot_be_checked`**: The account cannot be checked.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code. Possible values for AU:\n- **`close_match`** (business accounts): The provided name is similar to the account name.\n  The actual name is returned. Mismatched account type is corrected.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///  "type": "string",
///  "enum": [
///    "close_match",
///    "individual_account_name_matched",
///    "company_account_name_matched",
///    "individual_account_close_match",
///    "company_account_close_match",
///    "not_matched",
///    "account_does_not_exist",
///    "account_switched",
///    "cannot_be_checked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonAuCode {
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "individual_account_name_matched")]
    IndividualAccountNameMatched,
    #[serde(rename = "company_account_name_matched")]
    CompanyAccountNameMatched,
    #[serde(rename = "individual_account_close_match")]
    IndividualAccountCloseMatch,
    #[serde(rename = "company_account_close_match")]
    CompanyAccountCloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "account_does_not_exist")]
    AccountDoesNotExist,
    #[serde(rename = "account_switched")]
    AccountSwitched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
}
impl ::std::fmt::Display for AccountNameValidationReasonAuCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CloseMatch => f.write_str("close_match"),
            Self::IndividualAccountNameMatched => f.write_str("individual_account_name_matched"),
            Self::CompanyAccountNameMatched => f.write_str("company_account_name_matched"),
            Self::IndividualAccountCloseMatch => f.write_str("individual_account_close_match"),
            Self::CompanyAccountCloseMatch => f.write_str("company_account_close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::AccountDoesNotExist => f.write_str("account_does_not_exist"),
            Self::AccountSwitched => f.write_str("account_switched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonAuCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "close_match" => Ok(Self::CloseMatch),
            "individual_account_name_matched" => Ok(Self::IndividualAccountNameMatched),
            "company_account_name_matched" => Ok(Self::CompanyAccountNameMatched),
            "individual_account_close_match" => Ok(Self::IndividualAccountCloseMatch),
            "company_account_close_match" => Ok(Self::CompanyAccountCloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "account_does_not_exist" => Ok(Self::AccountDoesNotExist),
            "account_switched" => Ok(Self::AccountSwitched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonAuCode {
    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 AccountNameValidationReasonAuCode {
    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 AccountNameValidationReasonAuCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The reason type.
/// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
/// For AU, the value is: `au_cop`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor AU, the value is: `au_cop`.",
///  "type": "string",
///  "enum": [
///    "uk_cop",
///    "eu_cop",
///    "ro_cop",
///    "au_cop"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonAuType {
    #[serde(rename = "uk_cop")]
    UkCop,
    #[serde(rename = "eu_cop")]
    EuCop,
    #[serde(rename = "ro_cop")]
    RoCop,
    #[serde(rename = "au_cop")]
    AuCop,
}
impl ::std::fmt::Display for AccountNameValidationReasonAuType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkCop => f.write_str("uk_cop"),
            Self::EuCop => f.write_str("eu_cop"),
            Self::RoCop => f.write_str("ro_cop"),
            Self::AuCop => f.write_str("au_cop"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonAuType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "uk_cop" => Ok(Self::UkCop),
            "eu_cop" => Ok(Self::EuCop),
            "ro_cop" => Ok(Self::RoCop),
            "au_cop" => Ok(Self::AuCop),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonAuType {
    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 AccountNameValidationReasonAuType {
    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 AccountNameValidationReasonAuType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// A code which explains why a given result was returned, and the service that returned it.
/// For example, it might happen that the details you provided match the account details, but you specified the counterparty as an individual, and the account type is business.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A code which explains why a given result was returned, and the service that returned it.\nFor example, it might happen that the details you provided match the account details, but you specified the counterparty as an individual, and the account type is business.",
///  "type": "object",
///  "properties": {
///    "code": {
///      "description": "The reason code. Possible values for EUR:\n- **`close_match`**: The provided name is similar to the account name.\n  The actual name is returned.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///      "type": "string",
///      "enum": [
///        "close_match",
///        "individual_account_name_matched",
///        "company_account_name_matched",
///        "individual_account_close_match",
///        "company_account_close_match",
///        "not_matched",
///        "account_does_not_exist",
///        "account_switched",
///        "cannot_be_checked"
///      ]
///    },
///    "type": {
///      "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor EUR, the value is: `eu_cop`.",
///      "type": "string",
///      "enum": [
///        "uk_cop",
///        "eu_cop",
///        "ro_cop",
///        "au_cop"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountNameValidationReasonEur {
    /// The reason code. Possible values for EUR:
    /// - **`close_match`**: The provided name is similar to the account name.
    ///   The actual name is returned.
    /// - **`not_matched`**: The account details don't match the provided values.
    /// - **`account_does_not_exist`**: The account does not exist.
    /// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
    ///   Please contact the recipient for updated account details.
    /// - **`cannot_be_checked`**: The account cannot be checked.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<AccountNameValidationReasonEurCode>,
    /// The reason type.
    /// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
    /// For EUR, the value is: `eu_cop`.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<AccountNameValidationReasonEurType>,
}
impl ::std::default::Default for AccountNameValidationReasonEur {
    fn default() -> Self {
        Self {
            code: Default::default(),
            type_: Default::default(),
        }
    }
}
/// The reason code. Possible values for EUR:
/// - **`close_match`**: The provided name is similar to the account name.
///   The actual name is returned.
/// - **`not_matched`**: The account details don't match the provided values.
/// - **`account_does_not_exist`**: The account does not exist.
/// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
///   Please contact the recipient for updated account details.
/// - **`cannot_be_checked`**: The account cannot be checked.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code. Possible values for EUR:\n- **`close_match`**: The provided name is similar to the account name.\n  The actual name is returned.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///  "type": "string",
///  "enum": [
///    "close_match",
///    "individual_account_name_matched",
///    "company_account_name_matched",
///    "individual_account_close_match",
///    "company_account_close_match",
///    "not_matched",
///    "account_does_not_exist",
///    "account_switched",
///    "cannot_be_checked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonEurCode {
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "individual_account_name_matched")]
    IndividualAccountNameMatched,
    #[serde(rename = "company_account_name_matched")]
    CompanyAccountNameMatched,
    #[serde(rename = "individual_account_close_match")]
    IndividualAccountCloseMatch,
    #[serde(rename = "company_account_close_match")]
    CompanyAccountCloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "account_does_not_exist")]
    AccountDoesNotExist,
    #[serde(rename = "account_switched")]
    AccountSwitched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
}
impl ::std::fmt::Display for AccountNameValidationReasonEurCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CloseMatch => f.write_str("close_match"),
            Self::IndividualAccountNameMatched => f.write_str("individual_account_name_matched"),
            Self::CompanyAccountNameMatched => f.write_str("company_account_name_matched"),
            Self::IndividualAccountCloseMatch => f.write_str("individual_account_close_match"),
            Self::CompanyAccountCloseMatch => f.write_str("company_account_close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::AccountDoesNotExist => f.write_str("account_does_not_exist"),
            Self::AccountSwitched => f.write_str("account_switched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonEurCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "close_match" => Ok(Self::CloseMatch),
            "individual_account_name_matched" => Ok(Self::IndividualAccountNameMatched),
            "company_account_name_matched" => Ok(Self::CompanyAccountNameMatched),
            "individual_account_close_match" => Ok(Self::IndividualAccountCloseMatch),
            "company_account_close_match" => Ok(Self::CompanyAccountCloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "account_does_not_exist" => Ok(Self::AccountDoesNotExist),
            "account_switched" => Ok(Self::AccountSwitched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonEurCode {
    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 AccountNameValidationReasonEurCode {
    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 AccountNameValidationReasonEurCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The reason type.
/// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
/// For EUR, the value is: `eu_cop`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor EUR, the value is: `eu_cop`.",
///  "type": "string",
///  "enum": [
///    "uk_cop",
///    "eu_cop",
///    "ro_cop",
///    "au_cop"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonEurType {
    #[serde(rename = "uk_cop")]
    UkCop,
    #[serde(rename = "eu_cop")]
    EuCop,
    #[serde(rename = "ro_cop")]
    RoCop,
    #[serde(rename = "au_cop")]
    AuCop,
}
impl ::std::fmt::Display for AccountNameValidationReasonEurType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkCop => f.write_str("uk_cop"),
            Self::EuCop => f.write_str("eu_cop"),
            Self::RoCop => f.write_str("ro_cop"),
            Self::AuCop => f.write_str("au_cop"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonEurType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "uk_cop" => Ok(Self::UkCop),
            "eu_cop" => Ok(Self::EuCop),
            "ro_cop" => Ok(Self::RoCop),
            "au_cop" => Ok(Self::AuCop),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonEurType {
    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 AccountNameValidationReasonEurType {
    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 AccountNameValidationReasonEurType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A code which explains why a given result was returned, and the service that returned it.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A code which explains why a given result was returned, and the service that returned it.",
///  "type": "object",
///  "properties": {
///    "code": {
///      "description": "The reason code. Possible values for RO:\n- **`cannot_be_checked`**: The account cannot be checked.",
///      "type": "string",
///      "enum": [
///        "close_match",
///        "individual_account_name_matched",
///        "company_account_name_matched",
///        "individual_account_close_match",
///        "company_account_close_match",
///        "not_matched",
///        "account_does_not_exist",
///        "account_switched",
///        "cannot_be_checked"
///      ]
///    },
///    "type": {
///      "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor RO, the value is: `ro_cop`.",
///      "type": "string",
///      "enum": [
///        "uk_cop",
///        "eu_cop",
///        "ro_cop",
///        "au_cop"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountNameValidationReasonRo {
    /// The reason code. Possible values for RO:
    /// - **`cannot_be_checked`**: The account cannot be checked.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<AccountNameValidationReasonRoCode>,
    /// The reason type.
    /// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
    /// For RO, the value is: `ro_cop`.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<AccountNameValidationReasonRoType>,
}
impl ::std::default::Default for AccountNameValidationReasonRo {
    fn default() -> Self {
        Self {
            code: Default::default(),
            type_: Default::default(),
        }
    }
}
/// The reason code. Possible values for RO:
/// - **`cannot_be_checked`**: The account cannot be checked.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code. Possible values for RO:\n- **`cannot_be_checked`**: The account cannot be checked.",
///  "type": "string",
///  "enum": [
///    "close_match",
///    "individual_account_name_matched",
///    "company_account_name_matched",
///    "individual_account_close_match",
///    "company_account_close_match",
///    "not_matched",
///    "account_does_not_exist",
///    "account_switched",
///    "cannot_be_checked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonRoCode {
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "individual_account_name_matched")]
    IndividualAccountNameMatched,
    #[serde(rename = "company_account_name_matched")]
    CompanyAccountNameMatched,
    #[serde(rename = "individual_account_close_match")]
    IndividualAccountCloseMatch,
    #[serde(rename = "company_account_close_match")]
    CompanyAccountCloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "account_does_not_exist")]
    AccountDoesNotExist,
    #[serde(rename = "account_switched")]
    AccountSwitched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
}
impl ::std::fmt::Display for AccountNameValidationReasonRoCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CloseMatch => f.write_str("close_match"),
            Self::IndividualAccountNameMatched => f.write_str("individual_account_name_matched"),
            Self::CompanyAccountNameMatched => f.write_str("company_account_name_matched"),
            Self::IndividualAccountCloseMatch => f.write_str("individual_account_close_match"),
            Self::CompanyAccountCloseMatch => f.write_str("company_account_close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::AccountDoesNotExist => f.write_str("account_does_not_exist"),
            Self::AccountSwitched => f.write_str("account_switched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonRoCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "close_match" => Ok(Self::CloseMatch),
            "individual_account_name_matched" => Ok(Self::IndividualAccountNameMatched),
            "company_account_name_matched" => Ok(Self::CompanyAccountNameMatched),
            "individual_account_close_match" => Ok(Self::IndividualAccountCloseMatch),
            "company_account_close_match" => Ok(Self::CompanyAccountCloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "account_does_not_exist" => Ok(Self::AccountDoesNotExist),
            "account_switched" => Ok(Self::AccountSwitched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonRoCode {
    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 AccountNameValidationReasonRoCode {
    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 AccountNameValidationReasonRoCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The reason type.
/// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
/// For RO, the value is: `ro_cop`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor RO, the value is: `ro_cop`.",
///  "type": "string",
///  "enum": [
///    "uk_cop",
///    "eu_cop",
///    "ro_cop",
///    "au_cop"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonRoType {
    #[serde(rename = "uk_cop")]
    UkCop,
    #[serde(rename = "eu_cop")]
    EuCop,
    #[serde(rename = "ro_cop")]
    RoCop,
    #[serde(rename = "au_cop")]
    AuCop,
}
impl ::std::fmt::Display for AccountNameValidationReasonRoType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkCop => f.write_str("uk_cop"),
            Self::EuCop => f.write_str("eu_cop"),
            Self::RoCop => f.write_str("ro_cop"),
            Self::AuCop => f.write_str("au_cop"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonRoType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "uk_cop" => Ok(Self::UkCop),
            "eu_cop" => Ok(Self::EuCop),
            "ro_cop" => Ok(Self::RoCop),
            "au_cop" => Ok(Self::AuCop),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonRoType {
    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 AccountNameValidationReasonRoType {
    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 AccountNameValidationReasonRoType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// A code which explains why a given result was returned, and the service that returned it.
/// For example, it might happen that the details you provided match the account details, but you specified the counterparty as an individual, and the account type is business.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A code which explains why a given result was returned, and the service that returned it.\nFor example, it might happen that the details you provided match the account details, but you specified the counterparty as an individual, and the account type is business.",
///  "type": "object",
///  "properties": {
///    "code": {
///      "description": "The reason code. Possible values for UK:\n- **`close_match`**: The provided name is similar to the account name, the account type is correct.\n  The actual name is returned.\n- **`individual_account_name_matched`**: The names match but the counterparty is an individual, not a business.\n- **`company_account_name_matched`**: The names match but the counterparty is a business, not an individual.\n- **`individual_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect – the counterparty is an individual, not a business.\n  The actual name is returned.\n- **`company_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect - the counterparty is a business, not an individual.\n  The actual name is returned.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///      "type": "string",
///      "enum": [
///        "close_match",
///        "individual_account_name_matched",
///        "company_account_name_matched",
///        "individual_account_close_match",
///        "company_account_close_match",
///        "not_matched",
///        "account_does_not_exist",
///        "account_switched",
///        "cannot_be_checked"
///      ]
///    },
///    "type": {
///      "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor UK, the values is: `uk_cop`.",
///      "type": "string",
///      "enum": [
///        "uk_cop",
///        "eu_cop",
///        "ro_cop",
///        "au_cop"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountNameValidationReasonUk {
    /// The reason code. Possible values for UK:
    /// - **`close_match`**: The provided name is similar to the account name, the account type is correct.
    ///   The actual name is returned.
    /// - **`individual_account_name_matched`**: The names match but the counterparty is an individual, not a business.
    /// - **`company_account_name_matched`**: The names match but the counterparty is a business, not an individual.
    /// - **`individual_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect – the counterparty is an individual, not a business.
    ///   The actual name is returned.
    /// - **`company_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect - the counterparty is a business, not an individual.
    ///   The actual name is returned.
    /// - **`not_matched`**: The account details don't match the provided values.
    /// - **`account_does_not_exist`**: The account does not exist.
    /// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
    ///   Please contact the recipient for updated account details.
    /// - **`cannot_be_checked`**: The account cannot be checked.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<AccountNameValidationReasonUkCode>,
    /// The reason type.
    /// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
    /// For UK, the values is: `uk_cop`.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<AccountNameValidationReasonUkType>,
}
impl ::std::default::Default for AccountNameValidationReasonUk {
    fn default() -> Self {
        Self {
            code: Default::default(),
            type_: Default::default(),
        }
    }
}
/// The reason code. Possible values for UK:
/// - **`close_match`**: The provided name is similar to the account name, the account type is correct.
///   The actual name is returned.
/// - **`individual_account_name_matched`**: The names match but the counterparty is an individual, not a business.
/// - **`company_account_name_matched`**: The names match but the counterparty is a business, not an individual.
/// - **`individual_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect – the counterparty is an individual, not a business.
///   The actual name is returned.
/// - **`company_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect - the counterparty is a business, not an individual.
///   The actual name is returned.
/// - **`not_matched`**: The account details don't match the provided values.
/// - **`account_does_not_exist`**: The account does not exist.
/// - **`account_switched`**: The account has been switched using the Current Account Switching Service.
///   Please contact the recipient for updated account details.
/// - **`cannot_be_checked`**: The account cannot be checked.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code. Possible values for UK:\n- **`close_match`**: The provided name is similar to the account name, the account type is correct.\n  The actual name is returned.\n- **`individual_account_name_matched`**: The names match but the counterparty is an individual, not a business.\n- **`company_account_name_matched`**: The names match but the counterparty is a business, not an individual.\n- **`individual_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect – the counterparty is an individual, not a business.\n  The actual name is returned.\n- **`company_account_close_match`**: The provided name is similar to the account name, and the account type is incorrect - the counterparty is a business, not an individual.\n  The actual name is returned.\n- **`not_matched`**: The account details don't match the provided values.\n- **`account_does_not_exist`**: The account does not exist.\n- **`account_switched`**: The account has been switched using the Current Account Switching Service.\n  Please contact the recipient for updated account details.\n- **`cannot_be_checked`**: The account cannot be checked.",
///  "type": "string",
///  "enum": [
///    "close_match",
///    "individual_account_name_matched",
///    "company_account_name_matched",
///    "individual_account_close_match",
///    "company_account_close_match",
///    "not_matched",
///    "account_does_not_exist",
///    "account_switched",
///    "cannot_be_checked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonUkCode {
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "individual_account_name_matched")]
    IndividualAccountNameMatched,
    #[serde(rename = "company_account_name_matched")]
    CompanyAccountNameMatched,
    #[serde(rename = "individual_account_close_match")]
    IndividualAccountCloseMatch,
    #[serde(rename = "company_account_close_match")]
    CompanyAccountCloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "account_does_not_exist")]
    AccountDoesNotExist,
    #[serde(rename = "account_switched")]
    AccountSwitched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
}
impl ::std::fmt::Display for AccountNameValidationReasonUkCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CloseMatch => f.write_str("close_match"),
            Self::IndividualAccountNameMatched => f.write_str("individual_account_name_matched"),
            Self::CompanyAccountNameMatched => f.write_str("company_account_name_matched"),
            Self::IndividualAccountCloseMatch => f.write_str("individual_account_close_match"),
            Self::CompanyAccountCloseMatch => f.write_str("company_account_close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::AccountDoesNotExist => f.write_str("account_does_not_exist"),
            Self::AccountSwitched => f.write_str("account_switched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonUkCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "close_match" => Ok(Self::CloseMatch),
            "individual_account_name_matched" => Ok(Self::IndividualAccountNameMatched),
            "company_account_name_matched" => Ok(Self::CompanyAccountNameMatched),
            "individual_account_close_match" => Ok(Self::IndividualAccountCloseMatch),
            "company_account_close_match" => Ok(Self::CompanyAccountCloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "account_does_not_exist" => Ok(Self::AccountDoesNotExist),
            "account_switched" => Ok(Self::AccountSwitched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonUkCode {
    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 AccountNameValidationReasonUkCode {
    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 AccountNameValidationReasonUkCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The reason type.
/// Determines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.
/// For UK, the values is: `uk_cop`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason type.\nDetermines the [service](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services) used for the validation that returned the reason code.\nFor UK, the values is: `uk_cop`.",
///  "type": "string",
///  "enum": [
///    "uk_cop",
///    "eu_cop",
///    "ro_cop",
///    "au_cop"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountNameValidationReasonUkType {
    #[serde(rename = "uk_cop")]
    UkCop,
    #[serde(rename = "eu_cop")]
    EuCop,
    #[serde(rename = "ro_cop")]
    RoCop,
    #[serde(rename = "au_cop")]
    AuCop,
}
impl ::std::fmt::Display for AccountNameValidationReasonUkType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::UkCop => f.write_str("uk_cop"),
            Self::EuCop => f.write_str("eu_cop"),
            Self::RoCop => f.write_str("ro_cop"),
            Self::AuCop => f.write_str("au_cop"),
        }
    }
}
impl ::std::str::FromStr for AccountNameValidationReasonUkType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "uk_cop" => Ok(Self::UkCop),
            "eu_cop" => Ok(Self::EuCop),
            "ro_cop" => Ok(Self::RoCop),
            "au_cop" => Ok(Self::AuCop),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AccountNameValidationReasonUkType {
    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 AccountNameValidationReasonUkType {
    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 AccountNameValidationReasonUkType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Indicates the state of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the state of the account.",
///  "type": "string",
///  "enum": [
///    "active",
///    "inactive"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AccountState {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "inactive")]
    Inactive,
}
impl ::std::fmt::Display for AccountState {
    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 AccountState {
    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 AccountState {
    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 AccountState {
    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 AccountState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`AccountingCategoryResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "updated_at"
///  ],
///  "properties": {
///    "code": {
///      "description": "The code of the accounting category.",
///      "type": "string"
///    },
///    "created_at": {
///      "description": "The date and time the accounting category was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "default_tax_rate_id": {
///      "description": "The ID of the default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) applied to items in this accounting category unless overridden for a specific item.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "id": {
///      "description": "The unique ID of the accounting category.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the accounting category.",
///      "type": "string"
///    },
///    "updated_at": {
///      "description": "The date and time the accounting category was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountingCategoryResponse {
    ///The code of the accounting category.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<::std::string::String>,
    ///The date and time the accounting category was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) applied to items in this accounting category unless overridden for a specific item.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub default_tax_rate_id: ::std::option::Option<::uuid::Uuid>,
    ///The unique ID of the accounting category.
    pub id: ::uuid::Uuid,
    ///The name of the accounting category.
    pub name: ::std::string::String,
    ///The date and time the accounting category was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The tax rate that can be applied to financial records, such as expenses.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The tax rate that can be applied to financial records, such as expenses.",
///  "type": "object",
///  "required": [
///    "name"
///  ],
///  "properties": {
///    "name": {
///      "description": "The name of the tax.",
///      "type": "string",
///      "maxLength": 20,
///      "minLength": 1
///    },
///    "percentage": {
///      "description": "The tax rate percentage applied to the taxable amount. For example, `23` for 23%.",
///      "type": "number",
///      "format": "double",
///      "maximum": 100.0,
///      "minimum": 0.0
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccountingTaxRate {
    ///The name of the tax.
    pub name: AccountingTaxRateName,
    ///The tax rate percentage applied to the taxable amount. For example, `23` for 23%.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub percentage: ::std::option::Option<f64>,
}
///The name of the tax.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the tax.",
///  "type": "string",
///  "maxLength": 20,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AccountingTaxRateName(::std::string::String);
impl ::std::ops::Deref for AccountingTaxRateName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AccountingTaxRateName> for ::std::string::String {
    fn from(value: AccountingTaxRateName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AccountingTaxRateName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 20usize {
            return Err("longer than 20 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 AccountingTaxRateName {
    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 AccountingTaxRateName {
    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 AccountingTaxRateName {
    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 AccountingTaxRateName {
    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())
            })
    }
}
///`Accounts`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Account"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Accounts(pub ::std::vec::Vec<Account>);
impl ::std::ops::Deref for Accounts {
    type Target = ::std::vec::Vec<Account>;
    fn deref(&self) -> &::std::vec::Vec<Account> {
        &self.0
    }
}
impl ::std::convert::From<Accounts> for ::std::vec::Vec<Account> {
    fn from(value: Accounts) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Account>> for Accounts {
    fn from(value: ::std::vec::Vec<Account>) -> Self {
        Self(value)
    }
}
///The amount of money.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money.",
///  "type": "number",
///  "format": "double"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Amount(pub f64);
impl ::std::ops::Deref for Amount {
    type Target = f64;
    fn deref(&self) -> &f64 {
        &self.0
    }
}
impl ::std::convert::From<Amount> for f64 {
    fn from(value: Amount) -> Self {
        value.0
    }
}
impl ::std::convert::From<f64> for Amount {
    fn from(value: f64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for Amount {
    type Err = <f64 as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for Amount {
    type Error = <f64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for Amount {
    type Error = <f64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for Amount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "description": "The amount of the transaction.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AmountWithCurrency {
    ///The amount of the transaction.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<f64>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
}
impl ::std::default::Default for AmountWithCurrency {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            currency: Default::default(),
        }
    }
}
///The country of the bank, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The country of the bank, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BankCountryCode(::std::string::String);
impl ::std::ops::Deref for BankCountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BankCountryCode> for ::std::string::String {
    fn from(value: BankCountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BankCountryCode {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BankCountryCode {
    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 BankCountryCode {
    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 BankCountryCode {
    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 BankCountryCode {
    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 address of the counterparty.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The address of the counterparty.",
///  "type": "object",
///  "required": [
///    "country",
///    "postcode"
///  ],
///  "properties": {
///    "city": {
///      "description": "The name of the city.",
///      "type": "string"
///    },
///    "country": {
///      "description": "The country of the counterparty, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///      "type": "string",
///      "pattern": "^[A-Z]{2}$"
///    },
///    "postcode": {
///      "description": "The postcode of the counterparty address.",
///      "type": "string"
///    },
///    "region": {
///      "description": "The name of the region (state or province), for example, Ontario for Canada.",
///      "type": "string"
///    },
///    "street_line1": {
///      "description": "Street line 1 information.",
///      "type": "string"
///    },
///    "street_line2": {
///      "description": "Street line 2 information.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BeneficiaryAddress {
    ///The name of the city.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub city: ::std::option::Option<::std::string::String>,
    ///The country of the counterparty, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
    pub country: BeneficiaryAddressCountry,
    ///The postcode of the counterparty address.
    pub postcode: ::std::string::String,
    ///The name of the region (state or province), for example, Ontario for Canada.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<::std::string::String>,
    ///Street line 1 information.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line1: ::std::option::Option<::std::string::String>,
    ///Street line 2 information.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line2: ::std::option::Option<::std::string::String>,
}
///The country of the counterparty, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The country of the counterparty, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BeneficiaryAddressCountry(::std::string::String);
impl ::std::ops::Deref for BeneficiaryAddressCountry {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BeneficiaryAddressCountry> for ::std::string::String {
    fn from(value: BeneficiaryAddressCountry) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BeneficiaryAddressCountry {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BeneficiaryAddressCountry {
    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 BeneficiaryAddressCountry {
    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 BeneficiaryAddressCountry {
    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 BeneficiaryAddressCountry {
    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())
            })
    }
}
///`BusinessMerchantCategory`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "enum": [
///    "health",
///    "general",
///    "services",
///    "airlines",
///    "transport",
///    "accommodation",
///    "utilities",
///    "shopping",
///    "financial",
///    "furniture",
///    "hardware",
///    "groceries",
///    "fuel",
///    "entertainment",
///    "software",
///    "restaurants",
///    "advertising",
///    "cash",
///    "education",
///    "government"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum BusinessMerchantCategory {
    #[serde(rename = "health")]
    Health,
    #[serde(rename = "general")]
    General,
    #[serde(rename = "services")]
    Services,
    #[serde(rename = "airlines")]
    Airlines,
    #[serde(rename = "transport")]
    Transport,
    #[serde(rename = "accommodation")]
    Accommodation,
    #[serde(rename = "utilities")]
    Utilities,
    #[serde(rename = "shopping")]
    Shopping,
    #[serde(rename = "financial")]
    Financial,
    #[serde(rename = "furniture")]
    Furniture,
    #[serde(rename = "hardware")]
    Hardware,
    #[serde(rename = "groceries")]
    Groceries,
    #[serde(rename = "fuel")]
    Fuel,
    #[serde(rename = "entertainment")]
    Entertainment,
    #[serde(rename = "software")]
    Software,
    #[serde(rename = "restaurants")]
    Restaurants,
    #[serde(rename = "advertising")]
    Advertising,
    #[serde(rename = "cash")]
    Cash,
    #[serde(rename = "education")]
    Education,
    #[serde(rename = "government")]
    Government,
}
impl ::std::fmt::Display for BusinessMerchantCategory {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Health => f.write_str("health"),
            Self::General => f.write_str("general"),
            Self::Services => f.write_str("services"),
            Self::Airlines => f.write_str("airlines"),
            Self::Transport => f.write_str("transport"),
            Self::Accommodation => f.write_str("accommodation"),
            Self::Utilities => f.write_str("utilities"),
            Self::Shopping => f.write_str("shopping"),
            Self::Financial => f.write_str("financial"),
            Self::Furniture => f.write_str("furniture"),
            Self::Hardware => f.write_str("hardware"),
            Self::Groceries => f.write_str("groceries"),
            Self::Fuel => f.write_str("fuel"),
            Self::Entertainment => f.write_str("entertainment"),
            Self::Software => f.write_str("software"),
            Self::Restaurants => f.write_str("restaurants"),
            Self::Advertising => f.write_str("advertising"),
            Self::Cash => f.write_str("cash"),
            Self::Education => f.write_str("education"),
            Self::Government => f.write_str("government"),
        }
    }
}
impl ::std::str::FromStr for BusinessMerchantCategory {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "health" => Ok(Self::Health),
            "general" => Ok(Self::General),
            "services" => Ok(Self::Services),
            "airlines" => Ok(Self::Airlines),
            "transport" => Ok(Self::Transport),
            "accommodation" => Ok(Self::Accommodation),
            "utilities" => Ok(Self::Utilities),
            "shopping" => Ok(Self::Shopping),
            "financial" => Ok(Self::Financial),
            "furniture" => Ok(Self::Furniture),
            "hardware" => Ok(Self::Hardware),
            "groceries" => Ok(Self::Groceries),
            "fuel" => Ok(Self::Fuel),
            "entertainment" => Ok(Self::Entertainment),
            "software" => Ok(Self::Software),
            "restaurants" => Ok(Self::Restaurants),
            "advertising" => Ok(Self::Advertising),
            "cash" => Ok(Self::Cash),
            "education" => Ok(Self::Education),
            "government" => Ok(Self::Government),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for BusinessMerchantCategory {
    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 BusinessMerchantCategory {
    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 BusinessMerchantCategory {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Returned for locked cards (`state=locked`).
/// Indicates whether the card can be [unlocked](https://developer.revolut.com/docs/business/unlock-card) manually (via API or in-app).
/// If `true`, you'll still need the [necessary scope or permission](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#lock-or-unlock-cards) to unlock the card.
///
/// :::info
/// Cards can be locked for various reasons.
/// For example, a card can be locked by the user, due to spending period settings, or automatically by the system.
/// Only certain types of lock can be lifted manually.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Returned for locked cards (`state=locked`).\nIndicates whether the card can be [unlocked](https://developer.revolut.com/docs/business/unlock-card) manually (via API or in-app).\nIf `true`, you'll still need the [necessary scope or permission](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#lock-or-unlock-cards) to unlock the card.\n\n:::info\nCards can be locked for various reasons.\nFor example, a card can be locked by the user, due to spending period settings, or automatically by the system.\nOnly certain types of lock can be lifted manually.\n:::",
///  "type": "boolean"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardCanBeUnlocked(pub bool);
impl ::std::ops::Deref for CardCanBeUnlocked {
    type Target = bool;
    fn deref(&self) -> &bool {
        &self.0
    }
}
impl ::std::convert::From<CardCanBeUnlocked> for bool {
    fn from(value: CardCanBeUnlocked) -> Self {
        value.0
    }
}
impl ::std::convert::From<bool> for CardCanBeUnlocked {
    fn from(value: bool) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardCanBeUnlocked {
    type Err = <bool as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardCanBeUnlocked {
    type Error = <bool as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardCanBeUnlocked {
    type Error = <bool as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardCanBeUnlocked {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///One of the card's contacts.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "One of the card's contacts.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardContact(pub ::uuid::Uuid);
impl ::std::ops::Deref for CardContact {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CardContact> for ::uuid::Uuid {
    fn from(value: CardContact) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CardContact {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardContact {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardContact {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardContact {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardContact {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The list of contacts for a [company card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of contacts for a [company card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards).",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/CardContact"
///  },
///  "maxItems": 5,
///  "minItems": 1,
///  "uniqueItems": true
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardContacts(pub Vec<CardContact>);
impl ::std::ops::Deref for CardContacts {
    type Target = Vec<CardContact>;
    fn deref(&self) -> &Vec<CardContact> {
        &self.0
    }
}
impl ::std::convert::From<CardContacts> for Vec<CardContact> {
    fn from(value: CardContacts) -> Self {
        value.0
    }
}
impl ::std::convert::From<Vec<CardContact>> for CardContacts {
    fn from(value: Vec<CardContact>) -> Self {
        Self(value)
    }
}
///`CardCreatedResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "accounts",
///    "created_at",
///    "expiry",
///    "id",
///    "last_digits",
///    "state",
///    "updated_at",
///    "virtual"
///  ],
///  "properties": {
///    "accounts": {
///      "description": "The list of linked accounts.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uuid"
///      }
///    },
///    "can_be_unlocked": {
///      "$ref": "#/components/schemas/CardCanBeUnlocked"
///    },
///    "categories": {
///      "description": "The list of merchant categories that are available for card spending.             \nIf this parameter is not specified, categories are not restricted.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/BusinessMerchantCategory"
///      }
///    },
///    "contact_ids": {
///      "$ref": "#/components/schemas/CardContacts"
///    },
///    "countries": {
///      "description": "The list of countries where the card can be used, specified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "pattern": "^[A-Z]{2}$"
///      }
///    },
///    "created_at": {
///      "description": "The date and time the card was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "expiry": {
///      "description": "The card expiration date.",
///      "type": "string",
///      "format": "DD/YYYY",
///      "pattern": "^[0-9]{2}/[0-9]{4}$"
///    },
///    "holder_id": {
///      "description": "The ID of the team member who is the holder of the card.\nIf the card belongs to the business, this will be empty.\n\nFor more information, see the guides: [Manage Cards - Create a virtual card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#create-a-virtual-card).",
///      "type": "string",
///      "format": "uuid"
///    },
///    "id": {
///      "description": "The ID of the card.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "label": {
///      "description": "The label of the card.",
///      "type": "string"
///    },
///    "last_digits": {
///      "description": "The last 4 digits of the card's PAN.",
///      "type": "string",
///      "pattern": "^[0-9]{4}$"
///    },
///    "merchant_controls": {
///      "$ref": "#/components/schemas/MerchantControlsSchema"
///    },
///    "product": {
///      "$ref": "#/components/schemas/CardProduct"
///    },
///    "references": {
///      "$ref": "#/components/schemas/CardReferences"
///    },
///    "spending_limits": {
///      "$ref": "#/components/schemas/SpendingLimits"
///    },
///    "spending_period": {
///      "description": "The controls for the card's spending period.\n\nThey specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.",
///      "type": "object",
///      "allOf": [
///        {
///          "$ref": "#/components/schemas/SpendingPeriodSchema"
///        }
///      ]
///    },
///    "state": {
///      "$ref": "#/components/schemas/CardState"
///    },
///    "updated_at": {
///      "description": "The date and time the card was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "virtual": {
///      "description": "Specifies whether the card is virtual (`true`) or physical (`false`).",
///      "type": "boolean"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardCreatedResponse {
    ///The list of linked accounts.
    pub accounts: ::std::vec::Vec<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub can_be_unlocked: ::std::option::Option<CardCanBeUnlocked>,
    /// The list of merchant categories that are available for card spending.
    /// If this parameter is not specified, categories are not restricted.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub categories: ::std::vec::Vec<BusinessMerchantCategory>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub contact_ids: ::std::option::Option<CardContacts>,
    ///The list of countries where the card can be used, specified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub countries: ::std::vec::Vec<CardCreatedResponseCountriesItem>,
    ///The date and time the card was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The card expiration date.
    pub expiry: ::std::string::String,
    /// The ID of the team member who is the holder of the card.
    /// If the card belongs to the business, this will be empty.
    ///
    /// For more information, see the guides: [Manage Cards - Create a virtual card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#create-a-virtual-card).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub holder_id: ::std::option::Option<::uuid::Uuid>,
    ///The ID of the card.
    pub id: ::uuid::Uuid,
    ///The label of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub label: ::std::option::Option<::std::string::String>,
    ///The last 4 digits of the card's PAN.
    pub last_digits: CardCreatedResponseLastDigits,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_controls: ::std::option::Option<MerchantControlsSchema>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub product: ::std::option::Option<CardProduct>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub references: ::std::option::Option<CardReferences>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_limits: ::std::option::Option<SpendingLimits>,
    /// The controls for the card's spending period.
    ///
    /// They specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_period: ::std::option::Option<SpendingPeriodSchema>,
    pub state: CardState,
    ///The date and time the card was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///Specifies whether the card is virtual (`true`) or physical (`false`).
    #[serde(rename = "virtual")]
    pub virtual_: bool,
}
///`CardCreatedResponseCountriesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardCreatedResponseCountriesItem(::std::string::String);
impl ::std::ops::Deref for CardCreatedResponseCountriesItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardCreatedResponseCountriesItem> for ::std::string::String {
    fn from(value: CardCreatedResponseCountriesItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardCreatedResponseCountriesItem {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardCreatedResponseCountriesItem {
    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 CardCreatedResponseCountriesItem {
    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 CardCreatedResponseCountriesItem {
    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 CardCreatedResponseCountriesItem {
    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 last 4 digits of the card's PAN.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last 4 digits of the card's PAN.",
///  "type": "string",
///  "pattern": "^[0-9]{4}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardCreatedResponseLastDigits(::std::string::String);
impl ::std::ops::Deref for CardCreatedResponseLastDigits {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardCreatedResponseLastDigits> for ::std::string::String {
    fn from(value: CardCreatedResponseLastDigits) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardCreatedResponseLastDigits {
    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]{4}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[0-9]{4}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardCreatedResponseLastDigits {
    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 CardCreatedResponseLastDigits {
    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 CardCreatedResponseLastDigits {
    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 CardCreatedResponseLastDigits {
    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 list of accounts that will be linked to the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of accounts that will be linked to the card.",
///  "type": "array",
///  "items": {
///    "type": "string",
///    "format": "uuid"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationAccounts(pub ::std::vec::Vec<::uuid::Uuid>);
impl ::std::ops::Deref for CardInvitationAccounts {
    type Target = ::std::vec::Vec<::uuid::Uuid>;
    fn deref(&self) -> &::std::vec::Vec<::uuid::Uuid> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationAccounts> for ::std::vec::Vec<::uuid::Uuid> {
    fn from(value: CardInvitationAccounts) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<::uuid::Uuid>> for CardInvitationAccounts {
    fn from(value: ::std::vec::Vec<::uuid::Uuid>) -> Self {
        Self(value)
    }
}
/// The ID of the card issued after this invitation was claimed.
/// :::note
/// Only returned for invitations in state `redeemed`.
/// :::
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the card issued after this invitation was claimed. \n:::note\nOnly returned for invitations in state `redeemed`.\n:::\n",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationCardId(pub ::uuid::Uuid);
impl ::std::ops::Deref for CardInvitationCardId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCardId> for ::uuid::Uuid {
    fn from(value: CardInvitationCardId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CardInvitationCardId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationCardId {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationCardId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationCardId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationCardId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The list of merchant categories that will be available for card spending.
/// If this parameter is not specified, categories are not restricted.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of merchant categories that will be available for card spending.             \nIf this parameter is not specified, categories are not restricted.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/BusinessMerchantCategory"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationCategories(pub ::std::vec::Vec<BusinessMerchantCategory>);
impl ::std::ops::Deref for CardInvitationCategories {
    type Target = ::std::vec::Vec<BusinessMerchantCategory>;
    fn deref(&self) -> &::std::vec::Vec<BusinessMerchantCategory> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCategories> for ::std::vec::Vec<BusinessMerchantCategory> {
    fn from(value: CardInvitationCategories) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<BusinessMerchantCategory>> for CardInvitationCategories {
    fn from(value: ::std::vec::Vec<BusinessMerchantCategory>) -> Self {
        Self(value)
    }
}
/// The list of countries where the team member will be able to use the card.
/// Specified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of countries where the team member will be able to use the card.\nSpecified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.",
///  "type": "array",
///  "items": {
///    "type": "string",
///    "pattern": "^[A-Z]{2}$"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationCountries(pub ::std::vec::Vec<CardInvitationCountriesItem>);
impl ::std::ops::Deref for CardInvitationCountries {
    type Target = ::std::vec::Vec<CardInvitationCountriesItem>;
    fn deref(&self) -> &::std::vec::Vec<CardInvitationCountriesItem> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCountries>
    for ::std::vec::Vec<CardInvitationCountriesItem>
{
    fn from(value: CardInvitationCountries) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<CardInvitationCountriesItem>>
    for CardInvitationCountries
{
    fn from(value: ::std::vec::Vec<CardInvitationCountriesItem>) -> Self {
        Self(value)
    }
}
///`CardInvitationCountriesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardInvitationCountriesItem(::std::string::String);
impl ::std::ops::Deref for CardInvitationCountriesItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCountriesItem> for ::std::string::String {
    fn from(value: CardInvitationCountriesItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardInvitationCountriesItem {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationCountriesItem {
    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 CardInvitationCountriesItem {
    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 CardInvitationCountriesItem {
    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 CardInvitationCountriesItem {
    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 date and time the card invitation was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the card invitation was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationCreatedAt(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for CardInvitationCreatedAt {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCreatedAt> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: CardInvitationCreatedAt) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for CardInvitationCreatedAt {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationCreatedAt {
    type Err = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationCreatedAt {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationCreatedAt {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationCreatedAt {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ID of the team member to be assigned as the holder of the card after the invitation is claimed.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the team member to be assigned as the holder of the card after the invitation is claimed.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationCreatedHolderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for CardInvitationCreatedHolderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationCreatedHolderId> for ::uuid::Uuid {
    fn from(value: CardInvitationCreatedHolderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CardInvitationCreatedHolderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationCreatedHolderId {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationCreatedHolderId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationCreatedHolderId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationCreatedHolderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`CardInvitationCreatedResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "accounts",
///    "created_at",
///    "id",
///    "state",
///    "updated_at",
///    "virtual"
///  ],
///  "properties": {
///    "accounts": {
///      "$ref": "#/components/schemas/CardInvitationAccounts"
///    },
///    "categories": {
///      "$ref": "#/components/schemas/CardInvitationCategories"
///    },
///    "countries": {
///      "$ref": "#/components/schemas/CardInvitationCountries"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/CardInvitationCreatedAt"
///    },
///    "expiry_date": {
///      "$ref": "#/components/schemas/CardInvitationExpiryDate"
///    },
///    "holder_id": {
///      "$ref": "#/components/schemas/CardInvitationCreatedHolderId"
///    },
///    "id": {
///      "$ref": "#/components/schemas/CardInvitationId"
///    },
///    "label": {
///      "$ref": "#/components/schemas/CardInvitationLabel"
///    },
///    "merchant_controls": {
///      "$ref": "#/components/schemas/CardInvitationMerchantControls"
///    },
///    "spending_limits": {
///      "$ref": "#/components/schemas/SpendingLimits"
///    },
///    "spending_period": {
///      "$ref": "#/components/schemas/CardInvitationSpendingPeriod"
///    },
///    "state": {
///      "$ref": "#/components/schemas/CardInvitationState"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/CardInvitationUpdatedAt"
///    },
///    "virtual": {
///      "$ref": "#/components/schemas/CardInvitationVirtual"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardInvitationCreatedResponse {
    pub accounts: CardInvitationAccounts,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub categories: ::std::option::Option<CardInvitationCategories>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub countries: ::std::option::Option<CardInvitationCountries>,
    pub created_at: CardInvitationCreatedAt,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_date: ::std::option::Option<CardInvitationExpiryDate>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub holder_id: ::std::option::Option<CardInvitationCreatedHolderId>,
    pub id: CardInvitationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub label: ::std::option::Option<CardInvitationLabel>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_controls: ::std::option::Option<CardInvitationMerchantControls>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_limits: ::std::option::Option<SpendingLimits>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_period: ::std::option::Option<CardInvitationSpendingPeriod>,
    pub state: CardInvitationState,
    pub updated_at: CardInvitationUpdatedAt,
    #[serde(rename = "virtual")]
    pub virtual_: CardInvitationVirtual,
}
/// The date and time after which this card invitation expires if not claimed or cancelled before then.
/// Specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
/// ::::::note
/// Only returned for invitations in state `created`.
/// :::tip
/// For other states, to find out when a card invitation transitioned to its [final state](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-card-invitations#card-invitation-state), check the `updated_at` value.
/// :::
/// ::::::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time after which this card invitation expires if not claimed or cancelled before then.\nSpecified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n::::::note\nOnly returned for invitations in state `created`.\n:::tip\nFor other states, to find out when a card invitation transitioned to its [final state](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-card-invitations#card-invitation-state), check the `updated_at` value. \n:::\n::::::",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationExpiryDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for CardInvitationExpiryDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationExpiryDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: CardInvitationExpiryDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for CardInvitationExpiryDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationExpiryDate {
    type Err = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationExpiryDate {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationExpiryDate {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationExpiryDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The ID of the team member to be assigned as the holder of the card after the invitation is claimed.
///
/// :::note
/// If the team member has been deleted since the invitation was created, the `holder_id` is not returned.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the team member to be assigned as the holder of the card after the invitation is claimed.\n\n:::note\nIf the team member has been deleted since the invitation was created, the `holder_id` is not returned.\n:::",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationHolderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for CardInvitationHolderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationHolderId> for ::uuid::Uuid {
    fn from(value: CardInvitationHolderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CardInvitationHolderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationHolderId {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationHolderId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationHolderId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationHolderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ID of the card invitation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the card invitation.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationId(pub ::uuid::Uuid);
impl ::std::ops::Deref for CardInvitationId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationId> for ::uuid::Uuid {
    fn from(value: CardInvitationId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CardInvitationId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationId {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The label of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The label of the card.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CardInvitationLabel(pub ::std::string::String);
impl ::std::ops::Deref for CardInvitationLabel {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationLabel> for ::std::string::String {
    fn from(value: CardInvitationLabel) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CardInvitationLabel {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationLabel {
    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 CardInvitationLabel {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`CardInvitationMerchantControls`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "$ref": "#/components/schemas/MerchantControlsSchema"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationMerchantControls(pub MerchantControlsSchema);
impl ::std::ops::Deref for CardInvitationMerchantControls {
    type Target = MerchantControlsSchema;
    fn deref(&self) -> &MerchantControlsSchema {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationMerchantControls> for MerchantControlsSchema {
    fn from(value: CardInvitationMerchantControls) -> Self {
        value.0
    }
}
impl ::std::convert::From<MerchantControlsSchema> for CardInvitationMerchantControls {
    fn from(value: MerchantControlsSchema) -> Self {
        Self(value)
    }
}
///`CardInvitationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "accounts",
///    "created_at",
///    "id",
///    "state",
///    "updated_at",
///    "virtual"
///  ],
///  "properties": {
///    "accounts": {
///      "$ref": "#/components/schemas/CardInvitationAccounts"
///    },
///    "card_id": {
///      "$ref": "#/components/schemas/CardInvitationCardId"
///    },
///    "categories": {
///      "$ref": "#/components/schemas/CardInvitationCategories"
///    },
///    "countries": {
///      "$ref": "#/components/schemas/CardInvitationCountries"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/CardInvitationCreatedAt"
///    },
///    "expiry_date": {
///      "$ref": "#/components/schemas/CardInvitationExpiryDate"
///    },
///    "holder_id": {
///      "$ref": "#/components/schemas/CardInvitationHolderId"
///    },
///    "id": {
///      "$ref": "#/components/schemas/CardInvitationId"
///    },
///    "label": {
///      "$ref": "#/components/schemas/CardInvitationLabel"
///    },
///    "merchant_controls": {
///      "$ref": "#/components/schemas/CardInvitationMerchantControls"
///    },
///    "spend_program": {
///      "$ref": "#/components/schemas/SpendProgram"
///    },
///    "spending_limits": {
///      "$ref": "#/components/schemas/SpendingLimits"
///    },
///    "spending_period": {
///      "$ref": "#/components/schemas/CardInvitationSpendingPeriod"
///    },
///    "state": {
///      "$ref": "#/components/schemas/CardInvitationState"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/CardInvitationUpdatedAt"
///    },
///    "virtual": {
///      "$ref": "#/components/schemas/CardInvitationVirtual"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardInvitationResponse {
    pub accounts: CardInvitationAccounts,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_id: ::std::option::Option<CardInvitationCardId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub categories: ::std::option::Option<CardInvitationCategories>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub countries: ::std::option::Option<CardInvitationCountries>,
    pub created_at: CardInvitationCreatedAt,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_date: ::std::option::Option<CardInvitationExpiryDate>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub holder_id: ::std::option::Option<CardInvitationHolderId>,
    pub id: CardInvitationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub label: ::std::option::Option<CardInvitationLabel>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_controls: ::std::option::Option<CardInvitationMerchantControls>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spend_program: ::std::option::Option<SpendProgram>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_limits: ::std::option::Option<SpendingLimits>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_period: ::std::option::Option<CardInvitationSpendingPeriod>,
    pub state: CardInvitationState,
    pub updated_at: CardInvitationUpdatedAt,
    #[serde(rename = "virtual")]
    pub virtual_: CardInvitationVirtual,
}
///`CardInvitationSpendProgram`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "$ref": "#/components/schemas/SpendProgram"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationSpendProgram(pub SpendProgram);
impl ::std::ops::Deref for CardInvitationSpendProgram {
    type Target = SpendProgram;
    fn deref(&self) -> &SpendProgram {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationSpendProgram> for SpendProgram {
    fn from(value: CardInvitationSpendProgram) -> Self {
        value.0
    }
}
impl ::std::convert::From<SpendProgram> for CardInvitationSpendProgram {
    fn from(value: SpendProgram) -> Self {
        Self(value)
    }
}
///`CardInvitationSpendingLimits`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "$ref": "#/components/schemas/SpendingLimits"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationSpendingLimits(pub SpendingLimits);
impl ::std::ops::Deref for CardInvitationSpendingLimits {
    type Target = SpendingLimits;
    fn deref(&self) -> &SpendingLimits {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationSpendingLimits> for SpendingLimits {
    fn from(value: CardInvitationSpendingLimits) -> Self {
        value.0
    }
}
impl ::std::convert::From<SpendingLimits> for CardInvitationSpendingLimits {
    fn from(value: SpendingLimits) -> Self {
        Self(value)
    }
}
/// The controls for the card's spending period.
///
/// They specify the dates when the card will become available or unavailable for spending, and define what happens after the end date.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The controls for the card's spending period.\n\nThey specify the dates when the card will become available or unavailable for spending, and define what happens after the end date.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/SpendingPeriodSchema"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationSpendingPeriod(pub SpendingPeriodSchema);
impl ::std::ops::Deref for CardInvitationSpendingPeriod {
    type Target = SpendingPeriodSchema;
    fn deref(&self) -> &SpendingPeriodSchema {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationSpendingPeriod> for SpendingPeriodSchema {
    fn from(value: CardInvitationSpendingPeriod) -> Self {
        value.0
    }
}
impl ::std::convert::From<SpendingPeriodSchema> for CardInvitationSpendingPeriod {
    fn from(value: SpendingPeriodSchema) -> Self {
        Self(value)
    }
}
/// The current state of the card invitation:
/// - **`created`**: Invitation has been created but not yet claimed.
/// - **`expired`**: Invitation has expired due to expiry date being reached or manual cancellation.
/// - **`failed`**: Invitation claim attempt failed.
/// - **`redeemed`**: Invitation has been successfully claimed.
///
/// To learn more about card invitation lifecycle, see the guide: [Manage card invitations → Card invitation state](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-card-invitations#card-invitation-state).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The current state of the card invitation:\n- **`created`**: Invitation has been created but not yet claimed.\n- **`expired`**: Invitation has expired due to expiry date being reached or manual cancellation.\n- **`failed`**: Invitation claim attempt failed.\n- **`redeemed`**: Invitation has been successfully claimed.\n\nTo learn more about card invitation lifecycle, see the guide: [Manage card invitations → Card invitation state](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-card-invitations#card-invitation-state).",
///  "type": "string",
///  "enum": [
///    "created",
///    "expired",
///    "failed",
///    "redeemed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardInvitationState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "expired")]
    Expired,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "redeemed")]
    Redeemed,
}
impl ::std::fmt::Display for CardInvitationState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("created"),
            Self::Expired => f.write_str("expired"),
            Self::Failed => f.write_str("failed"),
            Self::Redeemed => f.write_str("redeemed"),
        }
    }
}
impl ::std::str::FromStr for CardInvitationState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "created" => Ok(Self::Created),
            "expired" => Ok(Self::Expired),
            "failed" => Ok(Self::Failed),
            "redeemed" => Ok(Self::Redeemed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationState {
    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 CardInvitationState {
    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 CardInvitationState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The date and time the card invitation was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the card invitation was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationUpdatedAt(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for CardInvitationUpdatedAt {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationUpdatedAt> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: CardInvitationUpdatedAt) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for CardInvitationUpdatedAt {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationUpdatedAt {
    type Err = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationUpdatedAt {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationUpdatedAt {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationUpdatedAt {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`CardInvitationUpdatedResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "accounts",
///    "created_at",
///    "id",
///    "state",
///    "updated_at",
///    "virtual"
///  ],
///  "properties": {
///    "accounts": {
///      "$ref": "#/components/schemas/CardInvitationAccounts"
///    },
///    "categories": {
///      "$ref": "#/components/schemas/CardInvitationCategories"
///    },
///    "countries": {
///      "$ref": "#/components/schemas/CardInvitationCountries"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/CardInvitationCreatedAt"
///    },
///    "expiry_date": {
///      "$ref": "#/components/schemas/CardInvitationExpiryDate"
///    },
///    "holder_id": {
///      "$ref": "#/components/schemas/CardInvitationCreatedHolderId"
///    },
///    "id": {
///      "$ref": "#/components/schemas/CardInvitationId"
///    },
///    "label": {
///      "$ref": "#/components/schemas/CardInvitationLabel"
///    },
///    "merchant_controls": {
///      "$ref": "#/components/schemas/CardInvitationMerchantControls"
///    },
///    "spend_program": {
///      "$ref": "#/components/schemas/SpendProgram"
///    },
///    "spending_limits": {
///      "$ref": "#/components/schemas/SpendingLimits"
///    },
///    "spending_period": {
///      "$ref": "#/components/schemas/CardInvitationSpendingPeriod"
///    },
///    "state": {
///      "$ref": "#/components/schemas/CardInvitationState"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/CardInvitationUpdatedAt"
///    },
///    "virtual": {
///      "$ref": "#/components/schemas/CardInvitationVirtual"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardInvitationUpdatedResponse {
    pub accounts: CardInvitationAccounts,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub categories: ::std::option::Option<CardInvitationCategories>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub countries: ::std::option::Option<CardInvitationCountries>,
    pub created_at: CardInvitationCreatedAt,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_date: ::std::option::Option<CardInvitationExpiryDate>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub holder_id: ::std::option::Option<CardInvitationCreatedHolderId>,
    pub id: CardInvitationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub label: ::std::option::Option<CardInvitationLabel>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_controls: ::std::option::Option<CardInvitationMerchantControls>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spend_program: ::std::option::Option<SpendProgram>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_limits: ::std::option::Option<SpendingLimits>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_period: ::std::option::Option<CardInvitationSpendingPeriod>,
    pub state: CardInvitationState,
    pub updated_at: CardInvitationUpdatedAt,
    #[serde(rename = "virtual")]
    pub virtual_: CardInvitationVirtual,
}
///Specifies whether the issued card will be a virtual (`true`) or physical (`false`) one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Specifies whether the issued card will be a virtual (`true`) or physical (`false`) one.",
///  "type": "boolean"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationVirtual(pub bool);
impl ::std::ops::Deref for CardInvitationVirtual {
    type Target = bool;
    fn deref(&self) -> &bool {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationVirtual> for bool {
    fn from(value: CardInvitationVirtual) -> Self {
        value.0
    }
}
impl ::std::convert::From<bool> for CardInvitationVirtual {
    fn from(value: bool) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardInvitationVirtual {
    type Err = <bool as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for CardInvitationVirtual {
    type Error = <bool as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardInvitationVirtual {
    type Error = <bool as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardInvitationVirtual {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///A list of card invitations
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of card invitations",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/CardInvitationResponse"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardInvitationsResponse(pub ::std::vec::Vec<CardInvitationResponse>);
impl ::std::ops::Deref for CardInvitationsResponse {
    type Target = ::std::vec::Vec<CardInvitationResponse>;
    fn deref(&self) -> &::std::vec::Vec<CardInvitationResponse> {
        &self.0
    }
}
impl ::std::convert::From<CardInvitationsResponse> for ::std::vec::Vec<CardInvitationResponse> {
    fn from(value: CardInvitationsResponse) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<CardInvitationResponse>> for CardInvitationsResponse {
    fn from(value: ::std::vec::Vec<CardInvitationResponse>) -> Self {
        Self(value)
    }
}
/// The card product offered by the card provider for this card.
/// In other words, the program that the card was issued under.
///
/// :::note
/// This property is only available to travel intermediaries using our travel solution.
/// To use it, please contact [Revolut API Support](mailto:api-requests@revolut.com).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The card product offered by the card provider for this card.\nIn other words, the program that the card was issued under.\n\n:::note\nThis property is only available to travel intermediaries using our travel solution.\nTo use it, please contact [Revolut API Support](mailto:api-requests@revolut.com).\n:::",
///  "type": "object",
///  "required": [
///    "code"
///  ],
///  "properties": {
///    "code": {
///      "description": "The code of the card product.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardProduct {
    ///The code of the card product.
    pub code: ::std::string::String,
}
/// Reference for the card.
/// One of the name-value pairs assigned to the card for tracking.
///
/// :::info
/// Each time the card is used, the references are recorded in the [transaction details](https://developer.revolut.com/docs/business/get-transaction#response) (`card.references`), helping track transactions made with this card.
/// :::
///
/// The names must be unique.
/// The references can be [amended](https://developer.revolut.com/docs/business/update-card-references) up to 10 times.
/// References are only supported for cards owned by the business (i.e. [company](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) or [auto-issued cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards)).
/// They are **not** supported for [team member cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) (i.e. with `holder_id` present).
///
/// :::note
/// The references recorded on a transaction are those assigned to the card at the time the transaction took place.
/// If the references are amended, the new references are only applied to future transactions.
/// Existing transaction are not affected.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Reference for the card.\nOne of the name-value pairs assigned to the card for tracking.\n\n:::info\nEach time the card is used, the references are recorded in the [transaction details](https://developer.revolut.com/docs/business/get-transaction#response) (`card.references`), helping track transactions made with this card.\n:::\n\nThe names must be unique.\nThe references can be [amended](https://developer.revolut.com/docs/business/update-card-references) up to 10 times.\nReferences are only supported for cards owned by the business (i.e. [company](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) or [auto-issued cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards)).\nThey are **not** supported for [team member cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) (i.e. with `holder_id` present). \n\n:::note\nThe references recorded on a transaction are those assigned to the card at the time the transaction took place.\nIf the references are amended, the new references are only applied to future transactions.\nExisting transaction are not affected.\n:::",
///  "type": "object",
///  "required": [
///    "name",
///    "value"
///  ],
///  "properties": {
///    "name": {
///      "description": "The name of the card reference.\nMust be unique.",
///      "type": "string",
///      "maxLength": 30,
///      "minLength": 1
///    },
///    "value": {
///      "description": "The value for this reference.",
///      "type": "string",
///      "maxLength": 30,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardReference {
    /// The name of the card reference.
    /// Must be unique.
    pub name: CardReferenceName,
    ///The value for this reference.
    pub value: CardReferenceValue,
}
/// The name of the card reference.
/// Must be unique.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the card reference.\nMust be unique.",
///  "type": "string",
///  "maxLength": 30,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardReferenceName(::std::string::String);
impl ::std::ops::Deref for CardReferenceName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardReferenceName> for ::std::string::String {
    fn from(value: CardReferenceName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardReferenceName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 30usize {
            return Err("longer than 30 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 CardReferenceName {
    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 CardReferenceName {
    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 CardReferenceName {
    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 CardReferenceName {
    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 value for this reference.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The value for this reference.",
///  "type": "string",
///  "maxLength": 30,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardReferenceValue(::std::string::String);
impl ::std::ops::Deref for CardReferenceValue {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardReferenceValue> for ::std::string::String {
    fn from(value: CardReferenceValue) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardReferenceValue {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 30usize {
            return Err("longer than 30 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 CardReferenceValue {
    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 CardReferenceValue {
    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 CardReferenceValue {
    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 CardReferenceValue {
    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())
            })
    }
}
/// References for the card.
/// Up to 5 name-value pairs assigned to the card for tracking.
///
/// :::info
/// Each time the card is used, the references are recorded in the [transaction details](https://developer.revolut.com/docs/business/get-transaction#response) (`card.references`), helping track transactions made with this card.
/// :::
///
/// The names must be unique.
/// The references can be [amended](https://developer.revolut.com/docs/business/update-card-references) up to 10 times.
///
/// References are only supported for cards owned by the business (i.e. [company](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) or [auto-issued cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards)).
/// They are **not** supported for [team member cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) (i.e. with `holder_id` present).
///
/// :::note
/// The references recorded on a transaction are those assigned to the card at the time the transaction took place.
/// If the references are amended, they will only be applied to future transactions.
/// Existing transaction are not affected.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "References for the card.\nUp to 5 name-value pairs assigned to the card for tracking.\n\n:::info\nEach time the card is used, the references are recorded in the [transaction details](https://developer.revolut.com/docs/business/get-transaction#response) (`card.references`), helping track transactions made with this card.\n:::\n\nThe names must be unique.\nThe references can be [amended](https://developer.revolut.com/docs/business/update-card-references) up to 10 times.\n\nReferences are only supported for cards owned by the business (i.e. [company](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) or [auto-issued cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards)).\nThey are **not** supported for [team member cards](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#different-types-of-cards) (i.e. with `holder_id` present).\n\n:::note\nThe references recorded on a transaction are those assigned to the card at the time the transaction took place.\nIf the references are amended, they will only be applied to future transactions.\nExisting transaction are not affected.\n:::",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/CardReference"
///  },
///  "maxItems": 5,
///  "minItems": 1,
///  "uniqueItems": true
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardReferences(pub Vec<CardReference>);
impl ::std::ops::Deref for CardReferences {
    type Target = Vec<CardReference>;
    fn deref(&self) -> &Vec<CardReference> {
        &self.0
    }
}
impl ::std::convert::From<CardReferences> for Vec<CardReference> {
    fn from(value: CardReferences) -> Self {
        value.0
    }
}
impl ::std::convert::From<Vec<CardReference>> for CardReferences {
    fn from(value: Vec<CardReference>) -> Self {
        Self(value)
    }
}
///`CardResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "accounts",
///    "created_at",
///    "expiry",
///    "id",
///    "last_digits",
///    "state",
///    "updated_at",
///    "virtual"
///  ],
///  "properties": {
///    "accounts": {
///      "description": "The list of linked accounts.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uuid"
///      }
///    },
///    "can_be_unlocked": {
///      "$ref": "#/components/schemas/CardCanBeUnlocked"
///    },
///    "categories": {
///      "description": "The list of merchant categories that are available for card spending. If not specified, categories are not restricted.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/BusinessMerchantCategory"
///      }
///    },
///    "contact_ids": {
///      "$ref": "#/components/schemas/CardContacts"
///    },
///    "countries": {
///      "description": "The list of countries where the card can be used, specified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "pattern": "^[A-Z]{2}$"
///      }
///    },
///    "created_at": {
///      "description": "The date and time the card was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "expiry": {
///      "description": "The card expiration date.",
///      "type": "string",
///      "format": "DD/YYYY",
///      "pattern": "^[0-9]{2}/[0-9]{4}$"
///    },
///    "holder_id": {
///      "description": "The ID of the team member who is the holder of the card.\nIf the card belongs to the business, this will be empty.\n\nFor more information, see the guides: [Manage Cards - Create a virtual card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#create-a-virtual-card).",
///      "type": "string",
///      "format": "uuid"
///    },
///    "id": {
///      "description": "The ID of the card.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "label": {
///      "description": "The label of the card.",
///      "type": "string"
///    },
///    "last_digits": {
///      "description": "The last 4 digits of the card's PAN.",
///      "type": "string",
///      "pattern": "^[0-9]{4}$"
///    },
///    "merchant_controls": {
///      "$ref": "#/components/schemas/MerchantControlsSchema"
///    },
///    "product": {
///      "$ref": "#/components/schemas/CardProduct"
///    },
///    "references": {
///      "$ref": "#/components/schemas/CardReferences"
///    },
///    "spend_program": {
///      "$ref": "#/components/schemas/SpendProgram"
///    },
///    "spending_limits": {
///      "$ref": "#/components/schemas/SpendingLimits"
///    },
///    "spending_period": {
///      "description": "The controls for the card's spending period.\n\nThey specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.",
///      "type": "object",
///      "allOf": [
///        {
///          "$ref": "#/components/schemas/SpendingPeriodSchema"
///        }
///      ]
///    },
///    "state": {
///      "$ref": "#/components/schemas/CardState"
///    },
///    "updated_at": {
///      "description": "The date and time the card was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "virtual": {
///      "description": "Specifies whether the card is virtual (`true`) or physical (`false`).",
///      "type": "boolean"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardResponse {
    ///The list of linked accounts.
    pub accounts: ::std::vec::Vec<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub can_be_unlocked: ::std::option::Option<CardCanBeUnlocked>,
    ///The list of merchant categories that are available for card spending. If not specified, categories are not restricted.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub categories: ::std::vec::Vec<BusinessMerchantCategory>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub contact_ids: ::std::option::Option<CardContacts>,
    ///The list of countries where the card can be used, specified as 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) codes.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub countries: ::std::vec::Vec<CardResponseCountriesItem>,
    ///The date and time the card was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The card expiration date.
    pub expiry: ::std::string::String,
    /// The ID of the team member who is the holder of the card.
    /// If the card belongs to the business, this will be empty.
    ///
    /// For more information, see the guides: [Manage Cards - Create a virtual card](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#create-a-virtual-card).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub holder_id: ::std::option::Option<::uuid::Uuid>,
    ///The ID of the card.
    pub id: ::uuid::Uuid,
    ///The label of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub label: ::std::option::Option<::std::string::String>,
    ///The last 4 digits of the card's PAN.
    pub last_digits: CardResponseLastDigits,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_controls: ::std::option::Option<MerchantControlsSchema>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub product: ::std::option::Option<CardProduct>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub references: ::std::option::Option<CardReferences>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spend_program: ::std::option::Option<SpendProgram>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_limits: ::std::option::Option<SpendingLimits>,
    /// The controls for the card's spending period.
    ///
    /// They specify the dates when the card becomes available or unavailable for spending, and define what happens after the end date.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub spending_period: ::std::option::Option<SpendingPeriodSchema>,
    pub state: CardState,
    ///The date and time the card was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///Specifies whether the card is virtual (`true`) or physical (`false`).
    #[serde(rename = "virtual")]
    pub virtual_: bool,
}
///`CardResponseCountriesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardResponseCountriesItem(::std::string::String);
impl ::std::ops::Deref for CardResponseCountriesItem {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardResponseCountriesItem> for ::std::string::String {
    fn from(value: CardResponseCountriesItem) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardResponseCountriesItem {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardResponseCountriesItem {
    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 CardResponseCountriesItem {
    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 CardResponseCountriesItem {
    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 CardResponseCountriesItem {
    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 last 4 digits of the card's PAN.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last 4 digits of the card's PAN.",
///  "type": "string",
///  "pattern": "^[0-9]{4}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardResponseLastDigits(::std::string::String);
impl ::std::ops::Deref for CardResponseLastDigits {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardResponseLastDigits> for ::std::string::String {
    fn from(value: CardResponseLastDigits) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardResponseLastDigits {
    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]{4}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[0-9]{4}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardResponseLastDigits {
    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 CardResponseLastDigits {
    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 CardResponseLastDigits {
    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 CardResponseLastDigits {
    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 state that the card is in.
///
/// Possible values:
/// - `active`: The card is available for spending.
///   Newly created cards typically go into `active` unless subject to certain conditions, for example, spending period starting in the future.
/// - `frozen`: The card has been frozen and is temporarily unavailable for spending.
/// - `locked`: The card is locked, typically due to an [admin lock](https://developer.revolut.com/docs/business/lock-card) or spending period settings, i.e. when its `spending_period.start_date` is in the future or `spending_period.end_date` is in the past.
///   A locked card is unavailable for spending until it's [unlocked](https://developer.revolut.com/docs/business/unlock-card) and active.
///   :::tip
///   To see if the card can be unlocked, check the `can_be_unlocked` parameter.
///   Note that you'll still need the [necessary scope or permission](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#lock-or-unlock-cards) to unlock it.
///   :::
/// - `created`: The card has been created but is not yet active.
///   Used only for a specific type of cards.
/// - `pending`: This status is currently not in use.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state that the card is in.\n\nPossible values:\n- `active`: The card is available for spending. \n  Newly created cards typically go into `active` unless subject to certain conditions, for example, spending period starting in the future.\n- `frozen`: The card has been frozen and is temporarily unavailable for spending. \n- `locked`: The card is locked, typically due to an [admin lock](https://developer.revolut.com/docs/business/lock-card) or spending period settings, i.e. when its `spending_period.start_date` is in the future or `spending_period.end_date` is in the past.\n  A locked card is unavailable for spending until it's [unlocked](https://developer.revolut.com/docs/business/unlock-card) and active.\n  :::tip\n  To see if the card can be unlocked, check the `can_be_unlocked` parameter.\n  Note that you'll still need the [necessary scope or permission](https://developer.revolut.com/docs/guides/manage-accounts/cards/manage-cards#lock-or-unlock-cards) to unlock it.\n  :::\n- `created`: The card has been created but is not yet active.\n  Used only for a specific type of cards.\n- `pending`: This status is currently not in use.",
///  "type": "string",
///  "enum": [
///    "created",
///    "pending",
///    "active",
///    "frozen",
///    "locked"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "frozen")]
    Frozen,
    #[serde(rename = "locked")]
    Locked,
}
impl ::std::fmt::Display for CardState {
    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::Active => f.write_str("active"),
            Self::Frozen => f.write_str("frozen"),
            Self::Locked => f.write_str("locked"),
        }
    }
}
impl ::std::str::FromStr for CardState {
    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),
            "active" => Ok(Self::Active),
            "frozen" => Ok(Self::Frozen),
            "locked" => Ok(Self::Locked),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardState {
    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 CardState {
    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 CardState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A list of cards.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of cards.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/CardResponse"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardsResponse(pub ::std::vec::Vec<CardResponse>);
impl ::std::ops::Deref for CardsResponse {
    type Target = ::std::vec::Vec<CardResponse>;
    fn deref(&self) -> &::std::vec::Vec<CardResponse> {
        &self.0
    }
}
impl ::std::convert::From<CardsResponse> for ::std::vec::Vec<CardResponse> {
    fn from(value: CardsResponse) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<CardResponse>> for CardsResponse {
    fn from(value: ::std::vec::Vec<CardResponse>) -> Self {
        Self(value)
    }
}
///The [accounting category](https://developer.revolut.com/docs/business/accounting-categories) of the expense split.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The [accounting category](https://developer.revolut.com/docs/business/accounting-categories) of the expense split.",
///  "type": "object",
///  "required": [
///    "id",
///    "name"
///  ],
///  "properties": {
///    "code": {
///      "description": "The code of the accounting category.",
///      "type": "string"
///    },
///    "id": {
///      "description": "The ID of the accounting category.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the accounting category.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Category {
    ///The code of the accounting category.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<::std::string::String>,
    ///The ID of the accounting category.
    pub id: ::uuid::Uuid,
    ///The name of the accounting category.
    pub name: ::std::string::String,
}
/// The party to which any transaction fees are charged if the resulting transaction route has associated fees.
/// Some transactions with fees might not be possible with the specified option, in which case error `3287` is returned.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The party to which any transaction fees are charged if the resulting transaction route has associated fees. \nSome transactions with fees might not be possible with the specified option, in which case error `3287` is returned.",
///  "type": "string",
///  "enum": [
///    "shared",
///    "debtor"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ChargeBearer {
    #[serde(rename = "shared")]
    Shared,
    #[serde(rename = "debtor")]
    Debtor,
}
impl ::std::fmt::Display for ChargeBearer {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Shared => f.write_str("shared"),
            Self::Debtor => f.write_str("debtor"),
        }
    }
}
impl ::std::str::FromStr for ChargeBearer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "shared" => Ok(Self::Shared),
            "debtor" => Ok(Self::Debtor),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ChargeBearer {
    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 ChargeBearer {
    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 ChargeBearer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`Counterparties`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Counterparty"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Counterparties(pub ::std::vec::Vec<Counterparty>);
impl ::std::ops::Deref for Counterparties {
    type Target = ::std::vec::Vec<Counterparty>;
    fn deref(&self) -> &::std::vec::Vec<Counterparty> {
        &self.0
    }
}
impl ::std::convert::From<Counterparties> for ::std::vec::Vec<Counterparty> {
    fn from(value: Counterparties) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Counterparty>> for Counterparties {
    fn from(value: ::std::vec::Vec<Counterparty>) -> Self {
        Self(value)
    }
}
///`Counterparty`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "accounts": {
///      "description": "The list of public accounts associated with this counterparty.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/CounterpartyAccount"
///      }
///    },
///    "cards": {
///      "description": "The list of cards associated with this counterparty.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/CounterpartyCard"
///      }
///    },
///    "country": {
///      "$ref": "#/components/schemas/CountryCode"
///    },
///    "created_at": {
///      "description": "The date and time the counterparty was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the counterparty.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the counterparty.",
///      "type": "string"
///    },
///    "profile_type": {
///      "$ref": "#/components/schemas/ProfileType"
///    },
///    "revtag": {
///      "description": "The [Revtag](https://help.revolut.com/help/transfers/internal-transfers/username-payments/revtags/) of the counterparty.",
///      "type": "string"
///    },
///    "state": {
///      "description": "Indicates the state of the counterparty.",
///      "type": "string",
///      "enum": [
///        "created",
///        "draft",
///        "deleted"
///      ]
///    },
///    "updated_at": {
///      "description": "The date and time the counterparty was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Counterparty {
    ///The list of public accounts associated with this counterparty.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub accounts: ::std::vec::Vec<CounterpartyAccount>,
    ///The list of cards associated with this counterparty.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub cards: ::std::vec::Vec<CounterpartyCard>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub country: ::std::option::Option<CountryCode>,
    ///The date and time the counterparty was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the counterparty.
    pub id: ::uuid::Uuid,
    ///The name of the counterparty.
    pub name: ::std::string::String,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub profile_type: ::std::option::Option<ProfileType>,
    ///The [Revtag](https://help.revolut.com/help/transfers/internal-transfers/username-payments/revtags/) of the counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub revtag: ::std::option::Option<::std::string::String>,
    ///Indicates the state of the counterparty.
    pub state: CounterpartyState,
    ///The date and time the counterparty was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`CounterpartyAccount`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "currency",
///    "id",
///    "type"
///  ],
///  "properties": {
///    "account_no": {
///      "description": "The bank account number of the counterparty.",
///      "type": "string"
///    },
///    "bank_country": {
///      "$ref": "#/components/schemas/BankCountryCode"
///    },
///    "bic": {
///      "description": "The BIC number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "bsb_code": {
///      "description": "The BSB number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "clabe": {
///      "description": "The CLABE number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/AccountCurrency"
///    },
///    "iban": {
///      "description": "The IBAN number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "id": {
///      "description": "The ID of the counterparty's account.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "ifsc": {
///      "description": "The IFSC number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "name": {
///      "description": "The name of the counterparty.",
///      "type": "string"
///    },
///    "recipient_charges": {
///      "description": "Indicates the possibility of the recipient charges.\n\n:::caution\nThis field is deprecated and should be disregarded.\nIt is returned for legacy purposes only.\n:::",
///      "deprecated": true,
///      "type": "string",
///      "enum": [
///        "no",
///        "expected"
///      ]
///    },
///    "routing_number": {
///      "description": "The routing number of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "sort_code": {
///      "description": "The sort code of the counterparty's account if applicable.",
///      "type": "string"
///    },
///    "type": {
///      "description": "Indicates the type of account.",
///      "type": "string",
///      "enum": [
///        "revolut",
///        "external"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CounterpartyAccount {
    ///The bank account number of the counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account_no: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bank_country: ::std::option::Option<BankCountryCode>,
    ///The BIC number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bic: ::std::option::Option<::std::string::String>,
    ///The BSB number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bsb_code: ::std::option::Option<::std::string::String>,
    ///The CLABE number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub clabe: ::std::option::Option<::std::string::String>,
    pub currency: AccountCurrency,
    ///The IBAN number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub iban: ::std::option::Option<::std::string::String>,
    ///The ID of the counterparty's account.
    pub id: ::uuid::Uuid,
    ///The IFSC number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ifsc: ::std::option::Option<::std::string::String>,
    ///The name of the counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
    /// Indicates the possibility of the recipient charges.
    ///
    /// :::caution
    /// This field is deprecated and should be disregarded.
    /// It is returned for legacy purposes only.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub recipient_charges: ::std::option::Option<CounterpartyAccountRecipientCharges>,
    ///The routing number of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub routing_number: ::std::option::Option<::std::string::String>,
    ///The sort code of the counterparty's account if applicable.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub sort_code: ::std::option::Option<::std::string::String>,
    ///Indicates the type of account.
    #[serde(rename = "type")]
    pub type_: CounterpartyAccountType,
}
/// Indicates the possibility of the recipient charges.
///
/// :::caution
/// This field is deprecated and should be disregarded.
/// It is returned for legacy purposes only.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the possibility of the recipient charges.\n\n:::caution\nThis field is deprecated and should be disregarded.\nIt is returned for legacy purposes only.\n:::",
///  "deprecated": true,
///  "type": "string",
///  "enum": [
///    "no",
///    "expected"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CounterpartyAccountRecipientCharges {
    #[serde(rename = "no")]
    No,
    #[serde(rename = "expected")]
    Expected,
}
impl ::std::fmt::Display for CounterpartyAccountRecipientCharges {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::No => f.write_str("no"),
            Self::Expected => f.write_str("expected"),
        }
    }
}
impl ::std::str::FromStr for CounterpartyAccountRecipientCharges {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "no" => Ok(Self::No),
            "expected" => Ok(Self::Expected),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CounterpartyAccountRecipientCharges {
    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 CounterpartyAccountRecipientCharges {
    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 CounterpartyAccountRecipientCharges {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Indicates the type of account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the type of account.",
///  "type": "string",
///  "enum": [
///    "revolut",
///    "external"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CounterpartyAccountType {
    #[serde(rename = "revolut")]
    Revolut,
    #[serde(rename = "external")]
    External,
}
impl ::std::fmt::Display for CounterpartyAccountType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Revolut => f.write_str("revolut"),
            Self::External => f.write_str("external"),
        }
    }
}
impl ::std::str::FromStr for CounterpartyAccountType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "revolut" => Ok(Self::Revolut),
            "external" => Ok(Self::External),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CounterpartyAccountType {
    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 CounterpartyAccountType {
    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 CounterpartyAccountType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`CounterpartyCard`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "country",
///    "currency",
///    "id",
///    "last_digits",
///    "name",
///    "scheme"
///  ],
///  "properties": {
///    "country": {
///      "$ref": "#/components/schemas/CountryCodeCard"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "description": "The ID of the counterparty's card.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_digits": {
///      "description": "The last four digits of the card number.",
///      "type": "string"
///    },
///    "name": {
///      "description": "The name of the counterparty.",
///      "type": "string"
///    },
///    "scheme": {
///      "description": "The card brand.",
///      "type": "string",
///      "enum": [
///        "visa",
///        "mastercard"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CounterpartyCard {
    pub country: CountryCodeCard,
    pub currency: Currency,
    ///The ID of the counterparty's card.
    pub id: ::uuid::Uuid,
    ///The last four digits of the card number.
    pub last_digits: ::std::string::String,
    ///The name of the counterparty.
    pub name: ::std::string::String,
    ///The card brand.
    pub scheme: CounterpartyCardScheme,
}
///The card brand.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The card brand.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CounterpartyCardScheme {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
}
impl ::std::fmt::Display for CounterpartyCardScheme {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Visa => f.write_str("visa"),
            Self::Mastercard => f.write_str("mastercard"),
        }
    }
}
impl ::std::str::FromStr for CounterpartyCardScheme {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "visa" => Ok(Self::Visa),
            "mastercard" => Ok(Self::Mastercard),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CounterpartyCardScheme {
    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 CounterpartyCardScheme {
    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 CounterpartyCardScheme {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`CounterpartyError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "code",
///    "message"
///  ],
///  "properties": {
///    "code": {
///      "description": "The error code.",
///      "type": "integer"
///    },
///    "message": {
///      "description": "The description of the error.",
///      "type": "string"
///    },
///    "params": {
///      "$ref": "#/components/schemas/CounterpartyErrorParams"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CounterpartyError {
    ///The error code.
    pub code: i64,
    ///The description of the error.
    pub message: ::std::string::String,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub params: ::std::option::Option<CounterpartyErrorParams>,
}
///Additional parameters related to the error.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional parameters related to the error.",
///  "type": "object",
///  "properties": {
///    "counterparty_id": {
///      "description": "The ID of the Revolut counterparty (i.e. internal counterparty) that already exists.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CounterpartyErrorParams {
    ///The ID of the Revolut counterparty (i.e. internal counterparty) that already exists.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub counterparty_id: ::std::option::Option<::uuid::Uuid>,
}
impl ::std::default::Default for CounterpartyErrorParams {
    fn default() -> Self {
        Self {
            counterparty_id: Default::default(),
        }
    }
}
///Indicates the state of the counterparty.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the state of the counterparty.",
///  "type": "string",
///  "enum": [
///    "created",
///    "draft",
///    "deleted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CounterpartyState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "draft")]
    Draft,
    #[serde(rename = "deleted")]
    Deleted,
}
impl ::std::fmt::Display for CounterpartyState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("created"),
            Self::Draft => f.write_str("draft"),
            Self::Deleted => f.write_str("deleted"),
        }
    }
}
impl ::std::str::FromStr for CounterpartyState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "created" => Ok(Self::Created),
            "draft" => Ok(Self::Draft),
            "deleted" => Ok(Self::Deleted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CounterpartyState {
    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 CounterpartyState {
    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 CounterpartyState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CountryCode(::std::string::String);
impl ::std::ops::Deref for CountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CountryCode> for ::std::string::String {
    fn from(value: CountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CountryCode {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CountryCode {
    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 CountryCode {
    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 CountryCode {
    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 CountryCode {
    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 country of the card issuer, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The country of the card issuer, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CountryCodeCard(::std::string::String);
impl ::std::ops::Deref for CountryCodeCard {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CountryCodeCard> for ::std::string::String {
    fn from(value: CountryCodeCard) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CountryCodeCard {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CountryCodeCard {
    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 CountryCodeCard {
    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 CountryCodeCard {
    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 CountryCodeCard {
    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 bank country of the merchant, provided as an [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
/// Typically 3 letters, though in some cases, card networks might provide it as a 2-letter code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The bank country of the merchant, provided as an [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.\nTypically 3 letters, though in some cases, card networks might provide it as a 2-letter code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CountryCodeMerchant(::std::string::String);
impl ::std::ops::Deref for CountryCodeMerchant {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CountryCodeMerchant> for ::std::string::String {
    fn from(value: CountryCodeMerchant) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CountryCodeMerchant {
    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,3}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CountryCodeMerchant {
    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 CountryCodeMerchant {
    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 CountryCodeMerchant {
    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 CountryCodeMerchant {
    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 accounting category to create.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The accounting category to create.",
///  "type": "object",
///  "required": [
///    "code",
///    "name"
///  ],
///  "properties": {
///    "code": {
///      "description": "The code name for the accounting category.",
///      "type": "string",
///      "maxLength": 50,
///      "minLength": 1
///    },
///    "default_tax_rate_id": {
///      "description": "The ID of the default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) that should be applied to items in this accounting category unless overridden for a specific item.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The full name for the accounting category.",
///      "type": "string",
///      "maxLength": 60,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAccountingCategoryRequest {
    ///The code name for the accounting category.
    pub code: CreateAccountingCategoryRequestCode,
    ///The ID of the default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) that should be applied to items in this accounting category unless overridden for a specific item.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub default_tax_rate_id: ::std::option::Option<::uuid::Uuid>,
    ///The full name for the accounting category.
    pub name: CreateAccountingCategoryRequestName,
}
///The code name for the accounting category.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The code name for the accounting category.",
///  "type": "string",
///  "maxLength": 50,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreateAccountingCategoryRequestCode(::std::string::String);
impl ::std::ops::Deref for CreateAccountingCategoryRequestCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreateAccountingCategoryRequestCode> for ::std::string::String {
    fn from(value: CreateAccountingCategoryRequestCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreateAccountingCategoryRequestCode {
    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 CreateAccountingCategoryRequestCode {
    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 CreateAccountingCategoryRequestCode {
    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 CreateAccountingCategoryRequestCode {
    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 CreateAccountingCategoryRequestCode {
    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 full name for the accounting category.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The full name for the accounting category.",
///  "type": "string",
///  "maxLength": 60,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreateAccountingCategoryRequestName(::std::string::String);
impl ::std::ops::Deref for CreateAccountingCategoryRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreateAccountingCategoryRequestName> for ::std::string::String {
    fn from(value: CreateAccountingCategoryRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreateAccountingCategoryRequestName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 60usize {
            return Err("longer than 60 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 CreateAccountingCategoryRequestName {
    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 CreateAccountingCategoryRequestName {
    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 CreateAccountingCategoryRequestName {
    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 CreateAccountingCategoryRequestName {
    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())
            })
    }
}
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "",
///  "type": "object",
///  "properties": {
///    "account_no": {
///      "description": "The bank account number of the counterparty.",
///      "type": "string"
///    },
///    "address": {
///      "$ref": "#/components/schemas/BeneficiaryAddress"
///    },
///    "bank_country": {
///      "$ref": "#/components/schemas/BankCountryCode"
///    },
///    "bic": {
///      "description": "The BIC number of the counterparty's account. This field is required for non-SEPA IBAN/SWIFT.",
///      "type": "string"
///    },
///    "bsb_code": {
///      "description": "The BSB number of the counterparty's account. This field is required for AUD accounts.",
///      "type": "string"
///    },
///    "clabe": {
///      "description": "The CLABE number of the counterparty's account. This field is required for SWIFT MX.",
///      "type": "string"
///    },
///    "company_name": {
///      "description": "The name of the counterparty, provided when the counterparty is a **company** (business account type) and is **not** being added via Revtag.\n\nIf specified, `individual_name` and `name` must be empty.\n\n:::caution\nThe `company_name` must contain at least 2 letters (not just characters).\nFor example, names like `12` will fail validation because they are two characters but not two letters.\n:::",
///      "type": "string"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "iban": {
///      "description": "The IBAN number of the counterparty's account. This field is displayed for IBAN countries.",
///      "type": "string"
///    },
///    "ifsc": {
///      "description": "The IFSC number of the counterparty's account. This field is required for INR accounts.",
///      "type": "string"
///    },
///    "individual_name": {
///      "$ref": "#/components/schemas/IndividualName"
///    },
///    "name": {
///      "description": "The name of the counterparty, provided when the counterparty is being added via **Revtag**.\n\nIf specified, `individual_name` and `company_name` must be empty.\n\n:::note\nThe name that you provide must match or closely match the actual name associated with the account that you're trying to add.\nOtherwise, the creation fails and a `404` error is returned.\n:::\n",
///      "type": "string"
///    },
///    "profile_type": {
///      "description": "The type of the Revolut profile.\nIndicates whether the counterparty is a personal or business account.\nProvide it when adding a Revolut counterparty via Revtag.",
///      "type": "string",
///      "enum": [
///        "personal",
///        "business"
///      ]
///    },
///    "revtag": {
///      "description": "The [Revtag](https://help.revolut.com/help/transfers/internal-transfers/username-payments/revtags/) of the counterparty to add.",
///      "type": "string"
///    },
///    "routing_number": {
///      "description": "The routing number of the counterparty's account. This field is required for USD accounts.",
///      "type": "string"
///    },
///    "sort_code": {
///      "description": "The sort code of the counterparty's account. This field is required for GBP accounts.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateCounterpartyRequest {
    ///The bank account number of the counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account_no: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub address: ::std::option::Option<BeneficiaryAddress>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bank_country: ::std::option::Option<BankCountryCode>,
    ///The BIC number of the counterparty's account. This field is required for non-SEPA IBAN/SWIFT.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bic: ::std::option::Option<::std::string::String>,
    ///The BSB number of the counterparty's account. This field is required for AUD accounts.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bsb_code: ::std::option::Option<::std::string::String>,
    ///The CLABE number of the counterparty's account. This field is required for SWIFT MX.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub clabe: ::std::option::Option<::std::string::String>,
    /// The name of the counterparty, provided when the counterparty is a **company** (business account type) and is **not** being added via Revtag.
    ///
    /// If specified, `individual_name` and `name` must be empty.
    ///
    /// :::caution
    /// The `company_name` must contain at least 2 letters (not just characters).
    /// For example, names like `12` will fail validation because they are two characters but not two letters.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
    ///The IBAN number of the counterparty's account. This field is displayed for IBAN countries.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub iban: ::std::option::Option<::std::string::String>,
    ///The IFSC number of the counterparty's account. This field is required for INR accounts.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ifsc: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<IndividualName>,
    /// The name of the counterparty, provided when the counterparty is being added via **Revtag**.
    ///
    /// If specified, `individual_name` and `company_name` must be empty.
    ///
    /// :::note
    /// The name that you provide must match or closely match the actual name associated with the account that you're trying to add.
    /// Otherwise, the creation fails and a `404` error is returned.
    /// :::
    ///
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
    /// The type of the Revolut profile.
    /// Indicates whether the counterparty is a personal or business account.
    /// Provide it when adding a Revolut counterparty via Revtag.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub profile_type: ::std::option::Option<CreateCounterpartyRequestProfileType>,
    ///The [Revtag](https://help.revolut.com/help/transfers/internal-transfers/username-payments/revtags/) of the counterparty to add.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub revtag: ::std::option::Option<::std::string::String>,
    ///The routing number of the counterparty's account. This field is required for USD accounts.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub routing_number: ::std::option::Option<::std::string::String>,
    ///The sort code of the counterparty's account. This field is required for GBP accounts.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub sort_code: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for CreateCounterpartyRequest {
    fn default() -> Self {
        Self {
            account_no: Default::default(),
            address: Default::default(),
            bank_country: Default::default(),
            bic: Default::default(),
            bsb_code: Default::default(),
            clabe: Default::default(),
            company_name: Default::default(),
            currency: Default::default(),
            iban: Default::default(),
            ifsc: Default::default(),
            individual_name: Default::default(),
            name: Default::default(),
            profile_type: Default::default(),
            revtag: Default::default(),
            routing_number: Default::default(),
            sort_code: Default::default(),
        }
    }
}
/// The type of the Revolut profile.
/// Indicates whether the counterparty is a personal or business account.
/// Provide it when adding a Revolut counterparty via Revtag.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the Revolut profile.\nIndicates whether the counterparty is a personal or business account.\nProvide it when adding a Revolut counterparty via Revtag.",
///  "type": "string",
///  "enum": [
///    "personal",
///    "business"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CreateCounterpartyRequestProfileType {
    #[serde(rename = "personal")]
    Personal,
    #[serde(rename = "business")]
    Business,
}
impl ::std::fmt::Display for CreateCounterpartyRequestProfileType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Personal => f.write_str("personal"),
            Self::Business => f.write_str("business"),
        }
    }
}
impl ::std::str::FromStr for CreateCounterpartyRequestProfileType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "personal" => Ok(Self::Personal),
            "business" => Ok(Self::Business),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CreateCounterpartyRequestProfileType {
    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 CreateCounterpartyRequestProfileType {
    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 CreateCounterpartyRequestProfileType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`CreateLabelGroupRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "labels",
///    "name"
///  ],
///  "properties": {
///    "labels": {
///      "description": "The labels to create in the new group.\n\nThe maximum number of labels you can create for a new group is 200.\nIf you need to add more, you can add them later by [creating new labels individually](https://developer.revolut.com/docs/business/create-label).",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/CreateLabelRequest"
///      },
///      "maxItems": 200,
///      "minItems": 1
///    },
///    "name": {
///      "description": "The name for the new label group.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateLabelGroupRequest {
    /// The labels to create in the new group.
    ///
    /// The maximum number of labels you can create for a new group is 200.
    /// If you need to add more, you can add them later by [creating new labels individually](https://developer.revolut.com/docs/business/create-label).
    pub labels: ::std::vec::Vec<CreateLabelRequest>,
    ///The name for the new label group.
    pub name: CreateLabelGroupRequestName,
}
///The name for the new label group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name for the new label group.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreateLabelGroupRequestName(::std::string::String);
impl ::std::ops::Deref for CreateLabelGroupRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreateLabelGroupRequestName> for ::std::string::String {
    fn from(value: CreateLabelGroupRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreateLabelGroupRequestName {
    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 CreateLabelGroupRequestName {
    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 CreateLabelGroupRequestName {
    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 CreateLabelGroupRequestName {
    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 CreateLabelGroupRequestName {
    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())
            })
    }
}
///`CreateLabelRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "name"
///  ],
///  "properties": {
///    "name": {
///      "description": "The name for the new label.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateLabelRequest {
    ///The name for the new label.
    pub name: CreateLabelRequestName,
}
///The name for the new label.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name for the new label.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreateLabelRequestName(::std::string::String);
impl ::std::ops::Deref for CreateLabelRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreateLabelRequestName> for ::std::string::String {
    fn from(value: CreateLabelRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreateLabelRequestName {
    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 CreateLabelRequestName {
    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 CreateLabelRequestName {
    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 CreateLabelRequestName {
    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 CreateLabelRequestName {
    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())
            })
    }
}
///`CreatePaymentDraftRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "payments"
///  ],
///  "properties": {
///    "payments": {
///      "description": "The details of the payment(s) to be made.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/PaymentRequest"
///      }
///    },
///    "schedule_for": {
///      "description": "The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date"
///    },
///    "title": {
///      "description": "The title of the payment draft.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreatePaymentDraftRequest {
    ///The details of the payment(s) to be made.
    pub payments: ::std::vec::Vec<PaymentRequest>,
    ///The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub schedule_for: ::std::option::Option<::chrono::naive::NaiveDate>,
    ///The title of the payment draft.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub title: ::std::option::Option<::std::string::String>,
}
///`CreatePaymentDraftResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id"
///  ],
///  "properties": {
///    "id": {
///      "description": "The ID of the payment draft created.",
///      "type": "string",
///      "format": "number"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreatePaymentDraftResponse {
    ///The ID of the payment draft created.
    pub id: ::std::string::String,
}
///`CreatePayoutLinkRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "counterparty_name",
///    "currency",
///    "reference",
///    "request_id"
///  ],
///  "properties": {
///    "account_id": {
///      "$ref": "#/components/schemas/PayoutLinkAccountId"
///    },
///    "amount": {
///      "$ref": "#/components/schemas/PayoutLinkAmount"
///    },
///    "counterparty_name": {
///      "$ref": "#/components/schemas/PayoutLinkCounterpartyName"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "expiry_period": {
///      "$ref": "#/components/schemas/PayoutLinkExpiryPeriod"
///    },
///    "payout_methods": {
///      "$ref": "#/components/schemas/PayoutLinkPayoutMethods"
///    },
///    "reference": {
///      "description": "The reference for the payout link.\nA piece of text or number you provide to help identify what the payment relates to.\nIt can be used, for example, for reconciliation or tracking purposes.\n\nYou might include an invoice number, account or transaction ID, or any other reference meaningful to you or the recipient.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    },
///    "request_id": {
///      "$ref": "#/components/schemas/PayoutLinkRequestId"
///    },
///    "save_counterparty": {
///      "description": "Indicates whether to save the recipient as your counterparty upon link claim.\nIf `false` then the counterparty will not show up on your counterparties list, for example, when you retrieve your counterparties. \nHowever, you will still be able to retrieve this counterparty by its ID.\n\nIf you don't choose to save the counterparty on link creation, you can do it later from your transactions list in the Business app.",
///      "type": "boolean"
///    },
///    "transfer_reason_code": {
///      "$ref": "#/components/schemas/TransferReasonCode"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreatePayoutLinkRequest {
    pub account_id: PayoutLinkAccountId,
    pub amount: PayoutLinkAmount,
    pub counterparty_name: PayoutLinkCounterpartyName,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_period: ::std::option::Option<PayoutLinkExpiryPeriod>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payout_methods: ::std::option::Option<PayoutLinkPayoutMethods>,
    /// The reference for the payout link.
    /// A piece of text or number you provide to help identify what the payment relates to.
    /// It can be used, for example, for reconciliation or tracking purposes.
    ///
    /// You might include an invoice number, account or transaction ID, or any other reference meaningful to you or the recipient.
    pub reference: CreatePayoutLinkRequestReference,
    pub request_id: PayoutLinkRequestId,
    /// Indicates whether to save the recipient as your counterparty upon link claim.
    /// If `false` then the counterparty will not show up on your counterparties list, for example, when you retrieve your counterparties.
    /// However, you will still be able to retrieve this counterparty by its ID.
    ///
    /// If you don't choose to save the counterparty on link creation, you can do it later from your transactions list in the Business app.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub save_counterparty: ::std::option::Option<bool>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transfer_reason_code: ::std::option::Option<TransferReasonCode>,
}
/// The reference for the payout link.
/// A piece of text or number you provide to help identify what the payment relates to.
/// It can be used, for example, for reconciliation or tracking purposes.
///
/// You might include an invoice number, account or transaction ID, or any other reference meaningful to you or the recipient.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reference for the payout link.\nA piece of text or number you provide to help identify what the payment relates to.\nIt can be used, for example, for reconciliation or tracking purposes.\n\nYou might include an invoice number, account or transaction ID, or any other reference meaningful to you or the recipient.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreatePayoutLinkRequestReference(::std::string::String);
impl ::std::ops::Deref for CreatePayoutLinkRequestReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreatePayoutLinkRequestReference> for ::std::string::String {
    fn from(value: CreatePayoutLinkRequestReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreatePayoutLinkRequestReference {
    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 CreatePayoutLinkRequestReference {
    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 CreatePayoutLinkRequestReference {
    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 CreatePayoutLinkRequestReference {
    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 CreatePayoutLinkRequestReference {
    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())
            })
    }
}
///`CreateTaxRateRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/AccountingTaxRate"
///    },
///    {
///      "description": "The tax rate to create.",
///      "required": [
///        "name",
///        "percentage"
///      ]
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateTaxRateRequest {
    ///The name of the tax.
    pub name: CreateTaxRateRequestName,
    ///The tax rate percentage applied to the taxable amount. For example, `23` for 23%.
    pub percentage: f64,
}
///The name of the tax.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the tax.",
///  "type": "string",
///  "maxLength": 20,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CreateTaxRateRequestName(::std::string::String);
impl ::std::ops::Deref for CreateTaxRateRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CreateTaxRateRequestName> for ::std::string::String {
    fn from(value: CreateTaxRateRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CreateTaxRateRequestName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 20usize {
            return Err("longer than 20 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 CreateTaxRateRequestName {
    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 CreateTaxRateRequestName {
    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 CreateTaxRateRequestName {
    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 CreateTaxRateRequestName {
    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())
            })
    }
}
///`CreateWebhookRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "url"
///  ],
///  "properties": {
///    "events": {
///      "description": "A list of event types to subscribe to.\nIf you don't provide it, you're automatically subscribed to the [default event types](https://developer.revolut.com/docs/guides/manage-accounts/webhooks/about-webhooks#default-event-types).",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/WebhookEventType"
///      }
///    },
///    "url": {
///      "$ref": "#/components/schemas/Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateWebhookRequest {
    /// A list of event types to subscribe to.
    /// If you don't provide it, you're automatically subscribed to the [default event types](https://developer.revolut.com/docs/guides/manage-accounts/webhooks/about-webhooks#default-event-types).
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub events: ::std::vec::Vec<WebhookEventType>,
    pub url: Url,
}
///[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())
            })
    }
}
///`Error`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "code",
///    "message"
///  ],
///  "properties": {
///    "code": {
///      "description": "The error code.",
///      "type": "integer"
///    },
///    "message": {
///      "description": "The description of the error.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Error {
    ///The error code.
    pub code: i64,
    ///The description of the error.
    pub message: ::std::string::String,
}
/// Unauthorised
///
/// Returned, for example, when the credentials you used to make the request are invalid.
/// For more information, see the **Authorization** section.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unauthorised\n\nReturned, for example, when the credentials you used to make the request are invalid.\nFor more information, see the **Authorization** section.",
///  "type": "object",
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/ErrorWithStatus"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ErrorUnauthorized(pub ErrorWithStatus);
impl ::std::ops::Deref for ErrorUnauthorized {
    type Target = ErrorWithStatus;
    fn deref(&self) -> &ErrorWithStatus {
        &self.0
    }
}
impl ::std::convert::From<ErrorUnauthorized> for ErrorWithStatus {
    fn from(value: ErrorUnauthorized) -> Self {
        value.0
    }
}
impl ::std::convert::From<ErrorWithStatus> for ErrorUnauthorized {
    fn from(value: ErrorWithStatus) -> Self {
        Self(value)
    }
}
/// Unprocessable entity
///
/// Returned, for example, when you try to modify a resource which is not a in state that would allow for modifications, e.g. a card invitation in state `failed`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unprocessable entity\n\nReturned, for example, when you try to modify a resource which is not a in state that would allow for modifications, e.g. a card invitation in state `failed`.",
///  "type": "object",
///  "required": [
///    "message"
///  ],
///  "properties": {
///    "code": {
///      "description": "The error code.",
///      "type": "integer"
///    },
///    "message": {
///      "description": "The description of the error.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorUnprocessableEntity {
    ///The error code.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<i64>,
    ///The description of the error.
    pub message: ::std::string::String,
}
///`ErrorWithId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "code",
///    "error_id",
///    "message"
///  ],
///  "properties": {
///    "code": {
///      "description": "The error code.",
///      "type": "integer"
///    },
///    "error_id": {
///      "description": "The ID of the specific error instance. Used for traceability.",
///      "type": "string"
///    },
///    "message": {
///      "description": "The description of the error.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorWithId {
    ///The error code.
    pub code: i64,
    ///The ID of the specific error instance. Used for traceability.
    pub error_id: ::std::string::String,
    ///The description of the error.
    pub message: ::std::string::String,
}
///Error returning a status instead of code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Error returning a status instead of code.",
///  "type": "object",
///  "required": [
///    "message",
///    "status"
///  ],
///  "properties": {
///    "message": {
///      "description": "The description of the error.",
///      "type": "string"
///    },
///    "status": {
///      "description": "The error code.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorWithStatus {
    ///The description of the error.
    pub message: ::std::string::String,
    ///The error code.
    pub status: i64,
}
///The estimated time of the inbound transfer of the funds, i.e. when we expect the recipient to receive the transfer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The estimated time of the inbound transfer of the funds, i.e. when we expect the recipient to receive the transfer.",
///  "type": "object",
///  "required": [
///    "unit"
///  ],
///  "properties": {
///    "max": {
///      "description": "The maximum time estimate.",
///      "type": "integer"
///    },
///    "min": {
///      "description": "The minimum time estimate.",
///      "type": "integer"
///    },
///    "unit": {
///      "description": "The estimated time unit of the inbound transfer of the funds.",
///      "type": "string",
///      "enum": [
///        "days",
///        "hours"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EstimatedTime {
    ///The maximum time estimate.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub max: ::std::option::Option<i64>,
    ///The minimum time estimate.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub min: ::std::option::Option<i64>,
    ///The estimated time unit of the inbound transfer of the funds.
    pub unit: EstimatedTimeUnit,
}
///The estimated time unit of the inbound transfer of the funds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The estimated time unit of the inbound transfer of the funds.",
///  "type": "string",
///  "enum": [
///    "days",
///    "hours"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum EstimatedTimeUnit {
    #[serde(rename = "days")]
    Days,
    #[serde(rename = "hours")]
    Hours,
}
impl ::std::fmt::Display for EstimatedTimeUnit {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Days => f.write_str("days"),
            Self::Hours => f.write_str("hours"),
        }
    }
}
impl ::std::str::FromStr for EstimatedTimeUnit {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "days" => Ok(Self::Days),
            "hours" => Ok(Self::Hours),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for EstimatedTimeUnit {
    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 EstimatedTimeUnit {
    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 EstimatedTimeUnit {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The details of the currency to exchange from.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the currency to exchange from.",
///  "type": "object",
///  "required": [
///    "account_id",
///    "currency"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account to sell currency from.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "amount": {
///      "description": "The amount of currency.\nSpecify **only** if you want to sell currency.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangePartFrom {
    ///The ID of the account to sell currency from.
    pub account_id: ::uuid::Uuid,
    /// The amount of currency.
    /// Specify **only** if you want to sell currency.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<f64>,
    pub currency: Currency,
}
///The details of the currency to exchange to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the currency to exchange to.",
///  "type": "object",
///  "required": [
///    "account_id",
///    "currency"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account to receive exchanged currency into.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "amount": {
///      "description": "The amount of currency.\nSpecify **only** if you want to buy currency.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangePartTo {
    ///The ID of the account to receive exchanged currency into.
    pub account_id: ::uuid::Uuid,
    /// The amount of currency.
    /// Specify **only** if you want to buy currency.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<f64>,
    pub currency: Currency,
}
///`ExchangeRateResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "fee",
///    "from",
///    "rate",
///    "rate_date",
///    "to"
///  ],
///  "properties": {
///    "fee": {
///      "$ref": "#/components/schemas/Fee"
///    },
///    "from": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    },
///    "rate": {
///      "description": "The proposed exchange rate.",
///      "type": "number",
///      "format": "double"
///    },
///    "rate_date": {
///      "description": "The date of the proposed exchange rate in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "to": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangeRateResponse {
    pub fee: Fee,
    pub from: AmountWithCurrency,
    ///The proposed exchange rate.
    pub rate: f64,
    ///The date of the proposed exchange rate in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub rate_date: ::chrono::DateTime<::chrono::offset::Utc>,
    pub to: AmountWithCurrency,
}
///`ExchangeReason`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "code",
///    "name"
///  ],
///  "properties": {
///    "code": {
///      "$ref": "#/components/schemas/ExchangeReasonCodeEnum"
///    },
///    "name": {
///      "description": "Category name of the reason for the exchange.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangeReason {
    pub code: ExchangeReasonCodeEnum,
    ///Category name of the reason for the exchange.
    pub name: ::std::string::String,
}
/// The reason code for the exchange.
/// Depending on the country and the amount of funds to be exchanged, you might be required to provide an exchange reason.
/// You can check available reason codes with the [`GET /exchange-reasons` operation](https://developer.revolut.com/docs/business/get-exchange-reasons).
///
/// If an exchange reason is not required, this field is ignored.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code for the exchange.\nDepending on the country and the amount of funds to be exchanged, you might be required to provide an exchange reason. \nYou can check available reason codes with the [`GET /exchange-reasons` operation](https://developer.revolut.com/docs/business/get-exchange-reasons).\n\nIf an exchange reason is not required, this field is ignored.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ExchangeReasonCode(pub ::std::string::String);
impl ::std::ops::Deref for ExchangeReasonCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExchangeReasonCode> for ::std::string::String {
    fn from(value: ExchangeReasonCode) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ExchangeReasonCode {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ExchangeReasonCode {
    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 ExchangeReasonCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Category code of the reason for the exchange.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Category code of the reason for the exchange.",
///  "type": "string",
///  "enum": [
///    "business_expense_and_claims",
///    "fees_and_charges",
///    "fund_transfer_and_intracompany_payment",
///    "gifts_and_donations",
///    "government_services_and_tax",
///    "insurance",
///    "inventory",
///    "investment_dividend_and_interest",
///    "loan_and_loan_repayment",
///    "marketing",
///    "payment_for_goods_and_services",
///    "payroll",
///    "refund",
///    "rental_and_property",
///    "sales",
///    "service_provider_and_software",
///    "travel_and_transportation",
///    "utilities"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ExchangeReasonCodeEnum {
    #[serde(rename = "business_expense_and_claims")]
    BusinessExpenseAndClaims,
    #[serde(rename = "fees_and_charges")]
    FeesAndCharges,
    #[serde(rename = "fund_transfer_and_intracompany_payment")]
    FundTransferAndIntracompanyPayment,
    #[serde(rename = "gifts_and_donations")]
    GiftsAndDonations,
    #[serde(rename = "government_services_and_tax")]
    GovernmentServicesAndTax,
    #[serde(rename = "insurance")]
    Insurance,
    #[serde(rename = "inventory")]
    Inventory,
    #[serde(rename = "investment_dividend_and_interest")]
    InvestmentDividendAndInterest,
    #[serde(rename = "loan_and_loan_repayment")]
    LoanAndLoanRepayment,
    #[serde(rename = "marketing")]
    Marketing,
    #[serde(rename = "payment_for_goods_and_services")]
    PaymentForGoodsAndServices,
    #[serde(rename = "payroll")]
    Payroll,
    #[serde(rename = "refund")]
    Refund,
    #[serde(rename = "rental_and_property")]
    RentalAndProperty,
    #[serde(rename = "sales")]
    Sales,
    #[serde(rename = "service_provider_and_software")]
    ServiceProviderAndSoftware,
    #[serde(rename = "travel_and_transportation")]
    TravelAndTransportation,
    #[serde(rename = "utilities")]
    Utilities,
}
impl ::std::fmt::Display for ExchangeReasonCodeEnum {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::BusinessExpenseAndClaims => f.write_str("business_expense_and_claims"),
            Self::FeesAndCharges => f.write_str("fees_and_charges"),
            Self::FundTransferAndIntracompanyPayment => {
                f.write_str("fund_transfer_and_intracompany_payment")
            }
            Self::GiftsAndDonations => f.write_str("gifts_and_donations"),
            Self::GovernmentServicesAndTax => f.write_str("government_services_and_tax"),
            Self::Insurance => f.write_str("insurance"),
            Self::Inventory => f.write_str("inventory"),
            Self::InvestmentDividendAndInterest => f.write_str("investment_dividend_and_interest"),
            Self::LoanAndLoanRepayment => f.write_str("loan_and_loan_repayment"),
            Self::Marketing => f.write_str("marketing"),
            Self::PaymentForGoodsAndServices => f.write_str("payment_for_goods_and_services"),
            Self::Payroll => f.write_str("payroll"),
            Self::Refund => f.write_str("refund"),
            Self::RentalAndProperty => f.write_str("rental_and_property"),
            Self::Sales => f.write_str("sales"),
            Self::ServiceProviderAndSoftware => f.write_str("service_provider_and_software"),
            Self::TravelAndTransportation => f.write_str("travel_and_transportation"),
            Self::Utilities => f.write_str("utilities"),
        }
    }
}
impl ::std::str::FromStr for ExchangeReasonCodeEnum {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "business_expense_and_claims" => Ok(Self::BusinessExpenseAndClaims),
            "fees_and_charges" => Ok(Self::FeesAndCharges),
            "fund_transfer_and_intracompany_payment" => {
                Ok(Self::FundTransferAndIntracompanyPayment)
            }
            "gifts_and_donations" => Ok(Self::GiftsAndDonations),
            "government_services_and_tax" => Ok(Self::GovernmentServicesAndTax),
            "insurance" => Ok(Self::Insurance),
            "inventory" => Ok(Self::Inventory),
            "investment_dividend_and_interest" => Ok(Self::InvestmentDividendAndInterest),
            "loan_and_loan_repayment" => Ok(Self::LoanAndLoanRepayment),
            "marketing" => Ok(Self::Marketing),
            "payment_for_goods_and_services" => Ok(Self::PaymentForGoodsAndServices),
            "payroll" => Ok(Self::Payroll),
            "refund" => Ok(Self::Refund),
            "rental_and_property" => Ok(Self::RentalAndProperty),
            "sales" => Ok(Self::Sales),
            "service_provider_and_software" => Ok(Self::ServiceProviderAndSoftware),
            "travel_and_transportation" => Ok(Self::TravelAndTransportation),
            "utilities" => Ok(Self::Utilities),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ExchangeReasonCodeEnum {
    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 ExchangeReasonCodeEnum {
    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 ExchangeReasonCodeEnum {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The list of available exchange reasons.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of available exchange reasons.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/ExchangeReason"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ExchangeReasons(pub ::std::vec::Vec<ExchangeReason>);
impl ::std::ops::Deref for ExchangeReasons {
    type Target = ::std::vec::Vec<ExchangeReason>;
    fn deref(&self) -> &::std::vec::Vec<ExchangeReason> {
        &self.0
    }
}
impl ::std::convert::From<ExchangeReasons> for ::std::vec::Vec<ExchangeReason> {
    fn from(value: ExchangeReasons) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<ExchangeReason>> for ExchangeReasons {
    fn from(value: ::std::vec::Vec<ExchangeReason>) -> Self {
        Self(value)
    }
}
///The exchange information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The exchange information.",
///  "type": "object",
///  "required": [
///    "from",
///    "request_id",
///    "to"
///  ],
///  "properties": {
///    "exchange_reason_code": {
///      "$ref": "#/components/schemas/ExchangeReasonCode"
///    },
///    "from": {
///      "$ref": "#/components/schemas/ExchangePartFrom"
///    },
///    "reference": {
///      "description": "The reference for the exchange transaction, provided by you.\nIt helps you to identify the transaction if you want to look it up later.",
///      "type": "string"
///    },
///    "request_id": {
///      "description": "The ID of the request, provided by you.\nIt helps you identify the transaction in your system.\n\n:::caution\nTo ensure that an exchange transaction is not processed multiple times if there are network or system errors,\nthe same `request_id` should be used for requests related to the same transaction.\n:::",
///      "type": "string",
///      "maxLength": 40
///    },
///    "to": {
///      "$ref": "#/components/schemas/ExchangePartTo"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangeRequest {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub exchange_reason_code: ::std::option::Option<ExchangeReasonCode>,
    pub from: ExchangePartFrom,
    /// The reference for the exchange transaction, provided by you.
    /// It helps you to identify the transaction if you want to look it up later.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<::std::string::String>,
    /// The ID of the request, provided by you.
    /// It helps you identify the transaction in your system.
    ///
    /// :::caution
    /// To ensure that an exchange transaction is not processed multiple times if there are network or system errors,
    /// the same `request_id` should be used for requests related to the same transaction.
    /// :::
    pub request_id: ExchangeRequestRequestId,
    pub to: ExchangePartTo,
}
/// The ID of the request, provided by you.
/// It helps you identify the transaction in your system.
///
/// :::caution
/// To ensure that an exchange transaction is not processed multiple times if there are network or system errors,
/// the same `request_id` should be used for requests related to the same transaction.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the request, provided by you.\nIt helps you identify the transaction in your system.\n\n:::caution\nTo ensure that an exchange transaction is not processed multiple times if there are network or system errors,\nthe same `request_id` should be used for requests related to the same transaction.\n:::",
///  "type": "string",
///  "maxLength": 40
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExchangeRequestRequestId(::std::string::String);
impl ::std::ops::Deref for ExchangeRequestRequestId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExchangeRequestRequestId> for ::std::string::String {
    fn from(value: ExchangeRequestRequestId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ExchangeRequestRequestId {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ExchangeRequestRequestId {
    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 ExchangeRequestRequestId {
    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 ExchangeRequestRequestId {
    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 ExchangeRequestRequestId {
    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())
            })
    }
}
///`ExchangeResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "completed_at": {
///      "description": "The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "created_at": {
///      "description": "The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the created transaction.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "reason_code": {
///      "description": "The reason why the transaction was failed or declined.\n\nPresent only when the `state` parameter of the transaction is `declined` or `failed`.",
///      "type": "string"
///    },
///    "state": {
///      "$ref": "#/components/schemas/TransactionState"
///    },
///    "type": {
///      "description": "The type of the transaction. For money exchange, it is `exchange`.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExchangeResponse {
    ///The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The ID of the created transaction.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    /// The reason why the transaction was failed or declined.
    ///
    /// Present only when the `state` parameter of the transaction is `declined` or `failed`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason_code: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<TransactionState>,
    ///The type of the transaction. For money exchange, it is `exchange`.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ExchangeResponse {
    fn default() -> Self {
        Self {
            completed_at: Default::default(),
            created_at: Default::default(),
            id: Default::default(),
            reason_code: Default::default(),
            state: Default::default(),
            type_: Default::default(),
        }
    }
}
///`Expense`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "expense_date",
///    "id",
///    "labels",
///    "receipt_ids",
///    "spent_amount",
///    "splits",
///    "state",
///    "transaction_type"
///  ],
///  "properties": {
///    "completed_at": {
///      "description": "The date and time the expense was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "description": {
///      "description": "The description of the expense.",
///      "type": "string"
///    },
///    "expense_date": {
///      "description": "The expense data depends on the type of the expense and whether it has been completed.\n\nTypically, it's the date and time of the expense [transaction](https://developer.revolut.com/docs/business/get-transaction) in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n- If the transaction related to the expense is completed, it is the date and time of its completion ([`completed_at`](https://developer.revolut.com/docs/business/get-transaction#response)).\n- Otherwise, it is the date and time of its creation ([`created_at`](https://developer.revolut.com/docs/business/get-transaction#response)).\n\nFor reimbursements, it's the payment date provided in the reimbursement request.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the expense.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "labels": {
///      "description": "The [labels](https://developer.revolut.com/docs/business/labels) added to the expense, organised in groups.\n\nYou can have up to 5 label groups, with max. 1 label per group.\n\nThe labels are provided as an object, where each key is the name of a label group, and each value is a single-element array containing the selected label from that group.",
///      "type": "object",
///      "maxProperties": 5,
///      "additionalProperties": {
///        "$ref": "#/components/schemas/LabelGroup"
///      }
///    },
///    "merchant": {
///      "description": "The name of the merchant.",
///      "type": "string"
///    },
///    "payer": {
///      "description": "The name of the [team member](https://developer.revolut.com/docs/business/team-members) who made the transaction, refund request, or ATM withdrawal, or the name of the business if the related transaction is of type `fee`.",
///      "type": "string"
///    },
///    "receipt_ids": {
///      "description": "The IDs of the receipts related to the expense.",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uuid"
///      }
///    },
///    "spent_amount": {
///      "description": "The expense amount in billed currency.",
///      "type": "object",
///      "required": [
///        "amount",
///        "currency"
///      ],
///      "properties": {
///        "amount": {
///          "$ref": "#/components/schemas/Amount"
///        },
///        "currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "splits": {
///      "description": "The splits of the expense.\n\nA single expense can be divided into multiple parts (splits), for example, to allocate different portions of the expense to different categories.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/ExpenseSplit"
///      }
///    },
///    "state": {
///      "$ref": "#/components/schemas/ExpenseState"
///    },
///    "submitted_at": {
///      "description": "The date and time the expense was submitted in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "transaction_id": {
///      "description": "The ID of the [transaction](https://developer.revolut.com/docs/business/get-transaction) related to the expense. Not available for transactions of type `external`.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "transaction_type": {
///      "$ref": "#/components/schemas/ExpenseTransactionType"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Expense {
    ///The date and time the expense was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The description of the expense.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<::std::string::String>,
    /// The expense data depends on the type of the expense and whether it has been completed.
    ///
    /// Typically, it's the date and time of the expense [transaction](https://developer.revolut.com/docs/business/get-transaction) in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    /// - If the transaction related to the expense is completed, it is the date and time of its completion ([`completed_at`](https://developer.revolut.com/docs/business/get-transaction#response)).
    /// - Otherwise, it is the date and time of its creation ([`created_at`](https://developer.revolut.com/docs/business/get-transaction#response)).
    ///
    /// For reimbursements, it's the payment date provided in the reimbursement request.
    pub expense_date: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the expense.
    pub id: ::uuid::Uuid,
    /// The [labels](https://developer.revolut.com/docs/business/labels) added to the expense, organised in groups.
    ///
    /// You can have up to 5 label groups, with max. 1 label per group.
    ///
    /// The labels are provided as an object, where each key is the name of a label group, and each value is a single-element array containing the selected label from that group.
    pub labels: ::std::collections::HashMap<::std::string::String, LabelGroup>,
    ///The name of the merchant.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant: ::std::option::Option<::std::string::String>,
    ///The name of the [team member](https://developer.revolut.com/docs/business/team-members) who made the transaction, refund request, or ATM withdrawal, or the name of the business if the related transaction is of type `fee`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payer: ::std::option::Option<::std::string::String>,
    ///The IDs of the receipts related to the expense.
    pub receipt_ids: ::std::vec::Vec<::uuid::Uuid>,
    pub spent_amount: ExpenseSpentAmount,
    /// The splits of the expense.
    ///
    /// A single expense can be divided into multiple parts (splits), for example, to allocate different portions of the expense to different categories.
    pub splits: ::std::vec::Vec<ExpenseSplit>,
    pub state: ExpenseState,
    ///The date and time the expense was submitted in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub submitted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The ID of the [transaction](https://developer.revolut.com/docs/business/get-transaction) related to the expense. Not available for transactions of type `external`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transaction_id: ::std::option::Option<::uuid::Uuid>,
    pub transaction_type: ExpenseTransactionType,
}
///The expense amount in billed currency.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The expense amount in billed 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 ExpenseSpentAmount {
    pub amount: Amount,
    pub currency: Currency,
}
///`ExpenseSplit`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "amount",
///    "category",
///    "tax_rate"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The original amount of the expense split.",
///      "type": "object",
///      "properties": {
///        "amount": {
///          "$ref": "#/components/schemas/Amount"
///        },
///        "currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "category": {
///      "$ref": "#/components/schemas/Category"
///    },
///    "tax_rate": {
///      "$ref": "#/components/schemas/TaxRate"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExpenseSplit {
    pub amount: ExpenseSplitAmount,
    pub category: Category,
    pub tax_rate: TaxRate,
}
///The original amount of the expense split.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The original amount of the expense split.",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Amount"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExpenseSplitAmount {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<Amount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
}
impl ::std::default::Default for ExpenseSplitAmount {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            currency: Default::default(),
        }
    }
}
/// Indicates the state of the expense. Possible values:
///
///   - `missing_info`: The expense is missing some required information.
///
///     This is the initial state of the expense when it's first created.
///     Once the missing information is provided, the expense is ready to be submitted.
///
///   - `awaiting_review`: The expense is awaiting approval before it can be completed.
///
///     The approver can approve, reject, or request repayment for the expense.
///     It is also possible for the submitter to undo the submission at this stage.
///
///   - `rejected`: The expense has been rejected by the approver.
///
///     The expense submitter (typically, the payer) should fix the issue that was the reason for the rejection and resubmit the expense.
///
///   - `pending_reimbursement`: The reimbursement request has been approved, and the expense is awaiting reimbursement.
///
///     This state is possible for reimbursements (transaction type = `External`).
///
///   - `refund_requested`: The expense has been rejected and repayment has been requested.*
///
///     This state is possible for card transactions.
///     It indicates that following the review, the approver rejected the expense and requested that it be paid back to the business account.
///     This can happen, for example, if an employee accidentally makes a personal purchase with their business card.
///     Once the money has been returned, the **admin** can mark this expense as repaid.
///
///   - `refunded`: The expense has been repaid.*
///
///     This state indicates that the admin has marked the expense as repaid.
///
///   - `approved`: The expense has been approved and is now completed.*
///
///   - `reverted`: The expense has been reverted.
///
///     This status indicates that the transaction related to the expense has been reverted.
///     In such a case, the expense status is automatically set to `reverted`, and the expense is completed.
///     This can happen, for example, when the transaction has been reverted by the merchant.
///
/// _*Additionally, if an admin has previously approved the expense, marked it as repaid/completed, or requested repayment, they can revert their decision.
/// In such a case, the expense goes back to the initial `missing_info` state._
///
/// For more information, see the guides: [Retrieve expenses and receipts](https://developer.revolut.com/docs/guides/manage-accounts/accounts-and-transactions/retrieve-expenses#expense-state).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the state of the expense. Possible values:\n\n  - `missing_info`: The expense is missing some required information.\n\n    This is the initial state of the expense when it's first created.\n    Once the missing information is provided, the expense is ready to be submitted.\n\n  - `awaiting_review`: The expense is awaiting approval before it can be completed.\n\n    The approver can approve, reject, or request repayment for the expense.\n    It is also possible for the submitter to undo the submission at this stage.\n\n  - `rejected`: The expense has been rejected by the approver. \n\n    The expense submitter (typically, the payer) should fix the issue that was the reason for the rejection and resubmit the expense.\n\n  - `pending_reimbursement`: The reimbursement request has been approved, and the expense is awaiting reimbursement.\n\n    This state is possible for reimbursements (transaction type = `External`). \n\n  - `refund_requested`: The expense has been rejected and repayment has been requested.*\n\n    This state is possible for card transactions.\n    It indicates that following the review, the approver rejected the expense and requested that it be paid back to the business account.\n    This can happen, for example, if an employee accidentally makes a personal purchase with their business card.\n    Once the money has been returned, the **admin** can mark this expense as repaid.\n\n  - `refunded`: The expense has been repaid.*\n\n    This state indicates that the admin has marked the expense as repaid.\n\n  - `approved`: The expense has been approved and is now completed.*\n\n  - `reverted`: The expense has been reverted. \n\n    This status indicates that the transaction related to the expense has been reverted.\n    In such a case, the expense status is automatically set to `reverted`, and the expense is completed.\n    This can happen, for example, when the transaction has been reverted by the merchant.\n\n_*Additionally, if an admin has previously approved the expense, marked it as repaid/completed, or requested repayment, they can revert their decision.\nIn such a case, the expense goes back to the initial `missing_info` state._\n\nFor more information, see the guides: [Retrieve expenses and receipts](https://developer.revolut.com/docs/guides/manage-accounts/accounts-and-transactions/retrieve-expenses#expense-state).",
///  "type": "string",
///  "enum": [
///    "missing_info",
///    "awaiting_review",
///    "rejected",
///    "pending_reimbursement",
///    "refund_requested",
///    "refunded",
///    "approved",
///    "reverted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ExpenseState {
    #[serde(rename = "missing_info")]
    MissingInfo,
    #[serde(rename = "awaiting_review")]
    AwaitingReview,
    #[serde(rename = "rejected")]
    Rejected,
    #[serde(rename = "pending_reimbursement")]
    PendingReimbursement,
    #[serde(rename = "refund_requested")]
    RefundRequested,
    #[serde(rename = "refunded")]
    Refunded,
    #[serde(rename = "approved")]
    Approved,
    #[serde(rename = "reverted")]
    Reverted,
}
impl ::std::fmt::Display for ExpenseState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::MissingInfo => f.write_str("missing_info"),
            Self::AwaitingReview => f.write_str("awaiting_review"),
            Self::Rejected => f.write_str("rejected"),
            Self::PendingReimbursement => f.write_str("pending_reimbursement"),
            Self::RefundRequested => f.write_str("refund_requested"),
            Self::Refunded => f.write_str("refunded"),
            Self::Approved => f.write_str("approved"),
            Self::Reverted => f.write_str("reverted"),
        }
    }
}
impl ::std::str::FromStr for ExpenseState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "missing_info" => Ok(Self::MissingInfo),
            "awaiting_review" => Ok(Self::AwaitingReview),
            "rejected" => Ok(Self::Rejected),
            "pending_reimbursement" => Ok(Self::PendingReimbursement),
            "refund_requested" => Ok(Self::RefundRequested),
            "refunded" => Ok(Self::Refunded),
            "approved" => Ok(Self::Approved),
            "reverted" => Ok(Self::Reverted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ExpenseState {
    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 ExpenseState {
    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 ExpenseState {
    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 [transaction](https://developer.revolut.com/docs/business/get-transaction) related to the expense.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the [transaction](https://developer.revolut.com/docs/business/get-transaction) related to the expense.",
///  "type": "string",
///  "enum": [
///    "atm",
///    "card_payment",
///    "fee",
///    "transfer",
///    "external",
///    "mileage_reimbursement"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ExpenseTransactionType {
    #[serde(rename = "atm")]
    Atm,
    #[serde(rename = "card_payment")]
    CardPayment,
    #[serde(rename = "fee")]
    Fee,
    #[serde(rename = "transfer")]
    Transfer,
    #[serde(rename = "external")]
    External,
    #[serde(rename = "mileage_reimbursement")]
    MileageReimbursement,
}
impl ::std::fmt::Display for ExpenseTransactionType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Atm => f.write_str("atm"),
            Self::CardPayment => f.write_str("card_payment"),
            Self::Fee => f.write_str("fee"),
            Self::Transfer => f.write_str("transfer"),
            Self::External => f.write_str("external"),
            Self::MileageReimbursement => f.write_str("mileage_reimbursement"),
        }
    }
}
impl ::std::str::FromStr for ExpenseTransactionType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "atm" => Ok(Self::Atm),
            "card_payment" => Ok(Self::CardPayment),
            "fee" => Ok(Self::Fee),
            "transfer" => Ok(Self::Transfer),
            "external" => Ok(Self::External),
            "mileage_reimbursement" => Ok(Self::MileageReimbursement),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ExpenseTransactionType {
    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 ExpenseTransactionType {
    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 ExpenseTransactionType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`Expenses`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Expense"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Expenses(pub ::std::vec::Vec<Expense>);
impl ::std::ops::Deref for Expenses {
    type Target = ::std::vec::Vec<Expense>;
    fn deref(&self) -> &::std::vec::Vec<Expense> {
        &self.0
    }
}
impl ::std::convert::From<Expenses> for ::std::vec::Vec<Expense> {
    fn from(value: Expenses) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Expense>> for Expenses {
    fn from(value: ::std::vec::Vec<Expense>) -> Self {
        Self(value)
    }
}
///`Fee`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "amount": {
///      "description": "The fee amount.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Fee {
    ///The fee amount.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<f64>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
}
impl ::std::default::Default for Fee {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            currency: Default::default(),
        }
    }
}
/// The name of the counterparty, provided when the counterparty is an **individual** (personal account type) and is **not** being added via Revtag.
///
/// If specified, `company_name` and `name` must be empty.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the counterparty, provided when the counterparty is an **individual** (personal account type) and is **not** being added via Revtag.\n\nIf specified, `company_name` and `name` must be empty.",
///  "type": "object",
///  "properties": {
///    "first_name": {
///      "description": "The first name of the individual counterparty.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the individual counterparty.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IndividualName {
    ///The first name of the individual counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub first_name: ::std::option::Option<::std::string::String>,
    ///The last name of the individual counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_name: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for IndividualName {
    fn default() -> Self {
        Self {
            first_name: Default::default(),
            last_name: Default::default(),
        }
    }
}
///A label group with the selected label from that group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A label group with the selected label from that group.",
///  "type": "array",
///  "items": {
///    "type": "string"
///  },
///  "maxItems": 1,
///  "minItems": 1
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LabelGroup(pub [::std::string::String; 1usize]);
impl ::std::ops::Deref for LabelGroup {
    type Target = [::std::string::String; 1usize];
    fn deref(&self) -> &[::std::string::String; 1usize] {
        &self.0
    }
}
impl ::std::convert::From<LabelGroup> for [::std::string::String; 1usize] {
    fn from(value: LabelGroup) -> Self {
        value.0
    }
}
impl ::std::convert::From<[::std::string::String; 1usize]> for LabelGroup {
    fn from(value: [::std::string::String; 1usize]) -> Self {
        Self(value)
    }
}
///`LabelGroupResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the label group was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The unique ID of the label group.",
///      "readOnly": true,
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the label group.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    },
///    "updated_at": {
///      "description": "The date and time the label group was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LabelGroupResponse {
    ///The date and time the label group was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID of the label group.
    pub id: ::uuid::Uuid,
    ///The name of the label group.
    pub name: LabelGroupResponseName,
    ///The date and time the label group was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The name of the label group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the label group.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LabelGroupResponseName(::std::string::String);
impl ::std::ops::Deref for LabelGroupResponseName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LabelGroupResponseName> for ::std::string::String {
    fn from(value: LabelGroupResponseName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LabelGroupResponseName {
    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 LabelGroupResponseName {
    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 LabelGroupResponseName {
    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 LabelGroupResponseName {
    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 LabelGroupResponseName {
    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())
            })
    }
}
///`LabelResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the label was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The unique ID of the label.",
///      "readOnly": true,
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the label.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    },
///    "updated_at": {
///      "description": "The date and time the label was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LabelResponse {
    ///The date and time the label was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID of the label.
    pub id: ::uuid::Uuid,
    ///The name of the label.
    pub name: LabelResponseName,
    ///The date and time the label was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The name of the label.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the label.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LabelResponseName(::std::string::String);
impl ::std::ops::Deref for LabelResponseName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LabelResponseName> for ::std::string::String {
    fn from(value: LabelResponseName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LabelResponseName {
    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 LabelResponseName {
    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 LabelResponseName {
    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 LabelResponseName {
    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 LabelResponseName {
    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())
            })
    }
}
///`MerchantControlsSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "control_type",
///    "merchant_ids"
///  ],
///  "properties": {
///    "control_type": {
///      "description": "The type of control to apply.",
///      "type": "string",
///      "enum": [
///        "block",
///        "allow"
///      ]
///    },
///    "merchant_ids": {
///      "description": "The list of IDs of merchants to which the control applies.\n\n:::tip\nTo find merchant IDs, check transaction details (→ `merchant.id`).\nYou can fetch transaction details for a [specific transaction](https://developer.revolut.com/docs/business/get-transaction#response) or for [all transactions](https://developer.revolut.com/docs/business/get-transactions#response).\n:::",
///      "type": "array",
///      "items": {
///        "type": "string",
///        "format": "uuid"
///      },
///      "maxItems": 20,
///      "minItems": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MerchantControlsSchema {
    ///The type of control to apply.
    pub control_type: MerchantControlsSchemaControlType,
    /// The list of IDs of merchants to which the control applies.
    ///
    /// :::tip
    /// To find merchant IDs, check transaction details (→ `merchant.id`).
    /// You can fetch transaction details for a [specific transaction](https://developer.revolut.com/docs/business/get-transaction#response) or for [all transactions](https://developer.revolut.com/docs/business/get-transactions#response).
    /// :::
    pub merchant_ids: ::std::vec::Vec<::uuid::Uuid>,
}
///The type of control to apply.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of control to apply.",
///  "type": "string",
///  "enum": [
///    "block",
///    "allow"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum MerchantControlsSchemaControlType {
    #[serde(rename = "block")]
    Block,
    #[serde(rename = "allow")]
    Allow,
}
impl ::std::fmt::Display for MerchantControlsSchemaControlType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Block => f.write_str("block"),
            Self::Allow => f.write_str("allow"),
        }
    }
}
impl ::std::str::FromStr for MerchantControlsSchemaControlType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "block" => Ok(Self::Block),
            "allow" => Ok(Self::Allow),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for MerchantControlsSchemaControlType {
    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 MerchantControlsSchemaControlType {
    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 MerchantControlsSchemaControlType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Cursor for the next page.
/// Used for pagination when the total number of results exceeds the maximum number per page.
///
/// To get the next page of results, make a new request and set `page_token` to the `next_page_token` value returned in the previous response.
/// :::note
/// If there are no more results to fetch, `next_page_token` is not returned in the response.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Cursor for the next page. \nUsed for pagination when the total number of results exceeds the maximum number per page.\n\nTo get the next page of results, make a new request and set `page_token` to the `next_page_token` value returned in the previous response.\n:::note\nIf there are no more results to fetch, `next_page_token` is not returned in the response.\n:::",
///  "type": "string",
///  "format": "byte"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PageToken(pub ::std::string::String);
impl ::std::ops::Deref for PageToken {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PageToken> for ::std::string::String {
    fn from(value: PageToken) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PageToken {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PageToken {
    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 PageToken {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`PaymentDraftResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "payments"
///  ],
///  "properties": {
///    "payments": {
///      "description": "The list of payments in the bulk.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/PaymentInfo"
///      }
///    },
///    "scheduled_for": {
///      "description": "The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date"
///    },
///    "title": {
///      "description": "The title of the payment draft.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentDraftResponse {
    ///The list of payments in the bulk.
    pub payments: ::std::vec::Vec<PaymentInfo>,
    ///The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub scheduled_for: ::std::option::Option<::chrono::naive::NaiveDate>,
    ///The title of the payment draft.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub title: ::std::option::Option<::std::string::String>,
}
///`PaymentDraftsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "payment_orders"
///  ],
///  "properties": {
///    "payment_orders": {
///      "description": "The list of payment drafts that haven't been sent for processing.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/PaymentOrderInfo"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentDraftsResponse {
    ///The list of payment drafts that haven't been sent for processing.
    pub payment_orders: ::std::vec::Vec<PaymentOrderInfo>,
}
///The details of the payment draft.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the payment draft.",
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "current_charge_options",
///    "id",
///    "receiver",
///    "state"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account to pay from.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "amount": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "current_charge_options": {
///      "description": "The explanation of conversion process.",
///      "type": "object",
///      "required": [
///        "from",
///        "to"
///      ],
///      "properties": {
///        "fee": {
///          "$ref": "#/components/schemas/AmountWithCurrency"
///        },
///        "from": {
///          "$ref": "#/components/schemas/AmountWithCurrency"
///        },
///        "rate": {
///          "type": "string"
///        },
///        "to": {
///          "$ref": "#/components/schemas/AmountWithCurrency"
///        }
///      }
///    },
///    "error_message": {
///      "description": "The description of the error message.",
///      "type": "string"
///    },
///    "id": {
///      "description": "The ID of the payment.\n\nDo not confuse it with the [payment draft ID](https://developer.revolut.com/docs/business/get-payment-drafts#response) or [transaction ID](https://developer.revolut.com/docs/business/get-transaction).",
///      "type": "string",
///      "format": "uuid"
///    },
///    "reason": {
///      "description": "The reason for the current state.",
///      "type": "string"
///    },
///    "receiver": {
///      "$ref": "#/components/schemas/PaymentReceiver"
///    },
///    "reference": {
///      "description": "The description of the transaction.",
///      "type": "string"
///    },
///    "state": {
///      "$ref": "#/components/schemas/PaymentState"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentInfo {
    ///The ID of the account to pay from.
    pub account_id: ::uuid::Uuid,
    pub amount: AmountWithCurrency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
    pub current_charge_options: PaymentInfoCurrentChargeOptions,
    ///The description of the error message.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub error_message: ::std::option::Option<::std::string::String>,
    /// The ID of the payment.
    ///
    /// Do not confuse it with the [payment draft ID](https://developer.revolut.com/docs/business/get-payment-drafts#response) or [transaction ID](https://developer.revolut.com/docs/business/get-transaction).
    pub id: ::uuid::Uuid,
    ///The reason for the current state.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<::std::string::String>,
    pub receiver: PaymentReceiver,
    ///The description of the transaction.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<::std::string::String>,
    pub state: PaymentState,
}
///The explanation of conversion process.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The explanation of conversion process.",
///  "type": "object",
///  "required": [
///    "from",
///    "to"
///  ],
///  "properties": {
///    "fee": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    },
///    "from": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    },
///    "rate": {
///      "type": "string"
///    },
///    "to": {
///      "$ref": "#/components/schemas/AmountWithCurrency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentInfoCurrentChargeOptions {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fee: ::std::option::Option<AmountWithCurrency>,
    pub from: AmountWithCurrency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub rate: ::std::option::Option<::std::string::String>,
    pub to: AmountWithCurrency,
}
///A list of payments.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of payments.",
///  "type": "object",
///  "required": [
///    "id",
///    "payments_count"
///  ],
///  "properties": {
///    "id": {
///      "description": "The ID of the payment draft.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "payments_count": {
///      "description": "The number of payments in the payment draft.",
///      "type": "integer"
///    },
///    "scheduled_for": {
///      "description": "The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date"
///    },
///    "title": {
///      "description": "The title of the payment draft.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentOrderInfo {
    ///The ID of the payment draft.
    pub id: ::uuid::Uuid,
    ///The number of payments in the payment draft.
    pub payments_count: i64,
    ///The scheduled date of the payment draft in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub scheduled_for: ::std::option::Option<::chrono::naive::NaiveDate>,
    ///The title of the payment draft.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub title: ::std::option::Option<::std::string::String>,
}
/// The details of the transfer recipient.
///
/// If the counterparty has multiple payment methods available (e.g. 2 accounts, or 1 account and 1 card), you must specify the account (`account_id`) or card (`card_id`) to which you want to transfer the money.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the transfer recipient.\n\nIf the counterparty has multiple payment methods available (e.g. 2 accounts, or 1 account and 1 card), you must specify the account (`account_id`) or card (`card_id`) to which you want to transfer the money.",
///  "type": "object",
///  "required": [
///    "counterparty_id"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the receiving counterparty's account. Used for bank transfers.\n\nIf the counterparty has multiple payment methods available, use it to specify the account to which you want to send the money.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "card_id": {
///      "description": "The ID of the receiving counterparty's card.\nUsed for card transfers.\n\nIf the counterparty has multiple payment methods available, use it to specify the card to which you want to send the money.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "counterparty_id": {
///      "description": "The ID of the receiving counterparty.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentReceiver {
    /// The ID of the receiving counterparty's account. Used for bank transfers.
    ///
    /// If the counterparty has multiple payment methods available, use it to specify the account to which you want to send the money.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account_id: ::std::option::Option<::uuid::Uuid>,
    /// The ID of the receiving counterparty's card.
    /// Used for card transfers.
    ///
    /// If the counterparty has multiple payment methods available, use it to specify the card to which you want to send the money.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_id: ::std::option::Option<::uuid::Uuid>,
    ///The ID of the receiving counterparty.
    pub counterparty_id: ::uuid::Uuid,
}
///The details of the draft payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the draft payment.",
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "currency",
///    "receiver",
///    "reference"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account to pay from. \n\n:::note\nYou can specify only one account ID for multiple payments in the same payment draft.\n:::",
///      "type": "string"
///    },
///    "amount": {
///      "description": "The amount of the payment.",
///      "type": "number",
///      "format": "double"
///    },
///    "charge_bearer": {
///      "description": "The party that should bear the transaction fees related to the selected transaction route if applied.\nPossible options are: \n- `shared`: Also known as **SHA**. The transaction route fees are split between the sender and the recipient. \n  The sender pays the fees charged by their bank, while the recipient pays the fees charged by the receiving and any intermediary banks.\n- `debtor`: Also known as **OUR**. The sender pays all explicit transaction fees.\n\n:::note\n- This field is not supported for [bulk payments](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payment-drafts#use-cases). \n- Some transactions with fees might not support charge bearer selection.\n  If this is the case, the request will return error `3287`.\n  To proceed with the default fee handling, remove this field from your request and try again.\n:::",
///      "type": "string",
///      "enum": [
///        "shared",
///        "debtor"
///      ]
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "receiver": {
///      "$ref": "#/components/schemas/PaymentReceiver"
///    },
///    "reference": {
///      "description": "The reference for the payment.\nA piece of text or number you provide to help identify what the payment relates to.\nIt can be used, for example, for reconciliation or tracking purposes.\n\nYou might include an invoice number, account or transaction ID, or any other reference meaningful to you.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentRequest {
    /// The ID of the account to pay from.
    ///
    /// :::note
    /// You can specify only one account ID for multiple payments in the same payment draft.
    /// :::
    pub account_id: ::std::string::String,
    ///The amount of the payment.
    pub amount: f64,
    /// The party that should bear the transaction fees related to the selected transaction route if applied.
    /// Possible options are:
    /// - `shared`: Also known as **SHA**. The transaction route fees are split between the sender and the recipient.
    ///   The sender pays the fees charged by their bank, while the recipient pays the fees charged by the receiving and any intermediary banks.
    /// - `debtor`: Also known as **OUR**. The sender pays all explicit transaction fees.
    ///
    /// :::note
    /// - This field is not supported for [bulk payments](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payment-drafts#use-cases).
    /// - Some transactions with fees might not support charge bearer selection.
    ///   If this is the case, the request will return error `3287`.
    ///   To proceed with the default fee handling, remove this field from your request and try again.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub charge_bearer: ::std::option::Option<PaymentRequestChargeBearer>,
    pub currency: Currency,
    pub receiver: PaymentReceiver,
    /// The reference for the payment.
    /// A piece of text or number you provide to help identify what the payment relates to.
    /// It can be used, for example, for reconciliation or tracking purposes.
    ///
    /// You might include an invoice number, account or transaction ID, or any other reference meaningful to you.
    pub reference: ::std::string::String,
}
/// The party that should bear the transaction fees related to the selected transaction route if applied.
/// Possible options are:
/// - `shared`: Also known as **SHA**. The transaction route fees are split between the sender and the recipient.
///   The sender pays the fees charged by their bank, while the recipient pays the fees charged by the receiving and any intermediary banks.
/// - `debtor`: Also known as **OUR**. The sender pays all explicit transaction fees.
///
/// :::note
/// - This field is not supported for [bulk payments](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payment-drafts#use-cases).
/// - Some transactions with fees might not support charge bearer selection.
///   If this is the case, the request will return error `3287`.
///   To proceed with the default fee handling, remove this field from your request and try again.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The party that should bear the transaction fees related to the selected transaction route if applied.\nPossible options are: \n- `shared`: Also known as **SHA**. The transaction route fees are split between the sender and the recipient. \n  The sender pays the fees charged by their bank, while the recipient pays the fees charged by the receiving and any intermediary banks.\n- `debtor`: Also known as **OUR**. The sender pays all explicit transaction fees.\n\n:::note\n- This field is not supported for [bulk payments](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payment-drafts#use-cases). \n- Some transactions with fees might not support charge bearer selection.\n  If this is the case, the request will return error `3287`.\n  To proceed with the default fee handling, remove this field from your request and try again.\n:::",
///  "type": "string",
///  "enum": [
///    "shared",
///    "debtor"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentRequestChargeBearer {
    #[serde(rename = "shared")]
    Shared,
    #[serde(rename = "debtor")]
    Debtor,
}
impl ::std::fmt::Display for PaymentRequestChargeBearer {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Shared => f.write_str("shared"),
            Self::Debtor => f.write_str("debtor"),
        }
    }
}
impl ::std::str::FromStr for PaymentRequestChargeBearer {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "shared" => Ok(Self::Shared),
            "debtor" => Ok(Self::Debtor),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentRequestChargeBearer {
    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 PaymentRequestChargeBearer {
    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 PaymentRequestChargeBearer {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Indicates the state of the transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the state of the transaction.",
///  "type": "string",
///  "enum": [
///    "CREATED",
///    "PENDING",
///    "COMPLETED",
///    "REVERTED",
///    "DECLINED",
///    "CANCELLED",
///    "FAILED",
///    "DELETED"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentState {
    #[serde(rename = "CREATED")]
    Created,
    #[serde(rename = "PENDING")]
    Pending,
    #[serde(rename = "COMPLETED")]
    Completed,
    #[serde(rename = "REVERTED")]
    Reverted,
    #[serde(rename = "DECLINED")]
    Declined,
    #[serde(rename = "CANCELLED")]
    Cancelled,
    #[serde(rename = "FAILED")]
    Failed,
    #[serde(rename = "DELETED")]
    Deleted,
}
impl ::std::fmt::Display for PaymentState {
    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::Reverted => f.write_str("REVERTED"),
            Self::Declined => f.write_str("DECLINED"),
            Self::Cancelled => f.write_str("CANCELLED"),
            Self::Failed => f.write_str("FAILED"),
            Self::Deleted => f.write_str("DELETED"),
        }
    }
}
impl ::std::str::FromStr for PaymentState {
    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),
            "REVERTED" => Ok(Self::Reverted),
            "DECLINED" => Ok(Self::Declined),
            "CANCELLED" => Ok(Self::Cancelled),
            "FAILED" => Ok(Self::Failed),
            "DELETED" => Ok(Self::Deleted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentState {
    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 PaymentState {
    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 PaymentState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Indicates the payment scheme used to execute transactions.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the payment scheme used to execute transactions.",
///  "type": "string",
///  "enum": [
///    "chaps",
///    "bacs",
///    "faster_payments",
///    "sepa",
///    "swift",
///    "ach",
///    "elixir",
///    "sorbnet",
///    "nics",
///    "rix",
///    "sumclearing"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentSystem {
    #[serde(rename = "chaps")]
    Chaps,
    #[serde(rename = "bacs")]
    Bacs,
    #[serde(rename = "faster_payments")]
    FasterPayments,
    #[serde(rename = "sepa")]
    Sepa,
    #[serde(rename = "swift")]
    Swift,
    #[serde(rename = "ach")]
    Ach,
    #[serde(rename = "elixir")]
    Elixir,
    #[serde(rename = "sorbnet")]
    Sorbnet,
    #[serde(rename = "nics")]
    Nics,
    #[serde(rename = "rix")]
    Rix,
    #[serde(rename = "sumclearing")]
    Sumclearing,
}
impl ::std::fmt::Display for PaymentSystem {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Chaps => f.write_str("chaps"),
            Self::Bacs => f.write_str("bacs"),
            Self::FasterPayments => f.write_str("faster_payments"),
            Self::Sepa => f.write_str("sepa"),
            Self::Swift => f.write_str("swift"),
            Self::Ach => f.write_str("ach"),
            Self::Elixir => f.write_str("elixir"),
            Self::Sorbnet => f.write_str("sorbnet"),
            Self::Nics => f.write_str("nics"),
            Self::Rix => f.write_str("rix"),
            Self::Sumclearing => f.write_str("sumclearing"),
        }
    }
}
impl ::std::str::FromStr for PaymentSystem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "chaps" => Ok(Self::Chaps),
            "bacs" => Ok(Self::Bacs),
            "faster_payments" => Ok(Self::FasterPayments),
            "sepa" => Ok(Self::Sepa),
            "swift" => Ok(Self::Swift),
            "ach" => Ok(Self::Ach),
            "elixir" => Ok(Self::Elixir),
            "sorbnet" => Ok(Self::Sorbnet),
            "nics" => Ok(Self::Nics),
            "rix" => Ok(Self::Rix),
            "sumclearing" => Ok(Self::Sumclearing),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentSystem {
    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 PaymentSystem {
    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 PaymentSystem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`PayoutLink`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "allOf": [
///    {
///      "$ref": "#/components/schemas/PayoutLinkInitialProps"
///    },
///    {
///      "$ref": "#/components/schemas/PayoutLinkAdditionalProps"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PayoutLink {
    pub account_id: PayoutLinkAccountId,
    pub amount: PayoutLinkAmount,
    ///The reason for which the payout link was cancelled.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancellation_reason: ::std::option::Option<PayoutLinkCancellationReason>,
    /// The ID of the counterparty created based on the recipient's details.
    ///
    /// :::note
    /// By default, the newly created counterparty is hidden from your counterparties list.
    ///
    /// To automatically save it when the link is claimed, pass the `save_counterparty` parameter set to `true`.
    ///
    /// Alternatively, you can add the recipient to your counterparties later from the list of transactions in the Business app.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub counterparty_id: ::std::option::Option<::uuid::Uuid>,
    pub counterparty_name: PayoutLinkCounterpartyName,
    ///The date and time the payout link was created in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_date: ::std::option::Option<PayoutLinkExpiryDate>,
    ///The ID of the payout link.
    pub id: ::uuid::Uuid,
    pub payout_methods: PayoutLinkPayoutMethods,
    pub reference: PayoutLinkReference,
    pub request_id: PayoutLinkRequestId,
    /// Indicates whether you chose to save the recipient as your counterparty upon link claim.
    /// If `false` then the counterparty will not show up on your counterparties list, for example, when you [retrieve your counterparties](https://developer.revolut.com/docs/business/get-counterparties).
    /// However, you can still [retrieve this counterparty by its ID](https://developer.revolut.com/docs/business/get-counterparty).
    ///
    /// If you didn't choose to save the counterparty on link creation, you can still do it from your transactions list in the Business app.
    pub save_counterparty: bool,
    pub state: PayoutLinkState,
    ///The ID of the created transaction. Returned only if the payout has been claimed.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transaction_id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transfer_reason_code: ::std::option::Option<TransferReasonCode>,
    ///The date and time the payout link was last updated in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The URL of the payout link. Returned only for active payout links.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<::std::string::String>,
}
///The ID of the sender's account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the sender's account.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutLinkAccountId(pub ::uuid::Uuid);
impl ::std::ops::Deref for PayoutLinkAccountId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkAccountId> for ::uuid::Uuid {
    fn from(value: PayoutLinkAccountId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PayoutLinkAccountId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkAccountId {
    type Err = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkAccountId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PayoutLinkAccountId {
    type Error = <::uuid::Uuid as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PayoutLinkAccountId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`PayoutLinkAdditionalProps`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "cancellation_reason": {
///      "description": "The reason for which the payout link was cancelled.",
///      "readOnly": true,
///      "type": "string",
///      "enum": [
///        "too_many_name_check_attempts"
///      ]
///    },
///    "counterparty_id": {
///      "description": "The ID of the counterparty created based on the recipient's details. \n\n:::note\nBy default, the newly created counterparty is hidden from your counterparties list. \n\nTo automatically save it when the link is claimed, pass the `save_counterparty` parameter set to `true`. \n\nAlternatively, you can add the recipient to your counterparties later from the list of transactions in the Business app.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "transaction_id": {
///      "description": "The ID of the created transaction. Returned only if the payout has been claimed.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PayoutLinkAdditionalProps {
    ///The reason for which the payout link was cancelled.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancellation_reason: ::std::option::Option<PayoutLinkAdditionalPropsCancellationReason>,
    /// The ID of the counterparty created based on the recipient's details.
    ///
    /// :::note
    /// By default, the newly created counterparty is hidden from your counterparties list.
    ///
    /// To automatically save it when the link is claimed, pass the `save_counterparty` parameter set to `true`.
    ///
    /// Alternatively, you can add the recipient to your counterparties later from the list of transactions in the Business app.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub counterparty_id: ::std::option::Option<::uuid::Uuid>,
    ///The ID of the created transaction. Returned only if the payout has been claimed.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transaction_id: ::std::option::Option<::uuid::Uuid>,
}
impl ::std::default::Default for PayoutLinkAdditionalProps {
    fn default() -> Self {
        Self {
            cancellation_reason: Default::default(),
            counterparty_id: Default::default(),
            transaction_id: Default::default(),
        }
    }
}
///The reason for which the payout link was cancelled.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason for which the payout link was cancelled.",
///  "readOnly": true,
///  "type": "string",
///  "enum": [
///    "too_many_name_check_attempts"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutLinkAdditionalPropsCancellationReason {
    #[serde(rename = "too_many_name_check_attempts")]
    TooManyNameCheckAttempts,
}
impl ::std::fmt::Display for PayoutLinkAdditionalPropsCancellationReason {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TooManyNameCheckAttempts => f.write_str("too_many_name_check_attempts"),
        }
    }
}
impl ::std::str::FromStr for PayoutLinkAdditionalPropsCancellationReason {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "too_many_name_check_attempts" => Ok(Self::TooManyNameCheckAttempts),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkAdditionalPropsCancellationReason {
    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 PayoutLinkAdditionalPropsCancellationReason
{
    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 PayoutLinkAdditionalPropsCancellationReason
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The amount of money to be transferred.
///
/// :::note
/// The amount must be between £1 and £2,500, or equivalent in the selected currency.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of money to be transferred.\n\n:::note\nThe amount must be between £1 and £2,500, or equivalent in the selected currency.\n:::",
///  "type": "number",
///  "format": "double"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutLinkAmount(pub f64);
impl ::std::ops::Deref for PayoutLinkAmount {
    type Target = f64;
    fn deref(&self) -> &f64 {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkAmount> for f64 {
    fn from(value: PayoutLinkAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<f64> for PayoutLinkAmount {
    fn from(value: f64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkAmount {
    type Err = <f64 as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkAmount {
    type Error = <f64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PayoutLinkAmount {
    type Error = <f64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PayoutLinkAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The reason for which the payout link was cancelled.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason for which the payout link was cancelled.",
///  "readOnly": true,
///  "type": "string",
///  "enum": [
///    "too_many_name_check_attempts"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutLinkCancellationReason {
    #[serde(rename = "too_many_name_check_attempts")]
    TooManyNameCheckAttempts,
}
impl ::std::fmt::Display for PayoutLinkCancellationReason {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TooManyNameCheckAttempts => f.write_str("too_many_name_check_attempts"),
        }
    }
}
impl ::std::str::FromStr for PayoutLinkCancellationReason {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "too_many_name_check_attempts" => Ok(Self::TooManyNameCheckAttempts),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkCancellationReason {
    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 PayoutLinkCancellationReason {
    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 PayoutLinkCancellationReason {
    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 counterparty provided by the sender.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the counterparty provided by the sender.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PayoutLinkCounterpartyName(pub ::std::string::String);
impl ::std::ops::Deref for PayoutLinkCounterpartyName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkCounterpartyName> for ::std::string::String {
    fn from(value: PayoutLinkCounterpartyName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PayoutLinkCounterpartyName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkCounterpartyName {
    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 PayoutLinkCounterpartyName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The date and time after which the payout link expires in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
/// If the recipient doesn't claim the money before then, the payout link expires and is no longer available.
///
/// The default and maximum value is the date and time of creating the link + 7 days.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time after which the payout link expires in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).\nIf the recipient doesn't claim the money before then, the payout link expires and is no longer available.\n\nThe default and maximum value is the date and time of creating the link + 7 days.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutLinkExpiryDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for PayoutLinkExpiryDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkExpiryDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: PayoutLinkExpiryDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for PayoutLinkExpiryDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkExpiryDate {
    type Err = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
        Ok(Self(value.parse()?))
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkExpiryDate {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PayoutLinkExpiryDate {
    type Error = <::chrono::DateTime<::chrono::offset::Utc> as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PayoutLinkExpiryDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The period after which the payout link expires if not claimed before, provided in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
///
/// The default and maximum value is 7 days from the link creation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The period after which the payout link expires if not claimed before, provided in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).\n\nThe default and maximum value is 7 days from the link creation.",
///  "type": "string",
///  "format": "duration"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PayoutLinkExpiryPeriod(pub ::std::string::String);
impl ::std::ops::Deref for PayoutLinkExpiryPeriod {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkExpiryPeriod> for ::std::string::String {
    fn from(value: PayoutLinkExpiryPeriod) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PayoutLinkExpiryPeriod {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkExpiryPeriod {
    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 PayoutLinkExpiryPeriod {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`PayoutLinkInitialProps`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "counterparty_name",
///    "created_at",
///    "currency",
///    "id",
///    "payout_methods",
///    "reference",
///    "request_id",
///    "save_counterparty",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "account_id": {
///      "$ref": "#/components/schemas/PayoutLinkAccountId"
///    },
///    "amount": {
///      "$ref": "#/components/schemas/PayoutLinkAmount"
///    },
///    "counterparty_name": {
///      "$ref": "#/components/schemas/PayoutLinkCounterpartyName"
///    },
///    "created_at": {
///      "description": "The date and time the payout link was created in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "expiry_date": {
///      "$ref": "#/components/schemas/PayoutLinkExpiryDate"
///    },
///    "id": {
///      "description": "The ID of the payout link.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "payout_methods": {
///      "$ref": "#/components/schemas/PayoutLinkPayoutMethods"
///    },
///    "reference": {
///      "$ref": "#/components/schemas/PayoutLinkReference"
///    },
///    "request_id": {
///      "$ref": "#/components/schemas/PayoutLinkRequestId"
///    },
///    "save_counterparty": {
///      "description": "Indicates whether you chose to save the recipient as your counterparty upon link claim. \nIf `false` then the counterparty will not show up on your counterparties list, for example, when you [retrieve your counterparties](https://developer.revolut.com/docs/business/get-counterparties). \nHowever, you can still [retrieve this counterparty by its ID](https://developer.revolut.com/docs/business/get-counterparty).\n\nIf you didn't choose to save the counterparty on link creation, you can still do it from your transactions list in the Business app.",
///      "type": "boolean"
///    },
///    "state": {
///      "$ref": "#/components/schemas/PayoutLinkState"
///    },
///    "transfer_reason_code": {
///      "$ref": "#/components/schemas/TransferReasonCode"
///    },
///    "updated_at": {
///      "description": "The date and time the payout link was last updated in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).",
///      "type": "string",
///      "format": "date-time"
///    },
///    "url": {
///      "description": "The URL of the payout link. Returned only for active payout links.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PayoutLinkInitialProps {
    pub account_id: PayoutLinkAccountId,
    pub amount: PayoutLinkAmount,
    pub counterparty_name: PayoutLinkCounterpartyName,
    ///The date and time the payout link was created in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_date: ::std::option::Option<PayoutLinkExpiryDate>,
    ///The ID of the payout link.
    pub id: ::uuid::Uuid,
    pub payout_methods: PayoutLinkPayoutMethods,
    pub reference: PayoutLinkReference,
    pub request_id: PayoutLinkRequestId,
    /// Indicates whether you chose to save the recipient as your counterparty upon link claim.
    /// If `false` then the counterparty will not show up on your counterparties list, for example, when you [retrieve your counterparties](https://developer.revolut.com/docs/business/get-counterparties).
    /// However, you can still [retrieve this counterparty by its ID](https://developer.revolut.com/docs/business/get-counterparty).
    ///
    /// If you didn't choose to save the counterparty on link creation, you can still do it from your transactions list in the Business app.
    pub save_counterparty: bool,
    pub state: PayoutLinkState,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transfer_reason_code: ::std::option::Option<TransferReasonCode>,
    ///The date and time the payout link was last updated in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601).
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The URL of the payout link. Returned only for active payout links.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<::std::string::String>,
}
/// The list of payout methods that the recipient can use to claim the payout, where:
/// - `revolut`: Revolut peer-to-peer (P2P) transfer
/// - `bank_account`: External bank transfer
/// - `card`: Card transfer
///   :::note
///   - This payout method is available in the UK and the EEA.
///   - This payout method is not available in Sandbox.
///   :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The list of payout methods that the recipient can use to claim the payout, where:\n- `revolut`: Revolut peer-to-peer (P2P) transfer\n- `bank_account`: External bank transfer\n- `card`: Card transfer\n  :::note\n  - This payout method is available in the UK and the EEA.\n  - This payout method is not available in Sandbox.\n  :::",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/PayoutMethod"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutLinkPayoutMethods(pub ::std::vec::Vec<PayoutMethod>);
impl ::std::ops::Deref for PayoutLinkPayoutMethods {
    type Target = ::std::vec::Vec<PayoutMethod>;
    fn deref(&self) -> &::std::vec::Vec<PayoutMethod> {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkPayoutMethods> for ::std::vec::Vec<PayoutMethod> {
    fn from(value: PayoutLinkPayoutMethods) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<PayoutMethod>> for PayoutLinkPayoutMethods {
    fn from(value: ::std::vec::Vec<PayoutMethod>) -> Self {
        Self(value)
    }
}
///The reference for the payout transaction, provided by the sender.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reference for the payout transaction, provided by the sender.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PayoutLinkReference(pub ::std::string::String);
impl ::std::ops::Deref for PayoutLinkReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkReference> for ::std::string::String {
    fn from(value: PayoutLinkReference) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PayoutLinkReference {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkReference {
    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 PayoutLinkReference {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ID of the request, provided by the sender.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the request, provided by the sender.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PayoutLinkRequestId(pub ::std::string::String);
impl ::std::ops::Deref for PayoutLinkRequestId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinkRequestId> for ::std::string::String {
    fn from(value: PayoutLinkRequestId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PayoutLinkRequestId {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutLinkRequestId {
    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 PayoutLinkRequestId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The state that the payout link is in. Possible states are:
/// - `created`: The payout link has been created, but the amount has not yet been [blocked](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payout-links#sender-link-generation).
/// - `failed`: The payout link couldn't be generated due to a failure during transaction booking.
/// - `awaiting`: The payout link is awaiting approval.
/// - `active`: The payout link can be redeemed.
/// - `expired`: The payout link cannot be redeemed because it wasn't claimed before its expiry date.
/// - `cancelled`: The payout link cannot be redeemed because it was cancelled.
/// - `processing`: The payout link has been redeemed and is being processed.
/// - `processed`: The payout link has been redeemed and the money has been transferred to the recipient.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state that the payout link is in. Possible states are:\n- `created`: The payout link has been created, but the amount has not yet been [blocked](https://developer.revolut.com/docs/guides/manage-accounts/transfers/payout-links#sender-link-generation).\n- `failed`: The payout link couldn't be generated due to a failure during transaction booking.\n- `awaiting`: The payout link is awaiting approval.\n- `active`: The payout link can be redeemed.\n- `expired`: The payout link cannot be redeemed because it wasn't claimed before its expiry date.\n- `cancelled`: The payout link cannot be redeemed because it was cancelled.\n- `processing`: The payout link has been redeemed and is being processed.\n- `processed`: The payout link has been redeemed and the money has been transferred to the recipient.",
///  "type": "string",
///  "enum": [
///    "created",
///    "failed",
///    "awaiting",
///    "active",
///    "expired",
///    "cancelled",
///    "processing",
///    "processed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutLinkState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "awaiting")]
    Awaiting,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "expired")]
    Expired,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "processed")]
    Processed,
}
impl ::std::fmt::Display for PayoutLinkState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("created"),
            Self::Failed => f.write_str("failed"),
            Self::Awaiting => f.write_str("awaiting"),
            Self::Active => f.write_str("active"),
            Self::Expired => f.write_str("expired"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Processing => f.write_str("processing"),
            Self::Processed => f.write_str("processed"),
        }
    }
}
impl ::std::str::FromStr for PayoutLinkState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "created" => Ok(Self::Created),
            "failed" => Ok(Self::Failed),
            "awaiting" => Ok(Self::Awaiting),
            "active" => Ok(Self::Active),
            "expired" => Ok(Self::Expired),
            "cancelled" => Ok(Self::Cancelled),
            "processing" => Ok(Self::Processing),
            "processed" => Ok(Self::Processed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutLinkState {
    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 PayoutLinkState {
    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 PayoutLinkState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A list of payout links
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of payout links",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/PayoutLink"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutLinks(pub ::std::vec::Vec<PayoutLink>);
impl ::std::ops::Deref for PayoutLinks {
    type Target = ::std::vec::Vec<PayoutLink>;
    fn deref(&self) -> &::std::vec::Vec<PayoutLink> {
        &self.0
    }
}
impl ::std::convert::From<PayoutLinks> for ::std::vec::Vec<PayoutLink> {
    fn from(value: PayoutLinks) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<PayoutLink>> for PayoutLinks {
    fn from(value: ::std::vec::Vec<PayoutLink>) -> Self {
        Self(value)
    }
}
///The payout method that the recipient can use to claim the payout.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The payout method that the recipient can use to claim the payout.",
///  "type": "string",
///  "enum": [
///    "revolut",
///    "bank_account",
///    "card"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutMethod {
    #[serde(rename = "revolut")]
    Revolut,
    #[serde(rename = "bank_account")]
    BankAccount,
    #[serde(rename = "card")]
    Card,
}
impl ::std::fmt::Display for PayoutMethod {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Revolut => f.write_str("revolut"),
            Self::BankAccount => f.write_str("bank_account"),
            Self::Card => f.write_str("card"),
        }
    }
}
impl ::std::str::FromStr for PayoutMethod {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "revolut" => Ok(Self::Revolut),
            "bank_account" => Ok(Self::BankAccount),
            "card" => Ok(Self::Card),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutMethod {
    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 PayoutMethod {
    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 PayoutMethod {
    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 counterparty.
/// Indicates whether the recipient is an individual or a company.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the counterparty.\nIndicates whether the recipient is an individual or a company.",
///  "type": "string",
///  "enum": [
///    "personal",
///    "business"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ProfileType {
    #[serde(rename = "personal")]
    Personal,
    #[serde(rename = "business")]
    Business,
}
impl ::std::fmt::Display for ProfileType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Personal => f.write_str("personal"),
            Self::Business => f.write_str("business"),
        }
    }
}
impl ::std::str::FromStr for ProfileType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "personal" => Ok(Self::Personal),
            "business" => Ok(Self::Business),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ProfileType {
    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 ProfileType {
    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 ProfileType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Successfully created resource.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Successfully created resource.",
///  "type": "object",
///  "properties": {
///    "id": {
///      "description": "The ID of the created resource.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceCreatedResponse {
    ///The ID of the created resource.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
}
impl ::std::default::Default for ResourceCreatedResponse {
    fn default() -> Self {
        Self {
            id: Default::default(),
        }
    }
}
///`Role`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the role was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the role. This can be a UUID or other default role such as `OWNER`.",
///      "type": "string"
///    },
///    "name": {
///      "description": "The name of the role.",
///      "type": "string"
///    },
///    "updated_at": {
///      "description": "The date and time the role was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Role {
    ///The date and time the role was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the role. This can be a UUID or other default role such as `OWNER`.
    pub id: ::std::string::String,
    ///The name of the role.
    pub name: ::std::string::String,
    ///The date and time the role was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The [spend program](https://help.revolut.com/business/help/making-paymentsbusiness/spend-controls/setting-card-presets-for-my-team-members/) assigned to the card.
/// :::note
/// To use this property, please contact [Revolut API Support](mailto:api-requests@revolut.com).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The [spend program](https://help.revolut.com/business/help/making-paymentsbusiness/spend-controls/setting-card-presets-for-my-team-members/) assigned to the card.\n:::note\nTo use this property, please contact [Revolut API Support](mailto:api-requests@revolut.com).\n:::",
///  "readOnly": true,
///  "type": "object",
///  "required": [
///    "label"
///  ],
///  "properties": {
///    "label": {
///      "description": "The name of the spend program.",
///      "type": "string",
///      "maxLength": 30
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpendProgram {
    ///The name of the spend program.
    pub label: SpendProgramLabel,
}
///The name of the spend program.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the spend program.",
///  "type": "string",
///  "maxLength": 30
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SpendProgramLabel(::std::string::String);
impl ::std::ops::Deref for SpendProgramLabel {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SpendProgramLabel> for ::std::string::String {
    fn from(value: SpendProgramLabel) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SpendProgramLabel {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 30usize {
            return Err("longer than 30 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SpendProgramLabel {
    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 SpendProgramLabel {
    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 SpendProgramLabel {
    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 SpendProgramLabel {
    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 limit for transactions within a given period.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The limit for transactions within a given period.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The value of the spending limit.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/TransactionLimitCurrency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpendingLimitPeriodic {
    ///The value of the spending limit.
    pub amount: f64,
    pub currency: TransactionLimitCurrency,
}
///The limit for a single transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The limit for a single transaction.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The value of the spending limit.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/TransactionLimitCurrency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpendingLimitSingleTransaction {
    ///The value of the spending limit.
    pub amount: f64,
    pub currency: TransactionLimitCurrency,
}
///`SpendingLimits`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "$ref": "#/components/schemas/SpendingLimitsSchema"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SpendingLimits(pub SpendingLimitsSchema);
impl ::std::ops::Deref for SpendingLimits {
    type Target = SpendingLimitsSchema;
    fn deref(&self) -> &SpendingLimitsSchema {
        &self.0
    }
}
impl ::std::convert::From<SpendingLimits> for SpendingLimitsSchema {
    fn from(value: SpendingLimits) -> Self {
        value.0
    }
}
impl ::std::convert::From<SpendingLimitsSchema> for SpendingLimits {
    fn from(value: SpendingLimitsSchema) -> Self {
        Self(value)
    }
}
///`SpendingLimitsSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "all_time": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    },
///    "day": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    },
///    "month": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    },
///    "quarter": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    },
///    "single": {
///      "$ref": "#/components/schemas/SpendingLimitSingleTransaction"
///    },
///    "week": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    },
///    "year": {
///      "$ref": "#/components/schemas/SpendingLimitPeriodic"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SpendingLimitsSchema {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub all_time: ::std::option::Option<SpendingLimitPeriodic>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub day: ::std::option::Option<SpendingLimitPeriodic>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub month: ::std::option::Option<SpendingLimitPeriodic>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub quarter: ::std::option::Option<SpendingLimitPeriodic>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub single: ::std::option::Option<SpendingLimitSingleTransaction>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub week: ::std::option::Option<SpendingLimitPeriodic>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub year: ::std::option::Option<SpendingLimitPeriodic>,
}
impl ::std::default::Default for SpendingLimitsSchema {
    fn default() -> Self {
        Self {
            all_time: Default::default(),
            day: Default::default(),
            month: Default::default(),
            quarter: Default::default(),
            single: Default::default(),
            week: Default::default(),
            year: Default::default(),
        }
    }
}
///`SpendingPeriodSchema`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "anyOf": [
///    {
///      "required": [
///        "start_date"
///      ]
///    },
///    {
///      "required": [
///        "end_date",
///        "end_date_action"
///      ]
///    }
///  ],
///  "properties": {
///    "end_date": {
///      "description": "The end date (inclusive) of the spending period, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DD`).\nUses the [timezone set by the business](https://business.revolut.com/settings/appearance), or defaults to `Europe/London`.",
///      "type": "string",
///      "format": "date"
///    },
///    "end_date_action": {
///      "description": "The action to take after the end date of the spending period.",
///      "type": "string",
///      "enum": [
///        "lock",
///        "terminate"
///      ]
///    },
///    "start_date": {
///      "description": "The start date (inclusive) of the spending period, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DD`).\nUses the [timezone set by the business](https://business.revolut.com/settings/appearance), or defaults to `Europe/London`.",
///      "type": "string",
///      "format": "date"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SpendingPeriodSchema {
    Variant0 {
        /// The start date (inclusive) of the spending period, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DD`).
        /// Uses the [timezone set by the business](https://business.revolut.com/settings/appearance), or defaults to `Europe/London`.
        start_date: ::chrono::naive::NaiveDate,
    },
    Variant1 {
        /// The end date (inclusive) of the spending period, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DD`).
        /// Uses the [timezone set by the business](https://business.revolut.com/settings/appearance), or defaults to `Europe/London`.
        end_date: ::chrono::naive::NaiveDate,
        ///The action to take after the end date of the spending period.
        end_date_action: SpendingPeriodSchemaVariant1EndDateAction,
    },
}
///The action to take after the end date of the spending period.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The action to take after the end date of the spending period.",
///  "type": "string",
///  "enum": [
///    "lock",
///    "terminate"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SpendingPeriodSchemaVariant1EndDateAction {
    #[serde(rename = "lock")]
    Lock,
    #[serde(rename = "terminate")]
    Terminate,
}
impl ::std::fmt::Display for SpendingPeriodSchemaVariant1EndDateAction {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Lock => f.write_str("lock"),
            Self::Terminate => f.write_str("terminate"),
        }
    }
}
impl ::std::str::FromStr for SpendingPeriodSchemaVariant1EndDateAction {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "lock" => Ok(Self::Lock),
            "terminate" => Ok(Self::Terminate),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SpendingPeriodSchemaVariant1EndDateAction {
    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 SpendingPeriodSchemaVariant1EndDateAction {
    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 SpendingPeriodSchemaVariant1EndDateAction {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The [tax rate](https://developer.revolut.com/docs/business/tax-rates) applied to the expense split.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The [tax rate](https://developer.revolut.com/docs/business/tax-rates) applied to the expense split.",
///  "type": "object",
///  "required": [
///    "id",
///    "name"
///  ],
///  "properties": {
///    "id": {
///      "description": "The ID of the tax rate.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the tax.",
///      "type": "string",
///      "maxLength": 20,
///      "minLength": 1
///    },
///    "percentage": {
///      "description": "The tax rate percentage applied to the taxable amount. For example, `23` for 23%.",
///      "type": "number",
///      "format": "double",
///      "maximum": 100.0,
///      "minimum": 0.0
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TaxRate {
    ///The ID of the tax rate.
    pub id: ::uuid::Uuid,
    ///The name of the tax.
    pub name: TaxRateName,
    ///The tax rate percentage applied to the taxable amount. For example, `23` for 23%.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub percentage: ::std::option::Option<f64>,
}
///The name of the tax.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the tax.",
///  "type": "string",
///  "maxLength": 20,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TaxRateName(::std::string::String);
impl ::std::ops::Deref for TaxRateName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TaxRateName> for ::std::string::String {
    fn from(value: TaxRateName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TaxRateName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 20usize {
            return Err("longer than 20 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 TaxRateName {
    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 TaxRateName {
    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 TaxRateName {
    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 TaxRateName {
    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())
            })
    }
}
///`TaxRateResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the tax rate was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The unique ID of the tax rate.",
///      "readOnly": true,
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the tax.",
///      "type": "string",
///      "maxLength": 20,
///      "minLength": 1
///    },
///    "percentage": {
///      "description": "The tax rate percentage applied to the taxable amount. For example, `23` for 23%.\n\n:::note\nYou cannot create negative tax rates manually. \nHowever, negative tax rates might be synced from your accounting software, if integrated. \n:::",
///      "type": "number",
///      "format": "double",
///      "maximum": 100.0,
///      "minimum": -100.0
///    },
///    "updated_at": {
///      "description": "The date and time the tax rate was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "readOnly": true,
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TaxRateResponse {
    ///The date and time the tax rate was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The unique ID of the tax rate.
    pub id: ::uuid::Uuid,
    ///The name of the tax.
    pub name: TaxRateResponseName,
    /// The tax rate percentage applied to the taxable amount. For example, `23` for 23%.
    ///
    /// :::note
    /// You cannot create negative tax rates manually.
    /// However, negative tax rates might be synced from your accounting software, if integrated.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub percentage: ::std::option::Option<f64>,
    ///The date and time the tax rate was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The name of the tax.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the tax.",
///  "type": "string",
///  "maxLength": 20,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TaxRateResponseName(::std::string::String);
impl ::std::ops::Deref for TaxRateResponseName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TaxRateResponseName> for ::std::string::String {
    fn from(value: TaxRateResponseName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TaxRateResponseName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 20usize {
            return Err("longer than 20 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 TaxRateResponseName {
    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 TaxRateResponseName {
    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 TaxRateResponseName {
    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 TaxRateResponseName {
    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())
            })
    }
}
///`TeamMember`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "email",
///    "id",
///    "role_id",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the team member was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "email": {
///      "description": "The email of the team member.",
///      "type": "string",
///      "format": "email"
///    },
///    "first_name": {
///      "description": "The team member's first name.",
///      "type": "string"
///    },
///    "id": {
///      "description": "The ID of the team member.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_name": {
///      "description": "The team member's last name.",
///      "type": "string"
///    },
///    "role_id": {
///      "description": "The ID of the team member's [role](https://developer.revolut.com/docs/business/get-roles). This can be a UUID or other default role such as `Owner`.",
///      "type": "string"
///    },
///    "state": {
///      "$ref": "#/components/schemas/TeamMemberState"
///    },
///    "updated_at": {
///      "description": "The date and time the team member was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TeamMember {
    ///The date and time the team member was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The email of the team member.
    pub email: ::std::string::String,
    ///The team member's first name.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub first_name: ::std::option::Option<::std::string::String>,
    ///The ID of the team member.
    pub id: ::uuid::Uuid,
    ///The team member's last name.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_name: ::std::option::Option<::std::string::String>,
    ///The ID of the team member's [role](https://developer.revolut.com/docs/business/get-roles). This can be a UUID or other default role such as `Owner`.
    pub role_id: ::std::string::String,
    pub state: TeamMemberState,
    ///The date and time the team member was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The state that the team member is in.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state that the team member is in.",
///  "type": "string",
///  "enum": [
///    "created",
///    "confirmed",
///    "waiting",
///    "active",
///    "locked",
///    "disabled"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TeamMemberState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "confirmed")]
    Confirmed,
    #[serde(rename = "waiting")]
    Waiting,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "locked")]
    Locked,
    #[serde(rename = "disabled")]
    Disabled,
}
impl ::std::fmt::Display for TeamMemberState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Created => f.write_str("created"),
            Self::Confirmed => f.write_str("confirmed"),
            Self::Waiting => f.write_str("waiting"),
            Self::Active => f.write_str("active"),
            Self::Locked => f.write_str("locked"),
            Self::Disabled => f.write_str("disabled"),
        }
    }
}
impl ::std::str::FromStr for TeamMemberState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "created" => Ok(Self::Created),
            "confirmed" => Ok(Self::Confirmed),
            "waiting" => Ok(Self::Waiting),
            "active" => Ok(Self::Active),
            "locked" => Ok(Self::Locked),
            "disabled" => Ok(Self::Disabled),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TeamMemberState {
    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 TeamMemberState {
    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 TeamMemberState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`Transaction`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "legs",
///    "state",
///    "type",
///    "updated_at"
///  ],
///  "properties": {
///    "card": {
///      "$ref": "#/components/schemas/TransactionCard"
///    },
///    "completed_at": {
///      "description": "The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. \nThis is required when the transaction `state` is `completed`.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "created_at": {
///      "description": "The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the transaction.",
///      "type": "string"
///    },
///    "legs": {
///      "description": "The legs of the transaction:\n- For transactions between your Revolut accounts, there can be 2 legs, for example, an internal transfer made out of the GBP account and into the EUR account.\n- For transactions in other cases, there is only 1 leg.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/TransactionLeg"
///      }
///    },
///    "merchant": {
///      "$ref": "#/components/schemas/TransactionMerchant"
///    },
///    "reason_code": {
///      "description": "The reason code when the transaction `state` is `declined` or `failed`.",
///      "type": "string"
///    },
///    "reference": {
///      "description": "The payment reference.",
///      "type": "string"
///    },
///    "related_transaction_id": {
///      "description": "The ID of the original transaction to which this transaction is related. \nReturned, for example, when this transaction is a refund of the related transaction, or for transactions related to cashback.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "request_id": {
///      "description": "The request ID that you provided previously.",
///      "type": "string"
///    },
///    "scheduled_for": {
///      "description": "The scheduled date of the payment, if applicable.\nProvided in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date"
///    },
///    "state": {
///      "$ref": "#/components/schemas/TransactionState"
///    },
///    "type": {
///      "$ref": "#/components/schemas/TransactionType"
///    },
///    "updated_at": {
///      "description": "The date and time the transaction was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Transaction {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card: ::std::option::Option<TransactionCard>,
    /// The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    /// This is required when the transaction `state` is `completed`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the transaction.
    pub id: ::std::string::String,
    /// The legs of the transaction:
    /// - For transactions between your Revolut accounts, there can be 2 legs, for example, an internal transfer made out of the GBP account and into the EUR account.
    /// - For transactions in other cases, there is only 1 leg.
    pub legs: ::std::vec::Vec<TransactionLeg>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant: ::std::option::Option<TransactionMerchant>,
    ///The reason code when the transaction `state` is `declined` or `failed`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason_code: ::std::option::Option<::std::string::String>,
    ///The payment reference.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<::std::string::String>,
    /// The ID of the original transaction to which this transaction is related.
    /// Returned, for example, when this transaction is a refund of the related transaction, or for transactions related to cashback.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub related_transaction_id: ::std::option::Option<::uuid::Uuid>,
    ///The request ID that you provided previously.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub request_id: ::std::option::Option<::std::string::String>,
    /// The scheduled date of the payment, if applicable.
    /// Provided in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub scheduled_for: ::std::option::Option<::chrono::naive::NaiveDate>,
    pub state: TransactionState,
    #[serde(rename = "type")]
    pub type_: TransactionType,
    ///The date and time the transaction was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The details of the card associated with the transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the card associated with the transaction.",
///  "type": "object",
///  "properties": {
///    "card_number": {
///      "description": "The masked card number.",
///      "type": "string"
///    },
///    "first_name": {
///      "description": "The first name of the cardholder.",
///      "type": "string"
///    },
///    "id": {
///      "description": "The ID of the card.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_name": {
///      "description": "The last name of the cardholder.",
///      "type": "string"
///    },
///    "phone": {
///      "description": "The phone number of the cardholder in [E.164](https://en.wikipedia.org/wiki/E.164) format.",
///      "type": "string"
///    },
///    "references": {
///      "description": "Card references ([`references`](https://developer.revolut.com/docs/business/get-card#response)).\n\n:::note\nThese are the references that were assigned to the card at the time the transaction was made.\nAny [update](https://developer.revolut.com/docs/business/update-card-references) to card references does not affect existing transactions.\n:::",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/CardReference"
///      },
///      "maxItems": 5,
///      "minItems": 1,
///      "required": [
///        "card_number",
///        "id"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransactionCard {
    ///The masked card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_number: ::std::option::Option<::std::string::String>,
    ///The first name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub first_name: ::std::option::Option<::std::string::String>,
    ///The ID of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    ///The last name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_name: ::std::option::Option<::std::string::String>,
    ///The phone number of the cardholder in [E.164](https://en.wikipedia.org/wiki/E.164) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<::std::string::String>,
    /// Card references ([`references`](https://developer.revolut.com/docs/business/get-card#response)).
    ///
    /// :::note
    /// These are the references that were assigned to the card at the time the transaction was made.
    /// Any [update](https://developer.revolut.com/docs/business/update-card-references) to card references does not affect existing transactions.
    /// :::
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub references: ::std::vec::Vec<CardReference>,
}
impl ::std::default::Default for TransactionCard {
    fn default() -> Self {
        Self {
            card_number: Default::default(),
            first_name: Default::default(),
            id: Default::default(),
            last_name: Default::default(),
            phone: Default::default(),
            references: Default::default(),
        }
    }
}
///`TransactionCounterparty`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "account_type"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the counterparty account.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "account_type": {
///      "$ref": "#/components/schemas/TransactionCounterpartyAccountType"
///    },
///    "id": {
///      "description": "The ID of the counterparty.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransactionCounterparty {
    ///The ID of the counterparty account.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account_id: ::std::option::Option<::uuid::Uuid>,
    pub account_type: TransactionCounterpartyAccountType,
    ///The ID of the counterparty.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
}
///Indicates the type of the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the type of the account.",
///  "type": "string",
///  "enum": [
///    "self",
///    "revolut",
///    "external"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TransactionCounterpartyAccountType {
    #[serde(rename = "self")]
    Self_,
    #[serde(rename = "revolut")]
    Revolut,
    #[serde(rename = "external")]
    External,
}
impl ::std::fmt::Display for TransactionCounterpartyAccountType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Self_ => f.write_str("self"),
            Self::Revolut => f.write_str("revolut"),
            Self::External => f.write_str("external"),
        }
    }
}
impl ::std::str::FromStr for TransactionCounterpartyAccountType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "self" => Ok(Self::Self_),
            "revolut" => Ok(Self::Revolut),
            "external" => Ok(Self::External),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TransactionCounterpartyAccountType {
    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 TransactionCounterpartyAccountType {
    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 TransactionCounterpartyAccountType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The legs of the transaction:
/// - For transactions between your Revolut accounts, there can be 2 legs, for example, an internal transfer made out of the BGP account and into the EUR account.
/// - For transactions in other cases, there is only 1 leg.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The legs of the transaction:\n- For transactions between your Revolut accounts, there can be 2 legs, for example, an internal transfer made out of the BGP account and into the EUR account.\n- For transactions in other cases, there is only 1 leg.",
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "currency",
///    "leg_id"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account that the transaction is associated with.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "amount": {
///      "description": "The amount of the transaction.",
///      "type": "number",
///      "format": "double"
///    },
///    "balance": {
///      "description": "The total balance of the account that the transaction is associated with.",
///      "type": "number",
///      "format": "double"
///    },
///    "bill_amount": {
///      "description": "The billing amount for cross-currency payments.",
///      "type": "number",
///      "format": "double"
///    },
///    "bill_currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "counterparty": {
///      "$ref": "#/components/schemas/TransactionCounterparty"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "description": {
///      "description": "The transaction leg purpose.",
///      "type": "string"
///    },
///    "fee": {
///      "description": "The amount of the transaction fee.",
///      "type": "number",
///      "format": "double"
///    },
///    "leg_id": {
///      "description": "The ID of the leg.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransactionLeg {
    ///The ID of the account that the transaction is associated with.
    pub account_id: ::uuid::Uuid,
    ///The amount of the transaction.
    pub amount: f64,
    ///The total balance of the account that the transaction is associated with.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub balance: ::std::option::Option<f64>,
    ///The billing amount for cross-currency payments.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bill_amount: ::std::option::Option<f64>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bill_currency: ::std::option::Option<Currency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub counterparty: ::std::option::Option<TransactionCounterparty>,
    pub currency: Currency,
    ///The transaction leg purpose.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<::std::string::String>,
    ///The amount of the transaction fee.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fee: ::std::option::Option<f64>,
    ///The ID of the leg.
    pub leg_id: ::uuid::Uuid,
}
///The currency of the spending limit, provided as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code in upper case.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the spending limit, provided as [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 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 TransactionLimitCurrency(::std::string::String);
impl ::std::ops::Deref for TransactionLimitCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransactionLimitCurrency> for ::std::string::String {
    fn from(value: TransactionLimitCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TransactionLimitCurrency {
    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 TransactionLimitCurrency {
    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 TransactionLimitCurrency {
    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 TransactionLimitCurrency {
    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 TransactionLimitCurrency {
    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 about the merchant (only for card transactions).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The information about the merchant (only for card transactions).",
///  "type": "object",
///  "properties": {
///    "category_code": {
///      "description": "The category code of the merchant.",
///      "type": "string"
///    },
///    "city": {
///      "description": "The city of the merchant.",
///      "type": "string"
///    },
///    "country": {
///      "$ref": "#/components/schemas/CountryCodeMerchant"
///    },
///    "id": {
///      "description": "The ID of the merchant.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The name of the merchant.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransactionMerchant {
    ///The category code of the merchant.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub category_code: ::std::option::Option<::std::string::String>,
    ///The city of the merchant.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub city: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub country: ::std::option::Option<CountryCodeMerchant>,
    ///The ID of the merchant.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    ///The name of the merchant.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for TransactionMerchant {
    fn default() -> Self {
        Self {
            category_code: Default::default(),
            city: Default::default(),
            country: Default::default(),
            id: Default::default(),
            name: Default::default(),
        }
    }
}
///`TransactionPaymentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "account_id",
///    "amount",
///    "receiver",
///    "request_id"
///  ],
///  "properties": {
///    "account_id": {
///      "description": "The ID of the account that you send the funds from.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "amount": {
///      "description": "The amount to transfer.",
///      "type": "number",
///      "format": "double"
///    },
///    "charge_bearer": {
///      "$ref": "#/components/schemas/ChargeBearer"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "exchange_reason_code": {
///      "$ref": "#/components/schemas/ExchangeReasonCode"
///    },
///    "receiver": {
///      "$ref": "#/components/schemas/PaymentReceiver"
///    },
///    "reference": {
///      "description": "The reference for the payment.\nA piece of text or number you provide to help identify what the payment relates to.\nIt can be used, for example, for reconciliation or tracking purposes.\n\nYou might include an invoice number, account or transaction ID, or any other reference meaningful to you.\n\nIf the provided reference is longer than 140 characters, it will be truncated.\nNote that some recipient banks might truncate the reference even further.",
///      "type": "string",
///      "maxLength": 140
///    },
///    "request_id": {
///      "description": "A unique identifier for the transaction, provided by you.  \nThis is used for idempotency to prevent duplicate payments. \nThere are no strict format requirements, but we recommend using UUID v4 values.\n\n::::::tip[Retrying requests safely with idempotency]\nIf you do not receive a response (for example, due to a network error or timeout), you can safely retry the request using the same `request_id`. \n\nIf a transaction with the same `request_id` was already created, the API will not create a duplicate transaction.\n\n:::caution[Idempotency expiry]\nIdempotency checks apply only to transactions created **within the last 2 weeks**. \nReusing a `request_id` **after this period** may result in a **new transaction being created**.\n:::\n::::::",
///      "type": "string",
///      "maxLength": 40
///    },
///    "transfer_reason_code": {
///      "$ref": "#/components/schemas/TransferReasonCode"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransactionPaymentRequest {
    ///The ID of the account that you send the funds from.
    pub account_id: ::uuid::Uuid,
    ///The amount to transfer.
    pub amount: f64,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub charge_bearer: ::std::option::Option<ChargeBearer>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub exchange_reason_code: ::std::option::Option<ExchangeReasonCode>,
    pub receiver: PaymentReceiver,
    /// The reference for the payment.
    /// A piece of text or number you provide to help identify what the payment relates to.
    /// It can be used, for example, for reconciliation or tracking purposes.
    ///
    /// You might include an invoice number, account or transaction ID, or any other reference meaningful to you.
    ///
    /// If the provided reference is longer than 140 characters, it will be truncated.
    /// Note that some recipient banks might truncate the reference even further.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<TransactionPaymentRequestReference>,
    /// A unique identifier for the transaction, provided by you.
    /// This is used for idempotency to prevent duplicate payments.
    /// There are no strict format requirements, but we recommend using UUID v4 values.
    ///
    /// ::::::tip[Retrying requests safely with idempotency]
    /// If you do not receive a response (for example, due to a network error or timeout), you can safely retry the request using the same `request_id`.
    ///
    /// If a transaction with the same `request_id` was already created, the API will not create a duplicate transaction.
    ///
    /// :::caution[Idempotency expiry]
    /// Idempotency checks apply only to transactions created **within the last 2 weeks**.
    /// Reusing a `request_id` **after this period** may result in a **new transaction being created**.
    /// :::
    /// ::::::
    pub request_id: TransactionPaymentRequestRequestId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transfer_reason_code: ::std::option::Option<TransferReasonCode>,
}
/// The reference for the payment.
/// A piece of text or number you provide to help identify what the payment relates to.
/// It can be used, for example, for reconciliation or tracking purposes.
///
/// You might include an invoice number, account or transaction ID, or any other reference meaningful to you.
///
/// If the provided reference is longer than 140 characters, it will be truncated.
/// Note that some recipient banks might truncate the reference even further.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reference for the payment.\nA piece of text or number you provide to help identify what the payment relates to.\nIt can be used, for example, for reconciliation or tracking purposes.\n\nYou might include an invoice number, account or transaction ID, or any other reference meaningful to you.\n\nIf the provided reference is longer than 140 characters, it will be truncated.\nNote that some recipient banks might truncate the reference even further.",
///  "type": "string",
///  "maxLength": 140
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TransactionPaymentRequestReference(::std::string::String);
impl ::std::ops::Deref for TransactionPaymentRequestReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransactionPaymentRequestReference> for ::std::string::String {
    fn from(value: TransactionPaymentRequestReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TransactionPaymentRequestReference {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for TransactionPaymentRequestReference {
    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 TransactionPaymentRequestReference {
    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 TransactionPaymentRequestReference {
    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 TransactionPaymentRequestReference {
    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 unique identifier for the transaction, provided by you.
/// This is used for idempotency to prevent duplicate payments.
/// There are no strict format requirements, but we recommend using UUID v4 values.
///
/// ::::::tip[Retrying requests safely with idempotency]
/// If you do not receive a response (for example, due to a network error or timeout), you can safely retry the request using the same `request_id`.
///
/// If a transaction with the same `request_id` was already created, the API will not create a duplicate transaction.
///
/// :::caution[Idempotency expiry]
/// Idempotency checks apply only to transactions created **within the last 2 weeks**.
/// Reusing a `request_id` **after this period** may result in a **new transaction being created**.
/// :::
/// ::::::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A unique identifier for the transaction, provided by you.  \nThis is used for idempotency to prevent duplicate payments. \nThere are no strict format requirements, but we recommend using UUID v4 values.\n\n::::::tip[Retrying requests safely with idempotency]\nIf you do not receive a response (for example, due to a network error or timeout), you can safely retry the request using the same `request_id`. \n\nIf a transaction with the same `request_id` was already created, the API will not create a duplicate transaction.\n\n:::caution[Idempotency expiry]\nIdempotency checks apply only to transactions created **within the last 2 weeks**. \nReusing a `request_id` **after this period** may result in a **new transaction being created**.\n:::\n::::::",
///  "type": "string",
///  "maxLength": 40
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TransactionPaymentRequestRequestId(::std::string::String);
impl ::std::ops::Deref for TransactionPaymentRequestRequestId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransactionPaymentRequestRequestId> for ::std::string::String {
    fn from(value: TransactionPaymentRequestRequestId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TransactionPaymentRequestRequestId {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for TransactionPaymentRequestRequestId {
    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 TransactionPaymentRequestRequestId {
    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 TransactionPaymentRequestRequestId {
    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 TransactionPaymentRequestRequestId {
    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())
            })
    }
}
/// Indicates the transaction state. Possible values:
///   - `created`: The transaction has been created and is either processed asynchronously or scheduled for a later time.
///   - `pending`: The transaction is pending until it's being processed. If the transfer is made between Revolut accounts, this state is skipped and the transaction is executed instantly.
///   - `completed`: The transaction was successful.
///   - `declined`: The transaction was unsuccessful. This can happen for a variety of reasons, for example, insufficient account balance, wrong receiver information, etc.
///   - `failed`: The transaction was unsuccessful. This can happen for a variety of reasons, for example, invalid API calls, blocked payments, etc.
///   - `reverted`: The transaction was reverted. This can happen for a variety of reasons, for example, the receiver being inaccessible.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the transaction state. Possible values:\n  - `created`: The transaction has been created and is either processed asynchronously or scheduled for a later time.\n  - `pending`: The transaction is pending until it's being processed. If the transfer is made between Revolut accounts, this state is skipped and the transaction is executed instantly.\n  - `completed`: The transaction was successful.\n  - `declined`: The transaction was unsuccessful. This can happen for a variety of reasons, for example, insufficient account balance, wrong receiver information, etc.\n  - `failed`: The transaction was unsuccessful. This can happen for a variety of reasons, for example, invalid API calls, blocked payments, etc.\n  - `reverted`: The transaction was reverted. This can happen for a variety of reasons, for example, the receiver being inaccessible.",
///  "type": "string",
///  "enum": [
///    "created",
///    "pending",
///    "completed",
///    "declined",
///    "failed",
///    "reverted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TransactionState {
    #[serde(rename = "created")]
    Created,
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "declined")]
    Declined,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "reverted")]
    Reverted,
}
impl ::std::fmt::Display for TransactionState {
    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::Declined => f.write_str("declined"),
            Self::Failed => f.write_str("failed"),
            Self::Reverted => f.write_str("reverted"),
        }
    }
}
impl ::std::str::FromStr for TransactionState {
    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),
            "declined" => Ok(Self::Declined),
            "failed" => Ok(Self::Failed),
            "reverted" => Ok(Self::Reverted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TransactionState {
    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 TransactionState {
    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 TransactionState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Indicates the transaction type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the transaction type.",
///  "type": "string",
///  "enum": [
///    "atm",
///    "card_payment",
///    "card_refund",
///    "card_chargeback",
///    "card_credit",
///    "charge",
///    "charge_refund",
///    "exchange",
///    "transfer",
///    "loan",
///    "fee",
///    "refund",
///    "topup",
///    "topup_return",
///    "tax",
///    "tax_refund"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TransactionType {
    #[serde(rename = "atm")]
    Atm,
    #[serde(rename = "card_payment")]
    CardPayment,
    #[serde(rename = "card_refund")]
    CardRefund,
    #[serde(rename = "card_chargeback")]
    CardChargeback,
    #[serde(rename = "card_credit")]
    CardCredit,
    #[serde(rename = "charge")]
    Charge,
    #[serde(rename = "charge_refund")]
    ChargeRefund,
    #[serde(rename = "exchange")]
    Exchange,
    #[serde(rename = "transfer")]
    Transfer,
    #[serde(rename = "loan")]
    Loan,
    #[serde(rename = "fee")]
    Fee,
    #[serde(rename = "refund")]
    Refund,
    #[serde(rename = "topup")]
    Topup,
    #[serde(rename = "topup_return")]
    TopupReturn,
    #[serde(rename = "tax")]
    Tax,
    #[serde(rename = "tax_refund")]
    TaxRefund,
}
impl ::std::fmt::Display for TransactionType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Atm => f.write_str("atm"),
            Self::CardPayment => f.write_str("card_payment"),
            Self::CardRefund => f.write_str("card_refund"),
            Self::CardChargeback => f.write_str("card_chargeback"),
            Self::CardCredit => f.write_str("card_credit"),
            Self::Charge => f.write_str("charge"),
            Self::ChargeRefund => f.write_str("charge_refund"),
            Self::Exchange => f.write_str("exchange"),
            Self::Transfer => f.write_str("transfer"),
            Self::Loan => f.write_str("loan"),
            Self::Fee => f.write_str("fee"),
            Self::Refund => f.write_str("refund"),
            Self::Topup => f.write_str("topup"),
            Self::TopupReturn => f.write_str("topup_return"),
            Self::Tax => f.write_str("tax"),
            Self::TaxRefund => f.write_str("tax_refund"),
        }
    }
}
impl ::std::str::FromStr for TransactionType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "atm" => Ok(Self::Atm),
            "card_payment" => Ok(Self::CardPayment),
            "card_refund" => Ok(Self::CardRefund),
            "card_chargeback" => Ok(Self::CardChargeback),
            "card_credit" => Ok(Self::CardCredit),
            "charge" => Ok(Self::Charge),
            "charge_refund" => Ok(Self::ChargeRefund),
            "exchange" => Ok(Self::Exchange),
            "transfer" => Ok(Self::Transfer),
            "loan" => Ok(Self::Loan),
            "fee" => Ok(Self::Fee),
            "refund" => Ok(Self::Refund),
            "topup" => Ok(Self::Topup),
            "topup_return" => Ok(Self::TopupReturn),
            "tax" => Ok(Self::Tax),
            "tax_refund" => Ok(Self::TaxRefund),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TransactionType {
    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 TransactionType {
    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 TransactionType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`Transactions`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Transaction"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Transactions(pub ::std::vec::Vec<Transaction>);
impl ::std::ops::Deref for Transactions {
    type Target = ::std::vec::Vec<Transaction>;
    fn deref(&self) -> &::std::vec::Vec<Transaction> {
        &self.0
    }
}
impl ::std::convert::From<Transactions> for ::std::vec::Vec<Transaction> {
    fn from(value: Transactions) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Transaction>> for Transactions {
    fn from(value: ::std::vec::Vec<Transaction>) -> Self {
        Self(value)
    }
}
///`TransferReason`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "code",
///    "country",
///    "currency",
///    "description"
///  ],
///  "properties": {
///    "code": {
///      "$ref": "#/components/schemas/TransferReasonCodeEnum"
///    },
///    "country": {
///      "$ref": "#/components/schemas/CountryCode"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "description": {
///      "description": "The description of the given transfer reason.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferReason {
    pub code: TransferReasonCodeEnum,
    pub country: CountryCode,
    pub currency: Currency,
    ///The description of the given transfer reason.
    pub description: ::std::string::String,
}
/// The reason code for the transaction. Transactions to certain countries and currencies might require you to provide a transfer reason.
/// You can check available reason codes with the [`GET /transfer-reasons` operation](https://developer.revolut.com/docs/business/get-transfer-reasons).
///
/// If a transfer reason is not required for the given currency and country, this field is ignored.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason code for the transaction. Transactions to certain countries and currencies might require you to provide a transfer reason. \nYou can check available reason codes with the [`GET /transfer-reasons` operation](https://developer.revolut.com/docs/business/get-transfer-reasons).\n\nIf a transfer reason is not required for the given currency and country, this field is ignored.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct TransferReasonCode(pub ::std::string::String);
impl ::std::ops::Deref for TransferReasonCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransferReasonCode> for ::std::string::String {
    fn from(value: TransferReasonCode) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for TransferReasonCode {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TransferReasonCode {
    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 TransferReasonCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Category name of the transfer reason.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Category name of the transfer reason.",
///  "type": "string",
///  "enum": [
///    "advertising",
///    "advisor_fees",
///    "business_insurance",
///    "construction",
///    "delivery",
///    "education",
///    "family",
///    "fund_investment",
///    "goods",
///    "homesend",
///    "hotel",
///    "exports",
///    "insurance_claims",
///    "insurance_premium",
///    "loan_repayment",
///    "medical",
///    "office",
///    "other_fees",
///    "personal_transfer",
///    "property_purchase",
///    "property_rental",
///    "royalties",
///    "services",
///    "share_investment",
///    "tax",
///    "transfer",
///    "transportation",
///    "travel",
///    "utilities"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TransferReasonCodeEnum {
    #[serde(rename = "advertising")]
    Advertising,
    #[serde(rename = "advisor_fees")]
    AdvisorFees,
    #[serde(rename = "business_insurance")]
    BusinessInsurance,
    #[serde(rename = "construction")]
    Construction,
    #[serde(rename = "delivery")]
    Delivery,
    #[serde(rename = "education")]
    Education,
    #[serde(rename = "family")]
    Family,
    #[serde(rename = "fund_investment")]
    FundInvestment,
    #[serde(rename = "goods")]
    Goods,
    #[serde(rename = "homesend")]
    Homesend,
    #[serde(rename = "hotel")]
    Hotel,
    #[serde(rename = "exports")]
    Exports,
    #[serde(rename = "insurance_claims")]
    InsuranceClaims,
    #[serde(rename = "insurance_premium")]
    InsurancePremium,
    #[serde(rename = "loan_repayment")]
    LoanRepayment,
    #[serde(rename = "medical")]
    Medical,
    #[serde(rename = "office")]
    Office,
    #[serde(rename = "other_fees")]
    OtherFees,
    #[serde(rename = "personal_transfer")]
    PersonalTransfer,
    #[serde(rename = "property_purchase")]
    PropertyPurchase,
    #[serde(rename = "property_rental")]
    PropertyRental,
    #[serde(rename = "royalties")]
    Royalties,
    #[serde(rename = "services")]
    Services,
    #[serde(rename = "share_investment")]
    ShareInvestment,
    #[serde(rename = "tax")]
    Tax,
    #[serde(rename = "transfer")]
    Transfer,
    #[serde(rename = "transportation")]
    Transportation,
    #[serde(rename = "travel")]
    Travel,
    #[serde(rename = "utilities")]
    Utilities,
}
impl ::std::fmt::Display for TransferReasonCodeEnum {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Advertising => f.write_str("advertising"),
            Self::AdvisorFees => f.write_str("advisor_fees"),
            Self::BusinessInsurance => f.write_str("business_insurance"),
            Self::Construction => f.write_str("construction"),
            Self::Delivery => f.write_str("delivery"),
            Self::Education => f.write_str("education"),
            Self::Family => f.write_str("family"),
            Self::FundInvestment => f.write_str("fund_investment"),
            Self::Goods => f.write_str("goods"),
            Self::Homesend => f.write_str("homesend"),
            Self::Hotel => f.write_str("hotel"),
            Self::Exports => f.write_str("exports"),
            Self::InsuranceClaims => f.write_str("insurance_claims"),
            Self::InsurancePremium => f.write_str("insurance_premium"),
            Self::LoanRepayment => f.write_str("loan_repayment"),
            Self::Medical => f.write_str("medical"),
            Self::Office => f.write_str("office"),
            Self::OtherFees => f.write_str("other_fees"),
            Self::PersonalTransfer => f.write_str("personal_transfer"),
            Self::PropertyPurchase => f.write_str("property_purchase"),
            Self::PropertyRental => f.write_str("property_rental"),
            Self::Royalties => f.write_str("royalties"),
            Self::Services => f.write_str("services"),
            Self::ShareInvestment => f.write_str("share_investment"),
            Self::Tax => f.write_str("tax"),
            Self::Transfer => f.write_str("transfer"),
            Self::Transportation => f.write_str("transportation"),
            Self::Travel => f.write_str("travel"),
            Self::Utilities => f.write_str("utilities"),
        }
    }
}
impl ::std::str::FromStr for TransferReasonCodeEnum {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "advertising" => Ok(Self::Advertising),
            "advisor_fees" => Ok(Self::AdvisorFees),
            "business_insurance" => Ok(Self::BusinessInsurance),
            "construction" => Ok(Self::Construction),
            "delivery" => Ok(Self::Delivery),
            "education" => Ok(Self::Education),
            "family" => Ok(Self::Family),
            "fund_investment" => Ok(Self::FundInvestment),
            "goods" => Ok(Self::Goods),
            "homesend" => Ok(Self::Homesend),
            "hotel" => Ok(Self::Hotel),
            "exports" => Ok(Self::Exports),
            "insurance_claims" => Ok(Self::InsuranceClaims),
            "insurance_premium" => Ok(Self::InsurancePremium),
            "loan_repayment" => Ok(Self::LoanRepayment),
            "medical" => Ok(Self::Medical),
            "office" => Ok(Self::Office),
            "other_fees" => Ok(Self::OtherFees),
            "personal_transfer" => Ok(Self::PersonalTransfer),
            "property_purchase" => Ok(Self::PropertyPurchase),
            "property_rental" => Ok(Self::PropertyRental),
            "royalties" => Ok(Self::Royalties),
            "services" => Ok(Self::Services),
            "share_investment" => Ok(Self::ShareInvestment),
            "tax" => Ok(Self::Tax),
            "transfer" => Ok(Self::Transfer),
            "transportation" => Ok(Self::Transportation),
            "travel" => Ok(Self::Travel),
            "utilities" => Ok(Self::Utilities),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TransferReasonCodeEnum {
    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 TransferReasonCodeEnum {
    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 TransferReasonCodeEnum {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`TransferReasons`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/TransferReason"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TransferReasons(pub ::std::vec::Vec<TransferReason>);
impl ::std::ops::Deref for TransferReasons {
    type Target = ::std::vec::Vec<TransferReason>;
    fn deref(&self) -> &::std::vec::Vec<TransferReason> {
        &self.0
    }
}
impl ::std::convert::From<TransferReasons> for ::std::vec::Vec<TransferReason> {
    fn from(value: TransferReasons) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<TransferReason>> for TransferReasons {
    fn from(value: ::std::vec::Vec<TransferReason>) -> Self {
        Self(value)
    }
}
///Transfer the funds between accounts of the business in the same currency.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Transfer the funds between accounts of the business in the same currency.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency",
///    "request_id",
///    "source_account_id",
///    "target_account_id"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The amount of the funds to be transferred.",
///      "type": "number",
///      "format": "double"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "reference": {
///      "description": "The reference for the funds transfer.",
///      "type": "string"
///    },
///    "request_id": {
///      "description": "The ID of the request, provided by you.\nIt helps you identify the transaction in your system.\n\n:::caution\nTo ensure that a transfer is not processed multiple times if there are network or system errors,\nthe same `request_id` should be used for requests related to the same transfer.\n:::",
///      "type": "string",
///      "maxLength": 40
///    },
///    "source_account_id": {
///      "description": "The ID of the source account that you transfer the funds from.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "target_account_id": {
///      "description": "The ID of the target account that you transfer the funds to.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferRequest {
    ///The amount of the funds to be transferred.
    pub amount: f64,
    pub currency: Currency,
    ///The reference for the funds transfer.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<::std::string::String>,
    /// The ID of the request, provided by you.
    /// It helps you identify the transaction in your system.
    ///
    /// :::caution
    /// To ensure that a transfer is not processed multiple times if there are network or system errors,
    /// the same `request_id` should be used for requests related to the same transfer.
    /// :::
    pub request_id: TransferRequestRequestId,
    ///The ID of the source account that you transfer the funds from.
    pub source_account_id: ::uuid::Uuid,
    ///The ID of the target account that you transfer the funds to.
    pub target_account_id: ::uuid::Uuid,
}
/// The ID of the request, provided by you.
/// It helps you identify the transaction in your system.
///
/// :::caution
/// To ensure that a transfer is not processed multiple times if there are network or system errors,
/// the same `request_id` should be used for requests related to the same transfer.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the request, provided by you.\nIt helps you identify the transaction in your system.\n\n:::caution\nTo ensure that a transfer is not processed multiple times if there are network or system errors,\nthe same `request_id` should be used for requests related to the same transfer.\n:::",
///  "type": "string",
///  "maxLength": 40
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TransferRequestRequestId(::std::string::String);
impl ::std::ops::Deref for TransferRequestRequestId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TransferRequestRequestId> for ::std::string::String {
    fn from(value: TransferRequestRequestId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TransferRequestRequestId {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for TransferRequestRequestId {
    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 TransferRequestRequestId {
    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 TransferRequestRequestId {
    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 TransferRequestRequestId {
    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())
            })
    }
}
///`TransferResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "state"
///  ],
///  "properties": {
///    "completed_at": {
///      "description": "The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "created_at": {
///      "description": "The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the transaction created.",
///      "type": "string"
///    },
///    "state": {
///      "$ref": "#/components/schemas/TransactionState"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferResponse {
    ///The date and time the transaction was completed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The date and time the transaction was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the transaction created.
    pub id: ::std::string::String,
    pub state: TransactionState,
}
///The new settings for the accounting category.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new settings for the accounting category.",
///  "type": "object",
///  "minProperties": 1,
///  "properties": {
///    "code": {
///      "description": "The new code name for the accounting category.",
///      "type": "string",
///      "maxLength": 50,
///      "minLength": 1
///    },
///    "default_tax_rate_id": {
///      "description": "The ID of the new default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) that should be applied to items in this accounting category unless overridden for a specific item.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "name": {
///      "description": "The new full name for the accounting category.",
///      "type": "string",
///      "maxLength": 60,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateAccountingCategoryRequest {
    ///The new code name for the accounting category.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<UpdateAccountingCategoryRequestCode>,
    ///The ID of the new default [tax rate](https://developer.revolut.com/docs/business/get-tax-rate) that should be applied to items in this accounting category unless overridden for a specific item.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub default_tax_rate_id: ::std::option::Option<::uuid::Uuid>,
    ///The new full name for the accounting category.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<UpdateAccountingCategoryRequestName>,
}
impl ::std::default::Default for UpdateAccountingCategoryRequest {
    fn default() -> Self {
        Self {
            code: Default::default(),
            default_tax_rate_id: Default::default(),
            name: Default::default(),
        }
    }
}
///The new code name for the accounting category.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new code name for the accounting category.",
///  "type": "string",
///  "maxLength": 50,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UpdateAccountingCategoryRequestCode(::std::string::String);
impl ::std::ops::Deref for UpdateAccountingCategoryRequestCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<UpdateAccountingCategoryRequestCode> for ::std::string::String {
    fn from(value: UpdateAccountingCategoryRequestCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for UpdateAccountingCategoryRequestCode {
    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 UpdateAccountingCategoryRequestCode {
    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 UpdateAccountingCategoryRequestCode {
    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 UpdateAccountingCategoryRequestCode {
    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 UpdateAccountingCategoryRequestCode {
    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 new full name for the accounting category.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new full name for the accounting category.",
///  "type": "string",
///  "maxLength": 60,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UpdateAccountingCategoryRequestName(::std::string::String);
impl ::std::ops::Deref for UpdateAccountingCategoryRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<UpdateAccountingCategoryRequestName> for ::std::string::String {
    fn from(value: UpdateAccountingCategoryRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for UpdateAccountingCategoryRequestName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 60usize {
            return Err("longer than 60 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 UpdateAccountingCategoryRequestName {
    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 UpdateAccountingCategoryRequestName {
    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 UpdateAccountingCategoryRequestName {
    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 UpdateAccountingCategoryRequestName {
    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 new name for the label group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new name for the label group.",
///  "type": "object",
///  "required": [
///    "name"
///  ],
///  "properties": {
///    "name": {
///      "description": "The new name for the label group.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateLabelGroupRequest {
    ///The new name for the label group.
    pub name: UpdateLabelGroupRequestName,
}
///The new name for the label group.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new name for the label group.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UpdateLabelGroupRequestName(::std::string::String);
impl ::std::ops::Deref for UpdateLabelGroupRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<UpdateLabelGroupRequestName> for ::std::string::String {
    fn from(value: UpdateLabelGroupRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for UpdateLabelGroupRequestName {
    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 UpdateLabelGroupRequestName {
    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 UpdateLabelGroupRequestName {
    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 UpdateLabelGroupRequestName {
    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 UpdateLabelGroupRequestName {
    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 new name for the label.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new name for the label.",
///  "type": "object",
///  "required": [
///    "name"
///  ],
///  "properties": {
///    "name": {
///      "description": "The new name for the label.",
///      "type": "string",
///      "maxLength": 100,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateLabelRequest {
    ///The new name for the label.
    pub name: UpdateLabelRequestName,
}
///The new name for the label.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new name for the label.",
///  "type": "string",
///  "maxLength": 100,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UpdateLabelRequestName(::std::string::String);
impl ::std::ops::Deref for UpdateLabelRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<UpdateLabelRequestName> for ::std::string::String {
    fn from(value: UpdateLabelRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for UpdateLabelRequestName {
    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 UpdateLabelRequestName {
    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 UpdateLabelRequestName {
    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 UpdateLabelRequestName {
    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 UpdateLabelRequestName {
    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 new setting for the tax rate.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new setting for the tax rate.",
///  "type": "object",
///  "minProperties": 1,
///  "properties": {
///    "name": {
///      "description": "The new name for the tax rate.",
///      "type": "string",
///      "maxLength": 20,
///      "minLength": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateTaxRateRequest {
    ///The new name for the tax rate.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<UpdateTaxRateRequestName>,
}
impl ::std::default::Default for UpdateTaxRateRequest {
    fn default() -> Self {
        Self {
            name: Default::default(),
        }
    }
}
///The new name for the tax rate.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new name for the tax rate.",
///  "type": "string",
///  "maxLength": 20,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct UpdateTaxRateRequestName(::std::string::String);
impl ::std::ops::Deref for UpdateTaxRateRequestName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<UpdateTaxRateRequestName> for ::std::string::String {
    fn from(value: UpdateTaxRateRequestName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for UpdateTaxRateRequestName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 20usize {
            return Err("longer than 20 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 UpdateTaxRateRequestName {
    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 UpdateTaxRateRequestName {
    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 UpdateTaxRateRequestName {
    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 UpdateTaxRateRequestName {
    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())
            })
    }
}
///`UpdateWebhookRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "events": {
///      "description": "A list of event types to subscribe to.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/WebhookEventType"
///      }
///    },
///    "url": {
///      "$ref": "#/components/schemas/Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateWebhookRequest {
    ///A list of event types to subscribe to.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub events: ::std::vec::Vec<WebhookEventType>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<Url>,
}
impl ::std::default::Default for UpdateWebhookRequest {
    fn default() -> Self {
        Self {
            events: Default::default(),
            url: Default::default(),
        }
    }
}
///A valid webhook URL to which to send event notifications. The supported protocol is `https`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A valid webhook URL to which to send event notifications. The supported protocol is `https`.",
///  "type": "string",
///  "format": "uri"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Url(pub ::std::string::String);
impl ::std::ops::Deref for Url {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Url> for ::std::string::String {
    fn from(value: Url) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for Url {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for Url {
    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 Url {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`ValidateAccountNameRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ValidateAccountNameRequest(pub ::serde_json::Value);
impl ::std::ops::Deref for ValidateAccountNameRequest {
    type Target = ::serde_json::Value;
    fn deref(&self) -> &::serde_json::Value {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameRequest> for ::serde_json::Value {
    fn from(value: ValidateAccountNameRequest) -> Self {
        value.0
    }
}
impl ::std::convert::From<::serde_json::Value> for ValidateAccountNameRequest {
    fn from(value: ::serde_json::Value) -> Self {
        Self(value)
    }
}
///`ValidateAccountNameRequestAu`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "AU",
///  "type": "object",
///  "required": [
///    "account_no",
///    "bsb"
///  ],
///  "properties": {
///    "account_no": {
///      "description": "The account number of the counterparty.",
///      "type": "string"
///    },
///    "bsb": {
///      "description": "The BSB (Bank-State-Branch) number for the counterparty's account.\nUsed to identify the bank and branch in Australia.",
///      "type": "string"
///    },
///    "company_name": {
///      "description": "The name of the business counterparty.\n\n**Required** when the account type is business (`individual_name` is not specified).\n",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestAu {
    ///The account number of the counterparty.
    pub account_no: ::std::string::String,
    /// The BSB (Bank-State-Branch) number for the counterparty's account.
    /// Used to identify the bank and branch in Australia.
    pub bsb: ::std::string::String,
    /// The name of the business counterparty.
    ///
    /// **Required** when the account type is business (`individual_name` is not specified).
    ///
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameRequestAuIndividualName>,
}
/// The name of the individual counterparty, split into first name and last name.
///
/// **Required** when the account type is personal (`company_name` isn't specified).
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestAuIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
///`ValidateAccountNameRequestEur`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "EUR",
///  "type": "object",
///  "required": [
///    "iban",
///    "recipient_country",
///    "recipient_currency"
///  ],
///  "properties": {
///    "bic": {
///      "description": "The BIC (Bank Identifier Code) for the counterparty's account.\nAlso known as the SWIFT code.\nIt can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.",
///      "type": "string"
///    },
///    "company_name": {
///      "description": "The name of the business counterparty.\n\n**Required** when the account type is business (`individual_name` is not specified).\n",
///      "type": "string"
///    },
///    "iban": {
///      "description": "The IBAN (International Bank Account Number) for the counterparty's account.",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "recipient_country": {
///      "description": "The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///      "type": "string",
///      "pattern": "^[A-Z]{2}$"
///    },
///    "recipient_currency": {
///      "description": "The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.\n\nFor VoP, the **possible value** is `EUR`.\n",
///      "type": "string",
///      "pattern": "^[A-Z]{3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestEur {
    /// The BIC (Bank Identifier Code) for the counterparty's account.
    /// Also known as the SWIFT code.
    /// It can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bic: ::std::option::Option<::std::string::String>,
    /// The name of the business counterparty.
    ///
    /// **Required** when the account type is business (`individual_name` is not specified).
    ///
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    ///The IBAN (International Bank Account Number) for the counterparty's account.
    pub iban: ::std::string::String,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameRequestEurIndividualName>,
    ///The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
    pub recipient_country: ValidateAccountNameRequestEurRecipientCountry,
    /// The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.
    ///
    /// For VoP, the **possible value** is `EUR`.
    ///
    pub recipient_currency: ValidateAccountNameRequestEurRecipientCurrency,
}
/// The name of the individual counterparty, split into first name and last name.
///
/// **Required** when the account type is personal (`company_name` isn't specified).
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestEurIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
///The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ValidateAccountNameRequestEurRecipientCountry(::std::string::String);
impl ::std::ops::Deref for ValidateAccountNameRequestEurRecipientCountry {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameRequestEurRecipientCountry> for ::std::string::String {
    fn from(value: ValidateAccountNameRequestEurRecipientCountry) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ValidateAccountNameRequestEurRecipientCountry {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameRequestEurRecipientCountry {
    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 ValidateAccountNameRequestEurRecipientCountry
{
    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 ValidateAccountNameRequestEurRecipientCountry
{
    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 ValidateAccountNameRequestEurRecipientCountry {
    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 counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.
///
/// For VoP, the **possible value** is `EUR`.
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.\n\nFor VoP, the **possible value** is `EUR`.\n",
///  "type": "string",
///  "pattern": "^[A-Z]{3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ValidateAccountNameRequestEurRecipientCurrency(::std::string::String);
impl ::std::ops::Deref for ValidateAccountNameRequestEurRecipientCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameRequestEurRecipientCurrency>
    for ::std::string::String
{
    fn from(value: ValidateAccountNameRequestEurRecipientCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ValidateAccountNameRequestEurRecipientCurrency {
    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 ValidateAccountNameRequestEurRecipientCurrency {
    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 ValidateAccountNameRequestEurRecipientCurrency
{
    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 ValidateAccountNameRequestEurRecipientCurrency
{
    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 ValidateAccountNameRequestEurRecipientCurrency {
    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())
            })
    }
}
///`ValidateAccountNameRequestRo`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "RO",
///  "type": "object",
///  "required": [
///    "iban",
///    "recipient_country",
///    "recipient_currency"
///  ],
///  "properties": {
///    "bic": {
///      "description": "The BIC (Bank Identifier Code) for the counterparty's account.\nAlso known as the SWIFT code.\nThis value is optional. \nIt can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.",
///      "type": "string"
///    },
///    "company_name": {
///      "description": "The name of the business counterparty.\n\n**Required** when the account type is business (`individual_name` is not specified).\n\nⓘ Note that for [RO](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services), the name you provide helps identify the request, but is **not** used for the actual check.\nThe API simply returns the partially masked name associated with the IBAN for you to validate.\nTherefore, the returned name may differ from the one you provide.\n",
///      "type": "string"
///    },
///    "iban": {
///      "description": "The IBAN (International Bank Account Number) for the counterparty's account.",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n\nⓘ Note that for [RO](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services), the name you provide helps identify the request, but is **not** used for the actual check.\nThe API simply returns the partially masked name associated with the IBAN for you to validate.\nTherefore, the returned name may differ from the one you provide.\n",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "recipient_country": {
///      "description": "The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.\n\nFor RO CoP, the **possible value** is `RO`.",
///      "type": "string",
///      "pattern": "^[A-Z]{2}$"
///    },
///    "recipient_currency": {
///      "description": "The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.\n\nFor RO CoP, the **possible value** is `RON`.\n",
///      "type": "string",
///      "pattern": "^[A-Z]{3}$"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestRo {
    /// The BIC (Bank Identifier Code) for the counterparty's account.
    /// Also known as the SWIFT code.
    /// This value is optional.
    /// It can be provided, for example, when the automatic BIC detection fails and the check is unsuccessful.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bic: ::std::option::Option<::std::string::String>,
    /// The name of the business counterparty.
    ///
    /// **Required** when the account type is business (`individual_name` is not specified).
    ///
    /// ⓘ Note that for [RO](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services), the name you provide helps identify the request, but is **not** used for the actual check.
    /// The API simply returns the partially masked name associated with the IBAN for you to validate.
    /// Therefore, the returned name may differ from the one you provide.
    ///
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    ///The IBAN (International Bank Account Number) for the counterparty's account.
    pub iban: ::std::string::String,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameRequestRoIndividualName>,
    /// The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
    ///
    /// For RO CoP, the **possible value** is `RO`.
    pub recipient_country: ValidateAccountNameRequestRoRecipientCountry,
    /// The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.
    ///
    /// For RO CoP, the **possible value** is `RON`.
    ///
    pub recipient_currency: ValidateAccountNameRequestRoRecipientCurrency,
}
/// The name of the individual counterparty, split into first name and last name.
///
/// **Required** when the account type is personal (`company_name` isn't specified).
///
/// ⓘ Note that for [RO](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services), the name you provide helps identify the request, but is **not** used for the actual check.
/// The API simply returns the partially masked name associated with the IBAN for you to validate.
/// Therefore, the returned name may differ from the one you provide.
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n\nⓘ Note that for [RO](https://developer.revolut.com/docs/guides/manage-accounts/counterparties/confirmation-of-payee#supported-regions-and-services), the name you provide helps identify the request, but is **not** used for the actual check.\nThe API simply returns the partially masked name associated with the IBAN for you to validate.\nTherefore, the returned name may differ from the one you provide.\n",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestRoIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
/// The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.
///
/// For RO CoP, the **possible value** is `RO`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The counterparty's bank country, provided as a 2-letter [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) code.\n\nFor RO CoP, the **possible value** is `RO`.",
///  "type": "string",
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ValidateAccountNameRequestRoRecipientCountry(::std::string::String);
impl ::std::ops::Deref for ValidateAccountNameRequestRoRecipientCountry {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameRequestRoRecipientCountry> for ::std::string::String {
    fn from(value: ValidateAccountNameRequestRoRecipientCountry) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ValidateAccountNameRequestRoRecipientCountry {
    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}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameRequestRoRecipientCountry {
    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 ValidateAccountNameRequestRoRecipientCountry
{
    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 ValidateAccountNameRequestRoRecipientCountry
{
    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 ValidateAccountNameRequestRoRecipientCountry {
    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 counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.
///
/// For RO CoP, the **possible value** is `RON`.
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The counterparty account’s currency, provided as a 3-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code.\n\nFor RO CoP, the **possible value** is `RON`.\n",
///  "type": "string",
///  "pattern": "^[A-Z]{3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ValidateAccountNameRequestRoRecipientCurrency(::std::string::String);
impl ::std::ops::Deref for ValidateAccountNameRequestRoRecipientCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameRequestRoRecipientCurrency> for ::std::string::String {
    fn from(value: ValidateAccountNameRequestRoRecipientCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ValidateAccountNameRequestRoRecipientCurrency {
    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 ValidateAccountNameRequestRoRecipientCurrency {
    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 ValidateAccountNameRequestRoRecipientCurrency
{
    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 ValidateAccountNameRequestRoRecipientCurrency
{
    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 ValidateAccountNameRequestRoRecipientCurrency {
    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())
            })
    }
}
///`ValidateAccountNameRequestUk`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "UK",
///  "type": "object",
///  "required": [
///    "account_no",
///    "sort_code"
///  ],
///  "properties": {
///    "account_no": {
///      "description": "The account number of the counterparty.",
///      "type": "string"
///    },
///    "company_name": {
///      "description": "The name of the business counterparty.\n\n**Required** when the account type is business (`individual_name` is not specified).\n",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "sort_code": {
///      "description": "The sort code of the counterparty's account.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestUk {
    ///The account number of the counterparty.
    pub account_no: ::std::string::String,
    /// The name of the business counterparty.
    ///
    /// **Required** when the account type is business (`individual_name` is not specified).
    ///
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameRequestUkIndividualName>,
    ///The sort code of the counterparty's account.
    pub sort_code: ::std::string::String,
}
/// The name of the individual counterparty, split into first name and last name.
///
/// **Required** when the account type is personal (`company_name` isn't specified).
///
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the individual counterparty, split into first name and last name.\n\n**Required** when the account type is personal (`company_name` isn't specified).\n",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameRequestUkIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
///`ValidateAccountNameResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ValidateAccountNameResponse(pub ::serde_json::Value);
impl ::std::ops::Deref for ValidateAccountNameResponse {
    type Target = ::serde_json::Value;
    fn deref(&self) -> &::serde_json::Value {
        &self.0
    }
}
impl ::std::convert::From<ValidateAccountNameResponse> for ::serde_json::Value {
    fn from(value: ValidateAccountNameResponse) -> Self {
        value.0
    }
}
impl ::std::convert::From<::serde_json::Value> for ValidateAccountNameResponse {
    fn from(value: ::serde_json::Value) -> Self {
        Self(value)
    }
}
///`ValidateAccountNameResponseAu`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "AU",
///  "type": "object",
///  "required": [
///    "result_code"
///  ],
///  "properties": {
///    "company_name": {
///      "description": "The name of the recipient when the account type is business.\nProvided only if `individual_name` is not specified.\n\nWhen the name is a close match, the actual full name is returned.\nOtherwise, the name you provided is returned.\n\n:::tip[Mismatched name type is corrected]\nThe mismatched name type in the request is corrected in the response.\nThis means that, for example, if an individual recipient's name was provided under `company_name`, in the response it is returned under `individual_name`.\n:::",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual first and last names are returned.\nOtherwise, the name you provided is returned.\n\n:::tip[Mismatched name type is corrected]\nThe mismatched name type in the request is corrected in the response.\nThis means that, for example, if an individual recipient's name was provided under `company_name`, in the response it is returned under `individual_name`.\n:::",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "reason": {
///      "$ref": "#/components/schemas/AccountNameValidationReasonAU"
///    },
///    "result_code": {
///      "description": "The result of the check. \n\nPossible values for AU:\n- **`matched`:** The name matches the provided details.\n  For personal accounts, this also covers **close matches**, in which case the **actual name** is returned.\n- **`close_match` (business account):** The name is similar to the provided value.\n- **`not_matched`:** The name doesn't match the provided values.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///      "type": "string",
///      "enum": [
///        "matched",
///        "close_match",
///        "not_matched",
///        "cannot_be_checked",
///        "temporarily_unavailable"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseAu {
    /// The name of the recipient when the account type is business.
    /// Provided only if `individual_name` is not specified.
    ///
    /// When the name is a close match, the actual full name is returned.
    /// Otherwise, the name you provided is returned.
    ///
    /// :::tip[Mismatched name type is corrected]
    /// The mismatched name type in the request is corrected in the response.
    /// This means that, for example, if an individual recipient's name was provided under `company_name`, in the response it is returned under `individual_name`.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameResponseAuIndividualName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<AccountNameValidationReasonAu>,
    /// The result of the check.
    ///
    /// Possible values for AU:
    /// - **`matched`:** The name matches the provided details.
    ///   For personal accounts, this also covers **close matches**, in which case the **actual name** is returned.
    /// - **`close_match` (business account):** The name is similar to the provided value.
    /// - **`not_matched`:** The name doesn't match the provided values.
    /// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
    ///   For example, the recipient's bank doesn't support CoP.
    /// - **`temporarily_unavailable`:** The check cannot be performed right now.
    ///   For example, the recipient's bank didn't respond to our request.
    ///   You should retry the request later.
    pub result_code: ValidateAccountNameResponseAuResultCode,
}
/// The name of the recipient when the account type is personal.
/// Provided only if `company_name` is not specified.
///
/// When the name is a close match, the actual first and last names are returned.
/// Otherwise, the name you provided is returned.
///
/// :::tip[Mismatched name type is corrected]
/// The mismatched name type in the request is corrected in the response.
/// This means that, for example, if an individual recipient's name was provided under `company_name`, in the response it is returned under `individual_name`.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual first and last names are returned.\nOtherwise, the name you provided is returned.\n\n:::tip[Mismatched name type is corrected]\nThe mismatched name type in the request is corrected in the response.\nThis means that, for example, if an individual recipient's name was provided under `company_name`, in the response it is returned under `individual_name`.\n:::",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseAuIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
/// The result of the check.
///
/// Possible values for AU:
/// - **`matched`:** The name matches the provided details.
///   For personal accounts, this also covers **close matches**, in which case the **actual name** is returned.
/// - **`close_match` (business account):** The name is similar to the provided value.
/// - **`not_matched`:** The name doesn't match the provided values.
/// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
///   For example, the recipient's bank doesn't support CoP.
/// - **`temporarily_unavailable`:** The check cannot be performed right now.
///   For example, the recipient's bank didn't respond to our request.
///   You should retry the request later.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of the check. \n\nPossible values for AU:\n- **`matched`:** The name matches the provided details.\n  For personal accounts, this also covers **close matches**, in which case the **actual name** is returned.\n- **`close_match` (business account):** The name is similar to the provided value.\n- **`not_matched`:** The name doesn't match the provided values.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///  "type": "string",
///  "enum": [
///    "matched",
///    "close_match",
///    "not_matched",
///    "cannot_be_checked",
///    "temporarily_unavailable"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ValidateAccountNameResponseAuResultCode {
    #[serde(rename = "matched")]
    Matched,
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
    #[serde(rename = "temporarily_unavailable")]
    TemporarilyUnavailable,
}
impl ::std::fmt::Display for ValidateAccountNameResponseAuResultCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Matched => f.write_str("matched"),
            Self::CloseMatch => f.write_str("close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
            Self::TemporarilyUnavailable => f.write_str("temporarily_unavailable"),
        }
    }
}
impl ::std::str::FromStr for ValidateAccountNameResponseAuResultCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "matched" => Ok(Self::Matched),
            "close_match" => Ok(Self::CloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            "temporarily_unavailable" => Ok(Self::TemporarilyUnavailable),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameResponseAuResultCode {
    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 ValidateAccountNameResponseAuResultCode {
    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 ValidateAccountNameResponseAuResultCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ValidateAccountNameResponseEur`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "EUR",
///  "type": "object",
///  "required": [
///    "result_code"
///  ],
///  "properties": {
///    "company_name": {
///      "description": "The name of the recipient when the account type is business.\nProvided only if `individual_name` is not specified.\n\nWhen the name is a close match, the actual name is returned.\nOtherwise, the name you provided is returned.\n\n:::caution[Mismatched name type is not corrected]\nThe name type in the response is returned as it was provided in the request.\nFor example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual name is returned.\nOtherwise, the name you provided is returned.\n\n:::caution[Mismatched name type is not corrected]\nThe name type in the response is returned as it was provided in the request.\nFor example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "reason": {
///      "$ref": "#/components/schemas/AccountNameValidationReasonEUR"
///    },
///    "result_code": {
///      "description": "The result of the check. \n\nPossible values for EUR:\n- **`matched`:** The name matches the provided details.\n- **`close_match`:** The recipient's name is similar to the provided value.\n  The **actual name** is returned.\n- **`not_matched`:** The name and account type don't match the provided values.\n  The **name provided in the request** is returned.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support VoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///      "type": "string",
///      "enum": [
///        "matched",
///        "close_match",
///        "not_matched",
///        "cannot_be_checked",
///        "temporarily_unavailable"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseEur {
    /// The name of the recipient when the account type is business.
    /// Provided only if `individual_name` is not specified.
    ///
    /// When the name is a close match, the actual name is returned.
    /// Otherwise, the name you provided is returned.
    ///
    /// :::caution[Mismatched name type is not corrected]
    /// The name type in the response is returned as it was provided in the request.
    /// For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameResponseEurIndividualName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<AccountNameValidationReasonEur>,
    /// The result of the check.
    ///
    /// Possible values for EUR:
    /// - **`matched`:** The name matches the provided details.
    /// - **`close_match`:** The recipient's name is similar to the provided value.
    ///   The **actual name** is returned.
    /// - **`not_matched`:** The name and account type don't match the provided values.
    ///   The **name provided in the request** is returned.
    /// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
    ///   For example, the recipient's bank doesn't support VoP.
    /// - **`temporarily_unavailable`:** The check cannot be performed right now.
    ///   For example, the recipient's bank didn't respond to our request.
    ///   You should retry the request later.
    pub result_code: ValidateAccountNameResponseEurResultCode,
}
/// The name of the recipient when the account type is personal.
/// Provided only if `company_name` is not specified.
///
/// When the name is a close match, the actual name is returned.
/// Otherwise, the name you provided is returned.
///
/// :::caution[Mismatched name type is not corrected]
/// The name type in the response is returned as it was provided in the request.
/// For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual name is returned.\nOtherwise, the name you provided is returned.\n\n:::caution[Mismatched name type is not corrected]\nThe name type in the response is returned as it was provided in the request.\nFor example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseEurIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
/// The result of the check.
///
/// Possible values for EUR:
/// - **`matched`:** The name matches the provided details.
/// - **`close_match`:** The recipient's name is similar to the provided value.
///   The **actual name** is returned.
/// - **`not_matched`:** The name and account type don't match the provided values.
///   The **name provided in the request** is returned.
/// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
///   For example, the recipient's bank doesn't support VoP.
/// - **`temporarily_unavailable`:** The check cannot be performed right now.
///   For example, the recipient's bank didn't respond to our request.
///   You should retry the request later.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of the check. \n\nPossible values for EUR:\n- **`matched`:** The name matches the provided details.\n- **`close_match`:** The recipient's name is similar to the provided value.\n  The **actual name** is returned.\n- **`not_matched`:** The name and account type don't match the provided values.\n  The **name provided in the request** is returned.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support VoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///  "type": "string",
///  "enum": [
///    "matched",
///    "close_match",
///    "not_matched",
///    "cannot_be_checked",
///    "temporarily_unavailable"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ValidateAccountNameResponseEurResultCode {
    #[serde(rename = "matched")]
    Matched,
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
    #[serde(rename = "temporarily_unavailable")]
    TemporarilyUnavailable,
}
impl ::std::fmt::Display for ValidateAccountNameResponseEurResultCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Matched => f.write_str("matched"),
            Self::CloseMatch => f.write_str("close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
            Self::TemporarilyUnavailable => f.write_str("temporarily_unavailable"),
        }
    }
}
impl ::std::str::FromStr for ValidateAccountNameResponseEurResultCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "matched" => Ok(Self::Matched),
            "close_match" => Ok(Self::CloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            "temporarily_unavailable" => Ok(Self::TemporarilyUnavailable),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameResponseEurResultCode {
    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 ValidateAccountNameResponseEurResultCode {
    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 ValidateAccountNameResponseEurResultCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ValidateAccountNameResponseRo`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "RO",
///  "type": "object",
///  "required": [
///    "result_code"
///  ],
///  "properties": {
///    "company_name": {
///      "description": "The **partially masked** name of the recipient when the account type is business.\nProvided only if `individual_name` is not specified.\n\n:::caution[Name considerations]\n- The name you provide helps identify the request, but is not used for the actual check.\n  The API simply returns the partial name associated with the IBAN for you to validate.\n  Therefore, the **returned name may differ** from the one you provided.\n- **Mismatched name type is not corrected**.\n  This means that the name type in the response is returned as it was provided in the request.\n  For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The partial name of the recipient when the account type is personal, that is, the first name and the last name's initial.\nProvided only if `company_name` is not specified.\n\n:::caution[Name considerations]\n- The name you provide helps identify the request, but is not used for the actual check.\n  The API simply returns the partial name associated with the IBAN for you to validate.\n  Therefore, the **returned name may differ** from the one you provided.\n- **Mismatched name type is not corrected**.\n  This means that the name type in the response is returned as it was provided in the request.\n  For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The initial of the last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "reason": {
///      "$ref": "#/components/schemas/AccountNameValidationReasonRO"
///    },
///    "result_code": {
///      "description": "The result of the check. \n\nFor RO CoP, the API **checks if an account exists for the provided IBAN**.\nPossible results are:\n- **`matched`:** An account with the provided IBAN was found.\n  When this status is returned, the API also returns a partial name of the account holder.\n  Use this returned name to validate your recipient's details.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n    For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///      "type": "string",
///      "enum": [
///        "matched",
///        "close_match",
///        "not_matched",
///        "cannot_be_checked",
///        "temporarily_unavailable"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseRo {
    /// The **partially masked** name of the recipient when the account type is business.
    /// Provided only if `individual_name` is not specified.
    ///
    /// :::caution[Name considerations]
    /// - The name you provide helps identify the request, but is not used for the actual check.
    ///   The API simply returns the partial name associated with the IBAN for you to validate.
    ///   Therefore, the **returned name may differ** from the one you provided.
    /// - **Mismatched name type is not corrected**.
    ///   This means that the name type in the response is returned as it was provided in the request.
    ///   For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameResponseRoIndividualName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<AccountNameValidationReasonRo>,
    /// The result of the check.
    ///
    /// For RO CoP, the API **checks if an account exists for the provided IBAN**.
    /// Possible results are:
    /// - **`matched`:** An account with the provided IBAN was found.
    ///   When this status is returned, the API also returns a partial name of the account holder.
    ///   Use this returned name to validate your recipient's details.
    /// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
    ///     For example, the recipient's bank doesn't support CoP.
    /// - **`temporarily_unavailable`:** The check cannot be performed right now.
    ///   For example, the recipient's bank didn't respond to our request.
    ///   You should retry the request later.
    pub result_code: ValidateAccountNameResponseRoResultCode,
}
/// The partial name of the recipient when the account type is personal, that is, the first name and the last name's initial.
/// Provided only if `company_name` is not specified.
///
/// :::caution[Name considerations]
/// - The name you provide helps identify the request, but is not used for the actual check.
///   The API simply returns the partial name associated with the IBAN for you to validate.
///   Therefore, the **returned name may differ** from the one you provided.
/// - **Mismatched name type is not corrected**.
///   This means that the name type in the response is returned as it was provided in the request.
///   For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The partial name of the recipient when the account type is personal, that is, the first name and the last name's initial.\nProvided only if `company_name` is not specified.\n\n:::caution[Name considerations]\n- The name you provide helps identify the request, but is not used for the actual check.\n  The API simply returns the partial name associated with the IBAN for you to validate.\n  Therefore, the **returned name may differ** from the one you provided.\n- **Mismatched name type is not corrected**.\n  This means that the name type in the response is returned as it was provided in the request.\n  For example, if an individual recipient's name was provided under `company_name`, in the response it's still returned under `company_name` (instead of `individual_name`).\n:::",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The initial of the last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseRoIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The initial of the last name of the recipient.
    pub last_name: ::std::string::String,
}
/// The result of the check.
///
/// For RO CoP, the API **checks if an account exists for the provided IBAN**.
/// Possible results are:
/// - **`matched`:** An account with the provided IBAN was found.
///   When this status is returned, the API also returns a partial name of the account holder.
///   Use this returned name to validate your recipient's details.
/// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
///     For example, the recipient's bank doesn't support CoP.
/// - **`temporarily_unavailable`:** The check cannot be performed right now.
///   For example, the recipient's bank didn't respond to our request.
///   You should retry the request later.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of the check. \n\nFor RO CoP, the API **checks if an account exists for the provided IBAN**.\nPossible results are:\n- **`matched`:** An account with the provided IBAN was found.\n  When this status is returned, the API also returns a partial name of the account holder.\n  Use this returned name to validate your recipient's details.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n    For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///  "type": "string",
///  "enum": [
///    "matched",
///    "close_match",
///    "not_matched",
///    "cannot_be_checked",
///    "temporarily_unavailable"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ValidateAccountNameResponseRoResultCode {
    #[serde(rename = "matched")]
    Matched,
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
    #[serde(rename = "temporarily_unavailable")]
    TemporarilyUnavailable,
}
impl ::std::fmt::Display for ValidateAccountNameResponseRoResultCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Matched => f.write_str("matched"),
            Self::CloseMatch => f.write_str("close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
            Self::TemporarilyUnavailable => f.write_str("temporarily_unavailable"),
        }
    }
}
impl ::std::str::FromStr for ValidateAccountNameResponseRoResultCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "matched" => Ok(Self::Matched),
            "close_match" => Ok(Self::CloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            "temporarily_unavailable" => Ok(Self::TemporarilyUnavailable),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameResponseRoResultCode {
    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 ValidateAccountNameResponseRoResultCode {
    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 ValidateAccountNameResponseRoResultCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ValidateAccountNameResponseUk`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "UK",
///  "type": "object",
///  "required": [
///    "result_code"
///  ],
///  "properties": {
///    "company_name": {
///      "description": "The name of the recipient when the account type is business.\nProvided only if `individual_name` is not specified.\n\nWhen the name is a close match, the actual full name is returned, otherwise, the name you provided is returned.",
///      "type": "string"
///    },
///    "individual_name": {
///      "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual first and last names are returned in full.",
///      "type": "object",
///      "required": [
///        "first_name",
///        "last_name"
///      ],
///      "properties": {
///        "first_name": {
///          "description": "The first name of the recipient.",
///          "type": "string"
///        },
///        "last_name": {
///          "description": "The last name of the recipient.",
///          "type": "string"
///        }
///      }
///    },
///    "reason": {
///      "$ref": "#/components/schemas/AccountNameValidationReasonUK"
///    },
///    "result_code": {
///      "description": "The result of the check. \n\nPossible values for UK:\n- **`matched`:** The name and account type match the provided details.\n- **`close_match`:** The name and/or account type are similar to the provided values:\n  - The name is a match, but the account type is incorrect.\n    For example, an individual recipient's name was provided under `company_name`.\n    The **actual account type** is returned.\n  - The name is similar to the provided values.\n    Account type is correct.\n    The **actual name** is returned.\n  - The name is similar to the provided values, and the account type is incorrect.\n    The **actual values** are returned.\n\n  The actual values are returned.\n- **`not_matched`:** The name and account type don't match the provided values.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///      "type": "string",
///      "enum": [
///        "matched",
///        "close_match",
///        "not_matched",
///        "cannot_be_checked",
///        "temporarily_unavailable"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseUk {
    /// The name of the recipient when the account type is business.
    /// Provided only if `individual_name` is not specified.
    ///
    /// When the name is a close match, the actual full name is returned, otherwise, the name you provided is returned.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub company_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub individual_name: ::std::option::Option<ValidateAccountNameResponseUkIndividualName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<AccountNameValidationReasonUk>,
    /// The result of the check.
    ///
    /// Possible values for UK:
    /// - **`matched`:** The name and account type match the provided details.
    /// - **`close_match`:** The name and/or account type are similar to the provided values:
    ///   - The name is a match, but the account type is incorrect.
    ///     For example, an individual recipient's name was provided under `company_name`.
    ///     The **actual account type** is returned.
    ///   - The name is similar to the provided values.
    ///     Account type is correct.
    ///     The **actual name** is returned.
    ///   - The name is similar to the provided values, and the account type is incorrect.
    ///     The **actual values** are returned.
    ///
    ///   The actual values are returned.
    /// - **`not_matched`:** The name and account type don't match the provided values.
    /// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
    ///   For example, the recipient's bank doesn't support CoP.
    /// - **`temporarily_unavailable`:** The check cannot be performed right now.
    ///   For example, the recipient's bank didn't respond to our request.
    ///   You should retry the request later.
    pub result_code: ValidateAccountNameResponseUkResultCode,
}
/// The name of the recipient when the account type is personal.
/// Provided only if `company_name` is not specified.
///
/// When the name is a close match, the actual first and last names are returned in full.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the recipient when the account type is personal.\nProvided only if `company_name` is not specified.\n\nWhen the name is a close match, the actual first and last names are returned in full.",
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "The first name of the recipient.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "The last name of the recipient.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ValidateAccountNameResponseUkIndividualName {
    ///The first name of the recipient.
    pub first_name: ::std::string::String,
    ///The last name of the recipient.
    pub last_name: ::std::string::String,
}
/// The result of the check.
///
/// Possible values for UK:
/// - **`matched`:** The name and account type match the provided details.
/// - **`close_match`:** The name and/or account type are similar to the provided values:
///   - The name is a match, but the account type is incorrect.
///     For example, an individual recipient's name was provided under `company_name`.
///     The **actual account type** is returned.
///   - The name is similar to the provided values.
///     Account type is correct.
///     The **actual name** is returned.
///   - The name is similar to the provided values, and the account type is incorrect.
///     The **actual values** are returned.
///
///   The actual values are returned.
/// - **`not_matched`:** The name and account type don't match the provided values.
/// - **`cannot_be_checked`:** The check cannot be performed and retries won't help.
///   For example, the recipient's bank doesn't support CoP.
/// - **`temporarily_unavailable`:** The check cannot be performed right now.
///   For example, the recipient's bank didn't respond to our request.
///   You should retry the request later.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of the check. \n\nPossible values for UK:\n- **`matched`:** The name and account type match the provided details.\n- **`close_match`:** The name and/or account type are similar to the provided values:\n  - The name is a match, but the account type is incorrect.\n    For example, an individual recipient's name was provided under `company_name`.\n    The **actual account type** is returned.\n  - The name is similar to the provided values.\n    Account type is correct.\n    The **actual name** is returned.\n  - The name is similar to the provided values, and the account type is incorrect.\n    The **actual values** are returned.\n\n  The actual values are returned.\n- **`not_matched`:** The name and account type don't match the provided values.\n- **`cannot_be_checked`:** The check cannot be performed and retries won't help.\n  For example, the recipient's bank doesn't support CoP.\n- **`temporarily_unavailable`:** The check cannot be performed right now.\n  For example, the recipient's bank didn't respond to our request.\n  You should retry the request later.",
///  "type": "string",
///  "enum": [
///    "matched",
///    "close_match",
///    "not_matched",
///    "cannot_be_checked",
///    "temporarily_unavailable"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ValidateAccountNameResponseUkResultCode {
    #[serde(rename = "matched")]
    Matched,
    #[serde(rename = "close_match")]
    CloseMatch,
    #[serde(rename = "not_matched")]
    NotMatched,
    #[serde(rename = "cannot_be_checked")]
    CannotBeChecked,
    #[serde(rename = "temporarily_unavailable")]
    TemporarilyUnavailable,
}
impl ::std::fmt::Display for ValidateAccountNameResponseUkResultCode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Matched => f.write_str("matched"),
            Self::CloseMatch => f.write_str("close_match"),
            Self::NotMatched => f.write_str("not_matched"),
            Self::CannotBeChecked => f.write_str("cannot_be_checked"),
            Self::TemporarilyUnavailable => f.write_str("temporarily_unavailable"),
        }
    }
}
impl ::std::str::FromStr for ValidateAccountNameResponseUkResultCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "matched" => Ok(Self::Matched),
            "close_match" => Ok(Self::CloseMatch),
            "not_matched" => Ok(Self::NotMatched),
            "cannot_be_checked" => Ok(Self::CannotBeChecked),
            "temporarily_unavailable" => Ok(Self::TemporarilyUnavailable),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ValidateAccountNameResponseUkResultCode {
    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 ValidateAccountNameResponseUkResultCode {
    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 ValidateAccountNameResponseUkResultCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A webhook event
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A webhook event",
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "payload",
///    "updated_at",
///    "webhook_id",
///    "webhook_url"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the event was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "id": {
///      "description": "The ID of the webhook event.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_sent_date": {
///      "description": "The date and time the last attempt at the event delivery occurred in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "payload": {
///      "description": "The details of the failed event.",
///      "type": "object"
///    },
///    "updated_at": {
///      "description": "The date and time the event was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "webhook_id": {
///      "description": "The ID of the webhook for which the event failed.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "webhook_url": {
///      "description": "The valid webhook URL that event notifications are sent to. The supported protocol is `https`.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookEvent {
    ///The date and time the event was created in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the webhook event.
    pub id: ::uuid::Uuid,
    ///The date and time the last attempt at the event delivery occurred in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_sent_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///The details of the failed event.
    pub payload: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
    ///The date and time the event was last updated in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
    ///The ID of the webhook for which the event failed.
    pub webhook_id: ::uuid::Uuid,
    ///The valid webhook URL that event notifications are sent to. The supported protocol is `https`.
    pub webhook_url: ::std::string::String,
}
///The type of the webhook event to subscribe to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the webhook event to subscribe to.",
///  "enum": [
///    "TransactionCreated",
///    "TransactionStateChanged",
///    "PayoutLinkCreated",
///    "PayoutLinkStateChanged"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum WebhookEventType {
    TransactionCreated,
    TransactionStateChanged,
    PayoutLinkCreated,
    PayoutLinkStateChanged,
}
impl ::std::fmt::Display for WebhookEventType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::TransactionCreated => f.write_str("TransactionCreated"),
            Self::TransactionStateChanged => f.write_str("TransactionStateChanged"),
            Self::PayoutLinkCreated => f.write_str("PayoutLinkCreated"),
            Self::PayoutLinkStateChanged => f.write_str("PayoutLinkStateChanged"),
        }
    }
}
impl ::std::str::FromStr for WebhookEventType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "TransactionCreated" => Ok(Self::TransactionCreated),
            "TransactionStateChanged" => Ok(Self::TransactionStateChanged),
            "PayoutLinkCreated" => Ok(Self::PayoutLinkCreated),
            "PayoutLinkStateChanged" => Ok(Self::PayoutLinkStateChanged),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for WebhookEventType {
    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 WebhookEventType {
    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 WebhookEventType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`WebhookEvents`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/WebhookEvent"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct WebhookEvents(pub ::std::vec::Vec<WebhookEvent>);
impl ::std::ops::Deref for WebhookEvents {
    type Target = ::std::vec::Vec<WebhookEvent>;
    fn deref(&self) -> &::std::vec::Vec<WebhookEvent> {
        &self.0
    }
}
impl ::std::convert::From<WebhookEvents> for ::std::vec::Vec<WebhookEvent> {
    fn from(value: WebhookEvents) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<WebhookEvent>> for WebhookEvents {
    fn from(value: ::std::vec::Vec<WebhookEvent>) -> Self {
        Self(value)
    }
}
///`WebhookSigningSecretRotateRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "expiration_period": {
///      "description": "The expiration period for the signing secret in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601#Durations). If set, when you rotate the secret, it continues to be valid until the expiration period has passed. Otherwise, on rotation, the secret is invalidated immediately. The maximum value is 7 days.",
///      "type": "string",
///      "format": "duration"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookSigningSecretRotateRequest {
    ///The expiration period for the signing secret in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601#Durations). If set, when you rotate the secret, it continues to be valid until the expiration period has passed. Otherwise, on rotation, the secret is invalidated immediately. The maximum value is 7 days.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiration_period: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for WebhookSigningSecretRotateRequest {
    fn default() -> Self {
        Self {
            expiration_period: Default::default(),
        }
    }
}
///`WebhookV1`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "url"
///  ],
///  "properties": {
///    "url": {
///      "description": "The valid webhook URL that event notifications are sent to. The supported protocol is `https`.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookV1 {
    ///The valid webhook URL that event notifications are sent to. The supported protocol is `https`.
    pub url: ::std::string::String,
}
///`WebhookV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "events",
///    "id",
///    "signing_secret",
///    "url"
///  ],
///  "properties": {
///    "events": {
///      "description": "The list of event types that you are subscribed to.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/WebhookEventType"
///      }
///    },
///    "id": {
///      "description": "The ID of the webhook.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "signing_secret": {
///      "description": "The signing secret for the webhook.",
///      "type": "string"
///    },
///    "url": {
///      "description": "The valid webhook URL that event notifications are sent to. The supported protocol is `https`.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookV2 {
    ///The list of event types that you are subscribed to.
    pub events: ::std::vec::Vec<WebhookEventType>,
    ///The ID of the webhook.
    pub id: ::uuid::Uuid,
    ///The signing secret for the webhook.
    pub signing_secret: ::std::string::String,
    ///The valid webhook URL that event notifications are sent to. The supported protocol is `https`.
    pub url: ::std::string::String,
}
///`WebhookV2Basic`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "events",
///    "id",
///    "url"
///  ],
///  "properties": {
///    "events": {
///      "description": "The list of event types that you are subscribed to.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/WebhookEventType"
///      }
///    },
///    "id": {
///      "description": "The ID of the webhook.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "url": {
///      "description": "The valid webhook URL that event notifications are sent to. The supported protocol is `https`.",
///      "type": "string",
///      "format": "uri"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookV2Basic {
    ///The list of event types that you are subscribed to.
    pub events: ::std::vec::Vec<WebhookEventType>,
    ///The ID of the webhook.
    pub id: ::uuid::Uuid,
    ///The valid webhook URL that event notifications are sent to. The supported protocol is `https`.
    pub url: ::std::string::String,
}
///`Webhooks`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Webhook-v2-basic"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Webhooks(pub ::std::vec::Vec<WebhookV2Basic>);
impl ::std::ops::Deref for Webhooks {
    type Target = ::std::vec::Vec<WebhookV2Basic>;
    fn deref(&self) -> &::std::vec::Vec<WebhookV2Basic> {
        &self.0
    }
}
impl ::std::convert::From<Webhooks> for ::std::vec::Vec<WebhookV2Basic> {
    fn from(value: Webhooks) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<WebhookV2Basic>> for Webhooks {
    fn from(value: ::std::vec::Vec<WebhookV2Basic>) -> Self {
        Self(value)
    }
}
