// 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())
        }
    }
}
///Object containing address details.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing address details.",
///  "type": "object",
///  "required": [
///    "country_code",
///    "postcode"
///  ],
///  "properties": {
///    "city": {
///      "description": "The city associated with the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "The 2-letter country code of the country associated with the address.",
///      "type": "string",
///      "maxLength": 2
///    },
///    "postcode": {
///      "description": "The postcode associated with the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "The region associated with the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Street line 1 information.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Street line 2 information.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AddressV2 {
    ///The city associated with the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub city: ::std::option::Option<AddressV2City>,
    ///The 2-letter country code of the country associated with the address.
    pub country_code: AddressV2CountryCode,
    ///The postcode associated with the address.
    pub postcode: AddressV2Postcode,
    ///The region associated with the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<AddressV2Region>,
    ///Street line 1 information.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_1: ::std::option::Option<AddressV2StreetLine1>,
    ///Street line 2 information.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<AddressV2StreetLine2>,
}
///The city associated with the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The city associated with the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2City(::std::string::String);
impl ::std::ops::Deref for AddressV2City {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2City> for ::std::string::String {
    fn from(value: AddressV2City) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2City {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2City {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2City {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2City {
    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 AddressV2City {
    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 2-letter country code of the country associated with the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The 2-letter country code of the country associated with the address.",
///  "type": "string",
///  "maxLength": 2
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2CountryCode(::std::string::String);
impl ::std::ops::Deref for AddressV2CountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2CountryCode> for ::std::string::String {
    fn from(value: AddressV2CountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2CountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2CountryCode {
    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 AddressV2CountryCode {
    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 postcode associated with the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The postcode associated with the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2Postcode(::std::string::String);
impl ::std::ops::Deref for AddressV2Postcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2Postcode> for ::std::string::String {
    fn from(value: AddressV2Postcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2Postcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2Postcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2Postcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2Postcode {
    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 AddressV2Postcode {
    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 region associated with the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The region associated with the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2Region(::std::string::String);
impl ::std::ops::Deref for AddressV2Region {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2Region> for ::std::string::String {
    fn from(value: AddressV2Region) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2Region {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2Region {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2Region {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2Region {
    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 AddressV2Region {
    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())
            })
    }
}
///Street line 1 information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Street line 1 information.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2StreetLine1(::std::string::String);
impl ::std::ops::Deref for AddressV2StreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2StreetLine1> for ::std::string::String {
    fn from(value: AddressV2StreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2StreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2StreetLine1 {
    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 AddressV2StreetLine1 {
    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())
            })
    }
}
///Street line 2 information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Street line 2 information.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV2StreetLine2(::std::string::String);
impl ::std::ops::Deref for AddressV2StreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV2StreetLine2> for ::std::string::String {
    fn from(value: AddressV2StreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV2StreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV2StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV2StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV2StreetLine2 {
    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 AddressV2StreetLine2 {
    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 of a physical address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details of a physical address.",
///  "type": "object",
///  "required": [
///    "city",
///    "country_code",
///    "postcode",
///    "street_line_1"
///  ],
///  "properties": {
///    "city": {
///      "description": "City of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "ISO 2-letter country code.",
///      "type": "string",
///      "maxLength": 2,
///      "minLength": 2,
///      "pattern": "^[A-Z]{2}$"
///    },
///    "postcode": {
///      "description": "Postal code of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "State or province of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Primary address line.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Secondary address line, such as floor and apartment number.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AddressV3 {
    ///City of the address.
    pub city: AddressV3City,
    ///ISO 2-letter country code.
    pub country_code: AddressV3CountryCode,
    ///Postal code of the address.
    pub postcode: AddressV3Postcode,
    ///State or province of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<AddressV3Region>,
    ///Primary address line.
    pub street_line_1: AddressV3StreetLine1,
    ///Secondary address line, such as floor and apartment number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<AddressV3StreetLine2>,
}
///City of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "City of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3City(::std::string::String);
impl ::std::ops::Deref for AddressV3City {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3City> for ::std::string::String {
    fn from(value: AddressV3City) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3City {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV3City {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3City {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3City {
    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 AddressV3City {
    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())
            })
    }
}
///ISO 2-letter country code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "ISO 2-letter country code.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2,
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3CountryCode(::std::string::String);
impl ::std::ops::Deref for AddressV3CountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3CountryCode> for ::std::string::String {
    fn from(value: AddressV3CountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3CountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        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 AddressV3CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3CountryCode {
    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 AddressV3CountryCode {
    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())
            })
    }
}
///Postal code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Postal code of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3Postcode(::std::string::String);
impl ::std::ops::Deref for AddressV3Postcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3Postcode> for ::std::string::String {
    fn from(value: AddressV3Postcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3Postcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV3Postcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3Postcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3Postcode {
    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 AddressV3Postcode {
    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())
            })
    }
}
///State or province of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "State or province of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3Region(::std::string::String);
impl ::std::ops::Deref for AddressV3Region {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3Region> for ::std::string::String {
    fn from(value: AddressV3Region) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3Region {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV3Region {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3Region {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3Region {
    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 AddressV3Region {
    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())
            })
    }
}
///Primary address line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Primary address line.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3StreetLine1(::std::string::String);
impl ::std::ops::Deref for AddressV3StreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3StreetLine1> for ::std::string::String {
    fn from(value: AddressV3StreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3StreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV3StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3StreetLine1 {
    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 AddressV3StreetLine1 {
    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())
            })
    }
}
///Secondary address line, such as floor and apartment number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Secondary address line, such as floor and apartment number.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV3StreetLine2(::std::string::String);
impl ::std::ops::Deref for AddressV3StreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV3StreetLine2> for ::std::string::String {
    fn from(value: AddressV3StreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV3StreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV3StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV3StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV3StreetLine2 {
    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 AddressV3StreetLine2 {
    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 of a physical address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details of a physical address.",
///  "type": "object",
///  "required": [
///    "city",
///    "country_code",
///    "postcode",
///    "street_line_1"
///  ],
///  "properties": {
///    "city": {
///      "description": "City of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "ISO 2-letter country code.",
///      "type": "string",
///      "maxLength": 2,
///      "minLength": 2,
///      "pattern": "^[A-Z]{2}$"
///    },
///    "country_subdivision_code": {
///      "description": "The subdivision code represents the state, province, or region within the country, following the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard. This code uniquely identifies subdivisions within a country. \n\nFor example, for London in the United Kingdom, use `GB-LND`.\n\n:::caution\nThe parameter is required for countries listed on the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) page.\n:::",
///      "type": "string",
///      "maxLength": 6,
///      "minLength": 5,
///      "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
///    },
///    "postcode": {
///      "description": "Postal code of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "State or province of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Primary address line.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Secondary address line, such as floor and apartment number.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AddressV4 {
    ///City of the address.
    pub city: AddressV4City,
    ///ISO 2-letter country code.
    pub country_code: AddressV4CountryCode,
    /// The subdivision code represents the state, province, or region within the country, following the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard. This code uniquely identifies subdivisions within a country.
    ///
    /// For example, for London in the United Kingdom, use `GB-LND`.
    ///
    /// :::caution
    /// The parameter is required for countries listed on the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) page.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub country_subdivision_code: ::std::option::Option<AddressV4CountrySubdivisionCode>,
    ///Postal code of the address.
    pub postcode: AddressV4Postcode,
    ///State or province of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<AddressV4Region>,
    ///Primary address line.
    pub street_line_1: AddressV4StreetLine1,
    ///Secondary address line, such as floor and apartment number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<AddressV4StreetLine2>,
}
///City of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "City of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4City(::std::string::String);
impl ::std::ops::Deref for AddressV4City {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4City> for ::std::string::String {
    fn from(value: AddressV4City) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4City {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4City {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4City {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4City {
    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 AddressV4City {
    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())
            })
    }
}
///ISO 2-letter country code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "ISO 2-letter country code.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2,
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4CountryCode(::std::string::String);
impl ::std::ops::Deref for AddressV4CountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4CountryCode> for ::std::string::String {
    fn from(value: AddressV4CountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4CountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        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 AddressV4CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4CountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4CountryCode {
    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 AddressV4CountryCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The subdivision code represents the state, province, or region within the country, following the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard. This code uniquely identifies subdivisions within a country.
///
/// For example, for London in the United Kingdom, use `GB-LND`.
///
/// :::caution
/// The parameter is required for countries listed on the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) page.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The subdivision code represents the state, province, or region within the country, following the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) standard. This code uniquely identifies subdivisions within a country. \n\nFor example, for London in the United Kingdom, use `GB-LND`.\n\n:::caution\nThe parameter is required for countries listed on the [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) page.\n:::",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 5,
///  "pattern": "^[A-Z]{2}-[A-Z0-9]{1,3}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4CountrySubdivisionCode(::std::string::String);
impl ::std::ops::Deref for AddressV4CountrySubdivisionCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4CountrySubdivisionCode> for ::std::string::String {
    fn from(value: AddressV4CountrySubdivisionCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4CountrySubdivisionCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 5usize {
            return Err("shorter than 5 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^[A-Z]{2}-[A-Z0-9]{1,3}$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Z]{2}-[A-Z0-9]{1,3}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4CountrySubdivisionCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4CountrySubdivisionCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4CountrySubdivisionCode {
    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 AddressV4CountrySubdivisionCode {
    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())
            })
    }
}
///Postal code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Postal code of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4Postcode(::std::string::String);
impl ::std::ops::Deref for AddressV4Postcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4Postcode> for ::std::string::String {
    fn from(value: AddressV4Postcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4Postcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4Postcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4Postcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4Postcode {
    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 AddressV4Postcode {
    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())
            })
    }
}
///State or province of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "State or province of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4Region(::std::string::String);
impl ::std::ops::Deref for AddressV4Region {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4Region> for ::std::string::String {
    fn from(value: AddressV4Region) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4Region {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4Region {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4Region {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4Region {
    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 AddressV4Region {
    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())
            })
    }
}
///Primary address line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Primary address line.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4StreetLine1(::std::string::String);
impl ::std::ops::Deref for AddressV4StreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4StreetLine1> for ::std::string::String {
    fn from(value: AddressV4StreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4StreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4StreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4StreetLine1 {
    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 AddressV4StreetLine1 {
    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())
            })
    }
}
///Secondary address line, such as floor and apartment number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Secondary address line, such as floor and apartment number.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AddressV4StreetLine2(::std::string::String);
impl ::std::ops::Deref for AddressV4StreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AddressV4StreetLine2> for ::std::string::String {
    fn from(value: AddressV4StreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AddressV4StreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AddressV4StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AddressV4StreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AddressV4StreetLine2 {
    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 AddressV4StreetLine2 {
    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())
            })
    }
}
/// Object containing additional information about an airline booking associated with the order.
///
/// Use this object to provide required data to enable **Revolut Flight Alerts**. This feature allows users to receive real-time flight updates such as check-in reminders, boarding alerts, and notifications for cancellations or delays in the Revolut app.
///
/// To enable **Revolut Flight Alerts** functionalities in the Revolut app, the following fields are **required** on order creation or update, before capturing the order:
///   ```text
///   tickets_purchase,
///   journey_legs,
///   booking_url
///   ```text
///
/// :::note
/// These are the specific data field requirements for merchants who must provide airline data. Note that these requirements can be extended on a case by case basis as decided by Revolut.
///
/// | Required for airline/charter merchants | Required for OTA merchants |
/// | -------------------------------------- | -------------------------- |
/// | <ul><li>`booking_id`</li><li>`fulfillment_date`</li><li>`passengers[].first_name`</li><li>`passengers[].last_name`</li><li>`journey_legs[].pnr`</li><li>`journey_legs[].sequence`</li><li>`journey_legs[].flight_number`</li><li>`journey_legs[].travel_date`</li><li>`journey_legs[].airline_code`</li><li>`journey_legs[].departure_airport_code`</li><li>`journey_legs[].arrival_airport_code`</li></ul> | <ul><li>`booking_id`</li><li>`fulfillment_date`</li><li>`passengers[].first_name`</li><li>`passengers[].last_name`</li><li>`journey_legs[].pnr`</li><li>`journey_legs[].arrival_airport_code`</li></ul> |
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing additional information about an airline booking associated with the order.\n\nUse this object to provide required data to enable **Revolut Flight Alerts**. This feature allows users to receive real-time flight updates such as check-in reminders, boarding alerts, and notifications for cancellations or delays in the Revolut app.\n\nTo enable **Revolut Flight Alerts** functionalities in the Revolut app, the following fields are **required** on order creation or update, before capturing the order:\n  ```\n  tickets_purchase,\n  journey_legs,\n  booking_url\n  ```\n\n:::note\nThese are the specific data field requirements for merchants who must provide airline data. Note that these requirements can be extended on a case by case basis as decided by Revolut.\n\n| Required for airline/charter merchants | Required for OTA merchants |\n| -------------------------------------- | -------------------------- |\n| <ul><li>`booking_id`</li><li>`fulfillment_date`</li><li>`passengers[].first_name`</li><li>`passengers[].last_name`</li><li>`journey_legs[].pnr`</li><li>`journey_legs[].sequence`</li><li>`journey_legs[].flight_number`</li><li>`journey_legs[].travel_date`</li><li>`journey_legs[].airline_code`</li><li>`journey_legs[].departure_airport_code`</li><li>`journey_legs[].arrival_airport_code`</li></ul> | <ul><li>`booking_id`</li><li>`fulfillment_date`</li><li>`passengers[].first_name`</li><li>`passengers[].last_name`</li><li>`journey_legs[].pnr`</li><li>`journey_legs[].arrival_airport_code`</li></ul> |\n:::",
///  "type": "object",
///  "required": [
///    "booking_id"
///  ],
///  "properties": {
///    "booking_id": {
///      "$ref": "#/components/schemas/Booking-Id"
///    },
///    "booking_url": {
///      "description": "URL to the online portal for managing the airline booking, which includes check-in functionality. This URL may be a personalised, pre-populated check-in link specific to the user or a generic link, and it is essential for enabling direct access to booking details within the Revolut app.\n\n:::info\nThis field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app.\n\nProvide the info on order creation or update, before capturing the order.\n:::\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 2000,
///      "pattern": "^https?:\\/{2}.+/gi"
///    },
///    "crs_code": {
///      "description": "The code of the Computer Reservation System (CRS) used to make the booking and purchase the ticket.",
///      "type": "string",
///      "maxLength": 4
///    },
///    "fulfillment_date": {
///      "description": "The UTC date and time of the final journey leg.\n\n:::caution\nThe following limitations apply:\n  - When creating or updating an order, `fulfillment_date` cannot be set to a date in the past.\n  - When updating an order, if the current `fulfillment_date` value is already in the past, it cannot be modified. The date must remain as is to maintain data integrity for completed transactions.\n:::",
///      "type": "string",
///      "format": "date-time"
///    },
///    "journey_legs": {
///      "$ref": "#/components/schemas/Journey-Legs"
///    },
///    "passengers": {
///      "$ref": "#/components/schemas/Passengers"
///    },
///    "refundability": {
///      "$ref": "#/components/schemas/Refundability"
///    },
///    "ticket_change_indicator": {
///      "description": "Parameter indicating whether this order is related to a new ticket reservation or a modification of an existing one.",
///      "type": "string",
///      "enum": [
///        "new",
///        "modification"
///      ]
///    },
///    "ticket_type": {
///      "description": "The type of the ticket.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `fixed`         | Non-modifiable once confirmed. |\n| `flexible`      | Allows modifications or cancellations under specified conditions. |",
///      "type": "string",
///      "enum": [
///        "fixed",
///        "flexible"
///      ]
///    },
///    "tickets_purchase": {
///      "description": "Flag indicating whether the order includes actual ticket purchases. Set to `true` if the order contains ticket purchases, and `false` if it does not (e.g., it **only** contains seat reservations, or baggage upgrades).\n\n:::info\nThis field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app.\n\nProvide the info on order creation or update, before capturing the order.\n:::",
///      "type": "boolean"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AirlineDataV2 {
    pub booking_id: BookingId,
    /// URL to the online portal for managing the airline booking, which includes check-in functionality. This URL may be a personalised, pre-populated check-in link specific to the user or a generic link, and it is essential for enabling direct access to booking details within the Revolut app.
    ///
    /// :::info
    /// This field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app.
    ///
    /// Provide the info on order creation or update, before capturing the order.
    /// :::
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be either `http` or `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `2000`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub booking_url: ::std::option::Option<::std::string::String>,
    ///The code of the Computer Reservation System (CRS) used to make the booking and purchase the ticket.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub crs_code: ::std::option::Option<AirlineDataV2CrsCode>,
    /// The UTC date and time of the final journey leg.
    ///
    /// :::caution
    /// The following limitations apply:
    ///   - When creating or updating an order, `fulfillment_date` cannot be set to a date in the past.
    ///   - When updating an order, if the current `fulfillment_date` value is already in the past, it cannot be modified. The date must remain as is to maintain data integrity for completed transactions.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fulfillment_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub journey_legs: ::std::option::Option<JourneyLegs>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub passengers: ::std::option::Option<Passengers>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub refundability: ::std::option::Option<Refundability>,
    ///Parameter indicating whether this order is related to a new ticket reservation or a modification of an existing one.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ticket_change_indicator: ::std::option::Option<AirlineDataV2TicketChangeIndicator>,
    /// The type of the ticket.
    ///
    /// | Parameter value | Description |
    /// | --------------- | ----------- |
    /// | `fixed`         | Non-modifiable once confirmed. |
    /// | `flexible`      | Allows modifications or cancellations under specified conditions. |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ticket_type: ::std::option::Option<AirlineDataV2TicketType>,
    /// Flag indicating whether the order includes actual ticket purchases. Set to `true` if the order contains ticket purchases, and `false` if it does not (e.g., it **only** contains seat reservations, or baggage upgrades).
    ///
    /// :::info
    /// This field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app.
    ///
    /// Provide the info on order creation or update, before capturing the order.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub tickets_purchase: ::std::option::Option<bool>,
}
///The code of the Computer Reservation System (CRS) used to make the booking and purchase the ticket.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The code of the Computer Reservation System (CRS) used to make the booking and purchase the ticket.",
///  "type": "string",
///  "maxLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AirlineDataV2CrsCode(::std::string::String);
impl ::std::ops::Deref for AirlineDataV2CrsCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AirlineDataV2CrsCode> for ::std::string::String {
    fn from(value: AirlineDataV2CrsCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AirlineDataV2CrsCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AirlineDataV2CrsCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AirlineDataV2CrsCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AirlineDataV2CrsCode {
    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 AirlineDataV2CrsCode {
    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())
            })
    }
}
///Parameter indicating whether this order is related to a new ticket reservation or a modification of an existing one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Parameter indicating whether this order is related to a new ticket reservation or a modification of an existing one.",
///  "type": "string",
///  "enum": [
///    "new",
///    "modification"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AirlineDataV2TicketChangeIndicator {
    #[serde(rename = "new")]
    New,
    #[serde(rename = "modification")]
    Modification,
}
impl ::std::fmt::Display for AirlineDataV2TicketChangeIndicator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::New => f.write_str("new"),
            Self::Modification => f.write_str("modification"),
        }
    }
}
impl ::std::str::FromStr for AirlineDataV2TicketChangeIndicator {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "new" => Ok(Self::New),
            "modification" => Ok(Self::Modification),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AirlineDataV2TicketChangeIndicator {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AirlineDataV2TicketChangeIndicator {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AirlineDataV2TicketChangeIndicator {
    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 ticket.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `fixed`         | Non-modifiable once confirmed. |
/// | `flexible`      | Allows modifications or cancellations under specified conditions. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the ticket.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `fixed`         | Non-modifiable once confirmed. |\n| `flexible`      | Allows modifications or cancellations under specified conditions. |",
///  "type": "string",
///  "enum": [
///    "fixed",
///    "flexible"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AirlineDataV2TicketType {
    #[serde(rename = "fixed")]
    Fixed,
    #[serde(rename = "flexible")]
    Flexible,
}
impl ::std::fmt::Display for AirlineDataV2TicketType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Fixed => f.write_str("fixed"),
            Self::Flexible => f.write_str("flexible"),
        }
    }
}
impl ::std::str::FromStr for AirlineDataV2TicketType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "fixed" => Ok(Self::Fixed),
            "flexible" => Ok(Self::Flexible),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AirlineDataV2TicketType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AirlineDataV2TicketType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AirlineDataV2TicketType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Object containing details of a card used via Apple Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Apple Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "arn": {
///      "$ref": "#/components/schemas/Arn"
///    },
///    "authorisation_code": {
///      "$ref": "#/components/schemas/Authorisation-Code"
///    },
///    "capture_deadline": {
///      "$ref": "#/components/schemas/Capture-Deadline"
///    },
///    "card_bin": {
///      "description": "The BIN of the card.",
///      "type": "string",
///      "maxLength": 6,
///      "minLength": 6
///    },
///    "card_brand": {
///      "description": "The type of the card.",
///      "type": "string",
///      "enum": [
///        "visa",
///        "mastercard",
///        "american_express"
///      ]
///    },
///    "card_country_code": {
///      "description": "The 2-letter country code of the country where the card was issued.",
///      "type": "string"
///    },
///    "card_expiry": {
///      "description": "The expiry date of the card in the format of MM/YY.",
///      "type": "string",
///      "format": "MM/YY"
///    },
///    "card_last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string",
///      "maxLength": 4,
///      "minLength": 4
///    },
///    "cardholder_name": {
///      "description": "The name of the cardholder.",
///      "type": "string"
///    },
///    "checks": {
///      "$ref": "#/components/schemas/Card-Checks-v2"
///    },
///    "fingerprint": {
///      "$ref": "#/components/schemas/Fingerprint"
///    },
///    "funding": {
///      "description": "The type of card funding.",
///      "type": "string",
///      "enum": [
///        "credit",
///        "debit",
///        "prepaid"
///      ]
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "network_transaction_id": {
///      "$ref": "#/components/schemas/Network-Transaction-Id"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApplePay {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub arn: ::std::option::Option<Arn>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_code: ::std::option::Option<AuthorisationCode>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_deadline: ::std::option::Option<CaptureDeadline>,
    ///The BIN of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_bin: ::std::option::Option<ApplePayCardBin>,
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<ApplePayCardBrand>,
    ///The 2-letter country code of the country where the card was issued.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_country_code: ::std::option::Option<::std::string::String>,
    ///The expiry date of the card in the format of MM/YY.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_expiry: ::std::option::Option<::std::string::String>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<ApplePayCardLastFour>,
    ///The name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub checks: ::std::option::Option<CardChecksV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<Fingerprint>,
    ///The type of card funding.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub funding: ::std::option::Option<ApplePayFunding>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub network_transaction_id: ::std::option::Option<NetworkTransactionId>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///The BIN of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The BIN of the card.",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 6
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplePayCardBin(::std::string::String);
impl ::std::ops::Deref for ApplePayCardBin {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ApplePayCardBin> for ::std::string::String {
    fn from(value: ApplePayCardBin) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ApplePayCardBin {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 6usize {
            return Err("shorter than 6 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ApplePayCardBin {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ApplePayCardBin {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ApplePayCardBin {
    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 ApplePayCardBin {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the card.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard",
///    "american_express"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ApplePayCardBrand {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
    #[serde(rename = "american_express")]
    AmericanExpress,
}
impl ::std::fmt::Display for ApplePayCardBrand {
    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"),
            Self::AmericanExpress => f.write_str("american_express"),
        }
    }
}
impl ::std::str::FromStr for ApplePayCardBrand {
    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),
            "american_express" => Ok(Self::AmericanExpress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ApplePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ApplePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ApplePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The last four digits of the card number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the card number.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplePayCardLastFour(::std::string::String);
impl ::std::ops::Deref for ApplePayCardLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ApplePayCardLastFour> for ::std::string::String {
    fn from(value: ApplePayCardLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ApplePayCardLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ApplePayCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ApplePayCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ApplePayCardLastFour {
    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 ApplePayCardLastFour {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of card funding.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of card funding.",
///  "type": "string",
///  "enum": [
///    "credit",
///    "debit",
///    "prepaid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ApplePayFunding {
    #[serde(rename = "credit")]
    Credit,
    #[serde(rename = "debit")]
    Debit,
    #[serde(rename = "prepaid")]
    Prepaid,
}
impl ::std::fmt::Display for ApplePayFunding {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("credit"),
            Self::Debit => f.write_str("debit"),
            Self::Prepaid => f.write_str("prepaid"),
        }
    }
}
impl ::std::str::FromStr for ApplePayFunding {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "credit" => Ok(Self::Credit),
            "debit" => Ok(Self::Debit),
            "prepaid" => Ok(Self::Prepaid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ApplePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ApplePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ApplePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Acquirer Reference Number (ARN) of the payment.
///
/// :::note
/// Only returned for refund payments made by a card.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Acquirer Reference Number (ARN) of the payment.\n\n:::note\nOnly returned for refund payments made by a card.\n:::",
///  "type": "string",
///  "maxLength": 23,
///  "minLength": 23
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Arn(::std::string::String);
impl ::std::ops::Deref for Arn {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Arn> for ::std::string::String {
    fn from(value: Arn) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for Arn {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 23usize {
            return Err("longer than 23 characters".into());
        }
        if value.chars().count() < 23usize {
            return Err("shorter than 23 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for Arn {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Arn {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Arn {
    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 Arn {
    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 about the authentication challenge that should be performed to complete the authentication process. For more information about Revolut's 3DS solution, see: [3D Secure overview](https://developer.revolut.com/docs/guides/merchant/reference/3d-secure).
///
/// Only returned if the payment's state is `authentication_challenge`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details about the authentication challenge that should be performed to complete the authentication process. For more information about Revolut's 3DS solution, see: [3D Secure overview](https://developer.revolut.com/docs/guides/merchant/reference/3d-secure).\n\nOnly returned if the payment's state is `authentication_challenge`.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Three-Ds"
///    },
///    {
///      "$ref": "#/components/schemas/Three-Ds-Fingerprint"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum AuthenticationChallenge {
    Variant0(ThreeDs),
    Variant1(ThreeDsFingerprint),
}
impl ::std::convert::From<ThreeDs> for AuthenticationChallenge {
    fn from(value: ThreeDs) -> Self {
        Self::Variant0(value)
    }
}
impl ::std::convert::From<ThreeDsFingerprint> for AuthenticationChallenge {
    fn from(value: ThreeDsFingerprint) -> Self {
        Self::Variant1(value)
    }
}
///Type of the authentication challenge the payment triggers.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of the authentication challenge the payment triggers.",
///  "type": "string",
///  "enum": [
///    "three_ds",
///    "three_ds_fingerprint"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AuthenticationChallengeType {
    #[serde(rename = "three_ds")]
    ThreeDs,
    #[serde(rename = "three_ds_fingerprint")]
    ThreeDsFingerprint,
}
impl ::std::fmt::Display for AuthenticationChallengeType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::ThreeDs => f.write_str("three_ds"),
            Self::ThreeDsFingerprint => f.write_str("three_ds_fingerprint"),
        }
    }
}
impl ::std::str::FromStr for AuthenticationChallengeType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "three_ds" => Ok(Self::ThreeDs),
            "three_ds_fingerprint" => Ok(Self::ThreeDsFingerprint),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AuthenticationChallengeType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AuthenticationChallengeType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AuthenticationChallengeType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Details about the authentication challenge that should be performed to complete the authentication process. For more information about Revolut's 3DS solution, see: [3D Secure overview](https://developer.revolut.com/docs/guides/merchant/reference/3d-secure).
///
/// Only returned if the payment's state is `authentication_challenge`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details about the authentication challenge that should be performed to complete the authentication process. For more information about Revolut's 3DS solution, see: [3D Secure overview](https://developer.revolut.com/docs/guides/merchant/reference/3d-secure).\n\nOnly returned if the payment's state is `authentication_challenge`.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Three-Ds"
///    },
///    {
///      "$ref": "#/components/schemas/Three-Ds-Fingerprint-v2"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum AuthenticationChallengeV2 {
    Variant0(ThreeDs),
    Variant1(ThreeDsFingerprintV2),
}
impl ::std::convert::From<ThreeDs> for AuthenticationChallengeV2 {
    fn from(value: ThreeDs) -> Self {
        Self::Variant0(value)
    }
}
impl ::std::convert::From<ThreeDsFingerprintV2> for AuthenticationChallengeV2 {
    fn from(value: ThreeDsFingerprintV2) -> Self {
        Self::Variant1(value)
    }
}
/// The authorisation code (or auth code) is a short, alphanumeric code returned by the cardholder's issuing bank to the merchant's terminal or payment gateway.
///
/// It serves as confirmation that the transaction has been approved and funds are available.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The authorisation code (or auth code) is a short, alphanumeric code returned by the cardholder's issuing bank to the merchant's terminal or payment gateway.\n\nIt serves as confirmation that the transaction has been approved and funds are available.",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 2,
///  "pattern": "^[a-zA-Z0-9]{2,6}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct AuthorisationCode(::std::string::String);
impl ::std::ops::Deref for AuthorisationCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<AuthorisationCode> for ::std::string::String {
    fn from(value: AuthorisationCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for AuthorisationCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[a-zA-Z0-9]{2,6}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[a-zA-Z0-9]{2,6}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for AuthorisationCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AuthorisationCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AuthorisationCode {
    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 AuthorisationCode {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The type of authorisation for the order. Used with manual capture mode. If omitted, `final` is used by default.
///
/// ### Pre-authorisation
///
/// Pre-authorisation allows you to reserve funds on a customer's card without immediately capturing them. This is useful for scenarios like:
///
/// - Hotel bookings where the final amount may vary
/// - Car rentals where additional charges may apply
/// - Deposits that need to be held temporarily
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `final` | Standard authorisation for immediate or near-immediate capture. |
/// | `pre_authorisation` | Reserve funds for later capture, used with manual capture mode. |
///
/// :::note
/// Pre-authorisation must be used with `capture_mode: manual`. For more information, see [Capture an order](https://developer.revolut.com/docs/merchant/capture-order).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of authorisation for the order. Used with manual capture mode. If omitted, `final` is used by default.\n\n### Pre-authorisation\n\nPre-authorisation allows you to reserve funds on a customer's card without immediately capturing them. This is useful for scenarios like:\n\n- Hotel bookings where the final amount may vary\n- Car rentals where additional charges may apply\n- Deposits that need to be held temporarily\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `final` | Standard authorisation for immediate or near-immediate capture. |\n| `pre_authorisation` | Reserve funds for later capture, used with manual capture mode. |\n\n:::note\nPre-authorisation must be used with `capture_mode: manual`. For more information, see [Capture an order](https://developer.revolut.com/docs/merchant/capture-order).\n:::",
///  "type": "string",
///  "enum": [
///    "final",
///    "pre_authorisation"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum AuthorisationType {
    #[serde(rename = "final")]
    Final,
    #[serde(rename = "pre_authorisation")]
    PreAuthorisation,
}
impl ::std::fmt::Display for AuthorisationType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Final => f.write_str("final"),
            Self::PreAuthorisation => f.write_str("pre_authorisation"),
        }
    }
}
impl ::std::str::FromStr for AuthorisationType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "final" => Ok(Self::Final),
            "pre_authorisation" => Ok(Self::PreAuthorisation),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for AuthorisationType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for AuthorisationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for AuthorisationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The reason for a `failed` or `declined` payment, sent by the financial institution processing the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason for a `failed` or `declined` payment, sent by the financial institution processing the payment.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct BankMessage(pub ::std::string::String);
impl ::std::ops::Deref for BankMessage {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BankMessage> for ::std::string::String {
    fn from(value: BankMessage) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for BankMessage {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for BankMessage {
    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 BankMessage {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The billing address associated with the payment method.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Billing address",
///  "description": "The billing address associated with the payment method.",
///  "type": "object",
///  "required": [
///    "country_code",
///    "postcode"
///  ],
///  "properties": {
///    "city": {
///      "description": "City of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "ISO 2-letter country code.",
///      "type": "string",
///      "maxLength": 2,
///      "minLength": 2,
///      "pattern": "^[A-Z]{2}$"
///    },
///    "postcode": {
///      "description": "Postal code of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "State or province of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Primary address line.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Secondary address line, such as floor and apartment number.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BillingAddress {
    ///City of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub city: ::std::option::Option<BillingAddressCity>,
    ///ISO 2-letter country code.
    pub country_code: BillingAddressCountryCode,
    ///Postal code of the address.
    pub postcode: BillingAddressPostcode,
    ///State or province of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<BillingAddressRegion>,
    ///Primary address line.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_1: ::std::option::Option<BillingAddressStreetLine1>,
    ///Secondary address line, such as floor and apartment number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<BillingAddressStreetLine2>,
}
///City of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "City of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressCity(::std::string::String);
impl ::std::ops::Deref for BillingAddressCity {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressCity> for ::std::string::String {
    fn from(value: BillingAddressCity) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressCity {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BillingAddressCity {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressCity {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressCity {
    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 BillingAddressCity {
    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())
            })
    }
}
///ISO 2-letter country code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "ISO 2-letter country code.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2,
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressCountryCode(::std::string::String);
impl ::std::ops::Deref for BillingAddressCountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressCountryCode> for ::std::string::String {
    fn from(value: BillingAddressCountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressCountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        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 BillingAddressCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressCountryCode {
    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 BillingAddressCountryCode {
    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())
            })
    }
}
///Postal code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Postal code of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressPostcode(::std::string::String);
impl ::std::ops::Deref for BillingAddressPostcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressPostcode> for ::std::string::String {
    fn from(value: BillingAddressPostcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressPostcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BillingAddressPostcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressPostcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressPostcode {
    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 BillingAddressPostcode {
    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())
            })
    }
}
///State or province of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "State or province of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressRegion(::std::string::String);
impl ::std::ops::Deref for BillingAddressRegion {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressRegion> for ::std::string::String {
    fn from(value: BillingAddressRegion) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressRegion {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BillingAddressRegion {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressRegion {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressRegion {
    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 BillingAddressRegion {
    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())
            })
    }
}
///Primary address line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Primary address line.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressStreetLine1(::std::string::String);
impl ::std::ops::Deref for BillingAddressStreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressStreetLine1> for ::std::string::String {
    fn from(value: BillingAddressStreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressStreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BillingAddressStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressStreetLine1 {
    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 BillingAddressStreetLine1 {
    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())
            })
    }
}
///Secondary address line, such as floor and apartment number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Secondary address line, such as floor and apartment number.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct BillingAddressStreetLine2(::std::string::String);
impl ::std::ops::Deref for BillingAddressStreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BillingAddressStreetLine2> for ::std::string::String {
    fn from(value: BillingAddressStreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for BillingAddressStreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for BillingAddressStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingAddressStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BillingAddressStreetLine2 {
    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 BillingAddressStreetLine2 {
    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 provided by the merchant associated with the order.
///
/// This `booking_id` is used to reference and correlate booking information with the Merchant API and the merchant's internal system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A unique identifier provided by the merchant associated with the order. \n\nThis `booking_id` is used to reference and correlate booking information with the Merchant API and the merchant's internal system.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct BookingId(pub ::std::string::String);
impl ::std::ops::Deref for BookingId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<BookingId> for ::std::string::String {
    fn from(value: BookingId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for BookingId {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for BookingId {
    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 BookingId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Browser environment
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Browser environment",
///  "type": "object",
///  "required": [
///    "color_depth",
///    "java_enabled",
///    "screen_height",
///    "screen_width",
///    "time_zone_utc_offset",
///    "type"
///  ],
///  "properties": {
///    "browser_url": {
///      "description": "The URL of the page where the payment was initiated.",
///      "type": "string",
///      "format": "url"
///    },
///    "challenge_window_width": {
///      "description": "Defines the width of the pop-up window where the authentication challenge appears.",
///      "type": "integer"
///    },
///    "color_depth": {
///      "description": "The browser's available colour depth.",
///      "type": "integer"
///    },
///    "java_enabled": {
///      "description": "Indicates if the browser has Java enabled.",
///      "type": "boolean"
///    },
///    "screen_height": {
///      "description": "The browser's screen height in pixels.",
///      "type": "integer"
///    },
///    "screen_width": {
///      "description": "The browser's screen width in pixels.",
///      "type": "integer"
///    },
///    "time_zone_utc_offset": {
///      "description": "Defines the offset to UTC in minutes.",
///      "type": "integer"
///    },
///    "type": {
///      "description": "Type of environment where the payment was made.",
///      "type": "string",
///      "enum": [
///        "browser"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BrowserEnvironment {
    ///The URL of the page where the payment was initiated.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub browser_url: ::std::option::Option<::std::string::String>,
    ///Defines the width of the pop-up window where the authentication challenge appears.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub challenge_window_width: ::std::option::Option<i64>,
    ///The browser's available colour depth.
    pub color_depth: i64,
    ///Indicates if the browser has Java enabled.
    pub java_enabled: bool,
    ///The browser's screen height in pixels.
    pub screen_height: i64,
    ///The browser's screen width in pixels.
    pub screen_width: i64,
    ///Defines the offset to UTC in minutes.
    pub time_zone_utc_offset: i64,
    ///Type of environment where the payment was made.
    #[serde(rename = "type")]
    pub type_: BrowserEnvironmentType,
}
///Type of environment where the payment was made.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of environment where the payment was made.",
///  "type": "string",
///  "enum": [
///    "browser"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum BrowserEnvironmentType {
    #[serde(rename = "browser")]
    Browser,
}
impl ::std::fmt::Display for BrowserEnvironmentType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Browser => f.write_str("browser"),
        }
    }
}
impl ::std::str::FromStr for BrowserEnvironmentType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "browser" => Ok(Self::Browser),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for BrowserEnvironmentType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for BrowserEnvironmentType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for BrowserEnvironmentType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Automatic cancellation period for uncaptured orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// After this period, the authorised payment is automatically cancelled and the order is cancelled. Maximum: 7 days = `P7D`.
///
/// :::note
/// The following limitations apply:
///   - Cannot be a negative value.
///   - Cannot be updated if the new value is less than or equal to the elapsed time since authorisation.
///
///     **Failing scenario:**
///       - Original value: 7 days
///       - Time since authorisation: 3 days
///       - Update value: 2 days
///
///     In this scenario, an error is returned.
///
///     **Successful scenario:**
///       - Original value: 7 days
///       - Time since authorisation: 3 days
///       - Update value: 4 days
///
///     In this scenario, the parameter can be updated.
///
///   - Cannot be updated if cancellation is ≤ 30 minutes away.
///
///     **Failing scenario:**
///       - Original value: 12 hours
///       - Time since authorisation: 11 hours 40 minutes
///
///     In this scenario, an error is returned.
///
///     **Successful scenario:**
///       - Original value: 12 hours
///       - Time since authorisation: 11 hours 20 minutes
///
///     In this scenario, the parameter can be updated.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Automatic cancellation period for uncaptured orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. \n\nAfter this period, the authorised payment is automatically cancelled and the order is cancelled. Maximum: 7 days = `P7D`.\n\n:::note\nThe following limitations apply:\n  - Cannot be a negative value.\n  - Cannot be updated if the new value is less than or equal to the elapsed time since authorisation. \n\n    **Failing scenario:**\n      - Original value: 7 days\n      - Time since authorisation: 3 days\n      - Update value: 2 days\n      \n    In this scenario, an error is returned.\n    \n    **Successful scenario:**\n      - Original value: 7 days\n      - Time since authorisation: 3 days\n      - Update value: 4 days\n\n    In this scenario, the parameter can be updated.\n\n  - Cannot be updated if cancellation is ≤ 30 minutes away.\n\n    **Failing scenario:**\n      - Original value: 12 hours\n      - Time since authorisation: 11 hours 40 minutes\n                        \n    In this scenario, an error is returned.\n    \n    **Successful scenario:** \n      - Original value: 12 hours\n      - Time since authorisation: 11 hours 20 minutes\n\n    In this scenario, the parameter can be updated.\n:::",
///  "type": "string",
///  "format": "duration"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CancelAuthorisedAfter(pub ::std::string::String);
impl ::std::ops::Deref for CancelAuthorisedAfter {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CancelAuthorisedAfter> for ::std::string::String {
    fn from(value: CancelAuthorisedAfter) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CancelAuthorisedAfter {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CancelAuthorisedAfter {
    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 CancelAuthorisedAfter {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Automatic cancellation period for uncaptured orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// After this period, the authorised payment is automatically cancelled and the order is cancelled.
///
/// Maximum period depends on the order's `authorisation_type`:
/// - `pre_authorisation`: 30 days = `P30D`
/// - `final`: 7 days = `P7D`
///
/// :::note
/// The following limitations apply:
///   - Cannot be a negative value.
///   - Cannot be updated if the new value is less than or equal to the elapsed time since authorisation.
///
///     **Failing scenario:**
///       - Original value: 7 days
///       - Time since authorisation: 3 days
///       - Update value: 2 days
///
///     In this scenario, an error is returned.
///
///     **Successful scenario:**
///       - Original value: 7 days
///       - Time since authorisation: 3 days
///       - Update value: 4 days
///
///     In this scenario, the parameter can be updated.
///
///   - Cannot be updated if cancellation is ≤ 30 minutes away.
///
///     **Failing scenario:**
///       - Original value: 12 hours
///       - Time since authorisation: 11 hours 40 minutes
///
///     In this scenario, an error is returned.
///
///     **Successful scenario:**
///       - Original value: 12 hours
///       - Time since authorisation: 11 hours 20 minutes
///
///     In this scenario, the parameter can be updated.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Automatic cancellation period for uncaptured orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nAfter this period, the authorised payment is automatically cancelled and the order is cancelled.\n\nMaximum period depends on the order's `authorisation_type`:\n- `pre_authorisation`: 30 days = `P30D`\n- `final`: 7 days = `P7D`\n\n:::note\nThe following limitations apply:\n  - Cannot be a negative value.\n  - Cannot be updated if the new value is less than or equal to the elapsed time since authorisation.\n\n    **Failing scenario:**\n      - Original value: 7 days\n      - Time since authorisation: 3 days\n      - Update value: 2 days\n\n    In this scenario, an error is returned.\n\n    **Successful scenario:**\n      - Original value: 7 days\n      - Time since authorisation: 3 days\n      - Update value: 4 days\n\n    In this scenario, the parameter can be updated.\n\n  - Cannot be updated if cancellation is ≤ 30 minutes away.\n\n    **Failing scenario:**\n      - Original value: 12 hours\n      - Time since authorisation: 11 hours 40 minutes\n\n    In this scenario, an error is returned.\n\n    **Successful scenario:**\n      - Original value: 12 hours\n      - Time since authorisation: 11 hours 20 minutes\n\n    In this scenario, the parameter can be updated.\n:::",
///  "type": "string",
///  "format": "duration"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CancelAuthorisedAfterV2(pub ::std::string::String);
impl ::std::ops::Deref for CancelAuthorisedAfterV2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CancelAuthorisedAfterV2> for ::std::string::String {
    fn from(value: CancelAuthorisedAfterV2) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CancelAuthorisedAfterV2 {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CancelAuthorisedAfterV2 {
    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 CancelAuthorisedAfterV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The date and time by which the payment must be captured.
///
/// After this deadline, the authorised funds may be automatically released by the card issuer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time by which the payment must be captured.\n\nAfter this deadline, the authorised funds may be automatically released by the card issuer.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CaptureDeadline(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for CaptureDeadline {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<CaptureDeadline> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: CaptureDeadline) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for CaptureDeadline {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CaptureDeadline {
    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 CaptureDeadline {
    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 CaptureDeadline {
    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 CaptureDeadline {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The capture mode of the order. `automatic` is used by default.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `automatic` | The order is captured automatically after payment authorisation. |
/// | `manual` | The order is not captured automatically. You must manually capture the order later. |
///
/// :::info
/// For more information, see [Capture an order](https://developer.revolut.com/docs/merchant/capture-order).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The capture mode of the order. `automatic` is used by default.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `automatic` | The order is captured automatically after payment authorisation. |\n| `manual` | The order is not captured automatically. You must manually capture the order later. |\n\n:::info\nFor more information, see [Capture an order](https://developer.revolut.com/docs/merchant/capture-order).\n:::",
///  "type": "string",
///  "enum": [
///    "automatic",
///    "manual"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CaptureModeV2 {
    #[serde(rename = "automatic")]
    Automatic,
    #[serde(rename = "manual")]
    Manual,
}
impl ::std::fmt::Display for CaptureModeV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Automatic => f.write_str("automatic"),
            Self::Manual => f.write_str("manual"),
        }
    }
}
impl ::std::str::FromStr for CaptureModeV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "automatic" => Ok(Self::Automatic),
            "manual" => Ok(Self::Manual),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CaptureModeV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CaptureModeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CaptureModeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Object containing additional information about a car rental booking associated with the order.
///
/// :::info
/// These are the specific data field requirements for merchants offering car rental. Note that these requirements can be extended on a case by case basis as decided by Revolut.
///
/// ```text
/// booking_id
/// drop_off_date
/// refundability
/// ```text
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing additional information about a car rental booking associated with the order.\n\n:::info\nThese are the specific data field requirements for merchants offering car rental. Note that these requirements can be extended on a case by case basis as decided by Revolut.\n\n```\nbooking_id\ndrop_off_date\nrefundability\n```\n:::",
///  "type": "object",
///  "required": [
///    "booking_id",
///    "drop_off_date"
///  ],
///  "properties": {
///    "booking_id": {
///      "$ref": "#/components/schemas/Booking-Id"
///    },
///    "distance_limit": {
///      "description": "Object containing distance limit information.",
///      "type": "object",
///      "properties": {
///        "additional_distance_cost": {
///          "description": "Cost for exceeding the distance limit.",
///          "type": "object",
///          "properties": {
///            "amount": {
///              "description": "The amount of the cost in minor currency units. For example, enter `7034` for €70.34.",
///              "type": "integer"
///            },
///            "currency": {
///              "$ref": "#/components/schemas/Currency"
///            }
///          }
///        },
///        "limit": {
///          "description": "The maximum distance allowed.",
///          "type": "integer"
///        },
///        "unit": {
///          "description": "The unit of distance.",
///          "type": "string",
///          "enum": [
///            "miles",
///            "km"
///          ]
///        }
///      }
///    },
///    "drop_off_date": {
///      "description": "The UTC date and time of the drop-off.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "drop_off_location": {
///      "$ref": "#/components/schemas/Address-v2"
///    },
///    "pick_up_date": {
///      "description": "The UTC date and time of the pick-up.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "pick_up_location": {
///      "$ref": "#/components/schemas/Address-v2"
///    },
///    "refundability": {
///      "$ref": "#/components/schemas/Refundability"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CarRentalV2 {
    pub booking_id: BookingId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub distance_limit: ::std::option::Option<CarRentalV2DistanceLimit>,
    ///The UTC date and time of the drop-off.
    pub drop_off_date: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub drop_off_location: ::std::option::Option<AddressV2>,
    ///The UTC date and time of the pick-up.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub pick_up_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub pick_up_location: ::std::option::Option<AddressV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub refundability: ::std::option::Option<Refundability>,
}
///Object containing distance limit information.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing distance limit information.",
///  "type": "object",
///  "properties": {
///    "additional_distance_cost": {
///      "description": "Cost for exceeding the distance limit.",
///      "type": "object",
///      "properties": {
///        "amount": {
///          "description": "The amount of the cost in minor currency units. For example, enter `7034` for €70.34.",
///          "type": "integer"
///        },
///        "currency": {
///          "$ref": "#/components/schemas/Currency"
///        }
///      }
///    },
///    "limit": {
///      "description": "The maximum distance allowed.",
///      "type": "integer"
///    },
///    "unit": {
///      "description": "The unit of distance.",
///      "type": "string",
///      "enum": [
///        "miles",
///        "km"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CarRentalV2DistanceLimit {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub additional_distance_cost:
        ::std::option::Option<CarRentalV2DistanceLimitAdditionalDistanceCost>,
    ///The maximum distance allowed.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub limit: ::std::option::Option<i64>,
    ///The unit of distance.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub unit: ::std::option::Option<CarRentalV2DistanceLimitUnit>,
}
impl ::std::default::Default for CarRentalV2DistanceLimit {
    fn default() -> Self {
        Self {
            additional_distance_cost: Default::default(),
            limit: Default::default(),
            unit: Default::default(),
        }
    }
}
///Cost for exceeding the distance limit.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Cost for exceeding the distance limit.",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "description": "The amount of the cost in minor currency units. For example, enter `7034` for €70.34.",
///      "type": "integer"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CarRentalV2DistanceLimitAdditionalDistanceCost {
    ///The amount of the cost in minor currency units. For example, enter `7034` for €70.34.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<i64>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
}
impl ::std::default::Default for CarRentalV2DistanceLimitAdditionalDistanceCost {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            currency: Default::default(),
        }
    }
}
///The unit of distance.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unit of distance.",
///  "type": "string",
///  "enum": [
///    "miles",
///    "km"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CarRentalV2DistanceLimitUnit {
    #[serde(rename = "miles")]
    Miles,
    #[serde(rename = "km")]
    Km,
}
impl ::std::fmt::Display for CarRentalV2DistanceLimitUnit {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Miles => f.write_str("miles"),
            Self::Km => f.write_str("km"),
        }
    }
}
impl ::std::str::FromStr for CarRentalV2DistanceLimitUnit {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "miles" => Ok(Self::Miles),
            "km" => Ok(Self::Km),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CarRentalV2DistanceLimitUnit {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CarRentalV2DistanceLimitUnit {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CarRentalV2DistanceLimitUnit {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Object containing details of the card used for the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of the card used for the payment.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "arn": {
///      "$ref": "#/components/schemas/Arn"
///    },
///    "authorisation_code": {
///      "$ref": "#/components/schemas/Authorisation-Code"
///    },
///    "capture_deadline": {
///      "$ref": "#/components/schemas/Capture-Deadline"
///    },
///    "card_bin": {
///      "description": "The BIN of the card.",
///      "type": "string",
///      "maxLength": 6,
///      "minLength": 6
///    },
///    "card_brand": {
///      "description": "The type of the card.",
///      "type": "string",
///      "enum": [
///        "visa",
///        "mastercard",
///        "american_express"
///      ]
///    },
///    "card_country_code": {
///      "description": "The 2-letter country code of the country where the card was issued.",
///      "type": "string"
///    },
///    "card_expiry": {
///      "description": "The expiry date of the card in the format of MM/YY.",
///      "type": "string",
///      "format": "MM/YY"
///    },
///    "card_last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string",
///      "maxLength": 4,
///      "minLength": 4
///    },
///    "cardholder_name": {
///      "description": "The name of the cardholder.",
///      "type": "string"
///    },
///    "checks": {
///      "$ref": "#/components/schemas/Card-Checks-v2"
///    },
///    "fingerprint": {
///      "$ref": "#/components/schemas/Fingerprint"
///    },
///    "funding": {
///      "description": "The type of card funding.",
///      "type": "string",
///      "enum": [
///        "credit",
///        "debit",
///        "prepaid"
///      ]
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "network_transaction_id": {
///      "$ref": "#/components/schemas/Network-Transaction-Id"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Card {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub arn: ::std::option::Option<Arn>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_code: ::std::option::Option<AuthorisationCode>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_deadline: ::std::option::Option<CaptureDeadline>,
    ///The BIN of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_bin: ::std::option::Option<CardCardBin>,
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<CardCardBrand>,
    ///The 2-letter country code of the country where the card was issued.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_country_code: ::std::option::Option<::std::string::String>,
    ///The expiry date of the card in the format of MM/YY.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_expiry: ::std::option::Option<::std::string::String>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<CardCardLastFour>,
    ///The name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub checks: ::std::option::Option<CardChecksV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<Fingerprint>,
    ///The type of card funding.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub funding: ::std::option::Option<CardFunding>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub network_transaction_id: ::std::option::Option<NetworkTransactionId>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///The BIN (Bank Identification Number) of the payment card, typically the first 6-8 digits.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The BIN (Bank Identification Number) of the payment card, typically the first 6-8 digits.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CardBin(pub ::std::string::String);
impl ::std::ops::Deref for CardBin {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardBin> for ::std::string::String {
    fn from(value: CardBin) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CardBin {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardBin {
    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 CardBin {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The brand of the payment card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The brand of the payment card.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard",
///    "american_express"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardBrandV2 {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
    #[serde(rename = "american_express")]
    AmericanExpress,
}
impl ::std::fmt::Display for CardBrandV2 {
    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"),
            Self::AmericanExpress => f.write_str("american_express"),
        }
    }
}
impl ::std::str::FromStr for CardBrandV2 {
    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),
            "american_express" => Ok(Self::AmericanExpress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardBrandV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardBrandV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardBrandV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The BIN of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The BIN of the card.",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 6
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardCardBin(::std::string::String);
impl ::std::ops::Deref for CardCardBin {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardCardBin> for ::std::string::String {
    fn from(value: CardCardBin) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardCardBin {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 6usize {
            return Err("shorter than 6 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardCardBin {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardCardBin {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardCardBin {
    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 CardCardBin {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the card.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard",
///    "american_express"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardCardBrand {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
    #[serde(rename = "american_express")]
    AmericanExpress,
}
impl ::std::fmt::Display for CardCardBrand {
    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"),
            Self::AmericanExpress => f.write_str("american_express"),
        }
    }
}
impl ::std::str::FromStr for CardCardBrand {
    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),
            "american_express" => Ok(Self::AmericanExpress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The last four digits of the card number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the card number.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardCardLastFour(::std::string::String);
impl ::std::ops::Deref for CardCardLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardCardLastFour> for ::std::string::String {
    fn from(value: CardCardLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardCardLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardCardLastFour {
    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 CardCardLastFour {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The details of the check for card payment. Only for orders with successful payments.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the check for card payment. Only for orders with successful payments.",
///  "type": "object",
///  "properties": {
///    "address": {
///      "description": "The result of address verification.",
///      "type": "string",
///      "enum": [
///        "match",
///        "not_match",
///        "n_a",
///        "invalid"
///      ]
///    },
///    "cardholder": {
///      "description": "The result of cardholder verification.",
///      "type": "string",
///      "enum": [
///        "match",
///        "not_match",
///        "n_a",
///        "invalid"
///      ]
///    },
///    "cvv_verification": {
///      "description": "The result of CVV verification.\n\n| Parameter value | Description |\n| ----- | ----------- |\n| `match` | CVV matches the card's CVV |\n| `not_match` | CVV does not match the card's CVV |\n| `incorrect` | CVV format is incorrect for this type of card |\n| `not_processed` | CVV verification was not performed |",
///      "type": "string",
///      "enum": [
///        "match",
///        "not_match",
///        "incorrect",
///        "not_processed"
///      ]
///    },
///    "postcode": {
///      "description": "The result of postcode verification.",
///      "type": "string",
///      "enum": [
///        "match",
///        "not_match",
///        "n_a",
///        "invalid"
///      ]
///    },
///    "three_ds": {
///      "description": "The details of the 3D Secure check. Only for orders with successful payments.\n\n:::note\nNot returned for Apple Pay and Google Pay payments.\n:::",
///      "type": "object",
///      "properties": {
///        "eci": {
///          "description": "The Electronic Commerce Indicator (ECI) value corresponds to the authentication result and indicates the level of security used when the payment information was provided.",
///          "type": "string"
///        },
///        "state": {
///          "description": "The result of 3D Secure check.",
///          "type": "string",
///          "enum": [
///            "verified",
///            "failed",
///            "challenge"
///          ]
///        },
///        "version": {
///          "description": "The 3D Secure version.",
///          "type": "integer"
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardChecksV2 {
    ///The result of address verification.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub address: ::std::option::Option<CardChecksV2Address>,
    ///The result of cardholder verification.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder: ::std::option::Option<CardChecksV2Cardholder>,
    /// The result of CVV verification.
    ///
    /// | Parameter value | Description |
    /// | ----- | ----------- |
    /// | `match` | CVV matches the card's CVV |
    /// | `not_match` | CVV does not match the card's CVV |
    /// | `incorrect` | CVV format is incorrect for this type of card |
    /// | `not_processed` | CVV verification was not performed |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cvv_verification: ::std::option::Option<CardChecksV2CvvVerification>,
    ///The result of postcode verification.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub postcode: ::std::option::Option<CardChecksV2Postcode>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub three_ds: ::std::option::Option<CardChecksV2ThreeDs>,
}
impl ::std::default::Default for CardChecksV2 {
    fn default() -> Self {
        Self {
            address: Default::default(),
            cardholder: Default::default(),
            cvv_verification: Default::default(),
            postcode: Default::default(),
            three_ds: Default::default(),
        }
    }
}
///The result of address verification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of address verification.",
///  "type": "string",
///  "enum": [
///    "match",
///    "not_match",
///    "n_a",
///    "invalid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardChecksV2Address {
    #[serde(rename = "match")]
    Match,
    #[serde(rename = "not_match")]
    NotMatch,
    #[serde(rename = "n_a")]
    NA,
    #[serde(rename = "invalid")]
    Invalid,
}
impl ::std::fmt::Display for CardChecksV2Address {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Match => f.write_str("match"),
            Self::NotMatch => f.write_str("not_match"),
            Self::NA => f.write_str("n_a"),
            Self::Invalid => f.write_str("invalid"),
        }
    }
}
impl ::std::str::FromStr for CardChecksV2Address {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "match" => Ok(Self::Match),
            "not_match" => Ok(Self::NotMatch),
            "n_a" => Ok(Self::NA),
            "invalid" => Ok(Self::Invalid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardChecksV2Address {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardChecksV2Address {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardChecksV2Address {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The result of cardholder verification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of cardholder verification.",
///  "type": "string",
///  "enum": [
///    "match",
///    "not_match",
///    "n_a",
///    "invalid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardChecksV2Cardholder {
    #[serde(rename = "match")]
    Match,
    #[serde(rename = "not_match")]
    NotMatch,
    #[serde(rename = "n_a")]
    NA,
    #[serde(rename = "invalid")]
    Invalid,
}
impl ::std::fmt::Display for CardChecksV2Cardholder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Match => f.write_str("match"),
            Self::NotMatch => f.write_str("not_match"),
            Self::NA => f.write_str("n_a"),
            Self::Invalid => f.write_str("invalid"),
        }
    }
}
impl ::std::str::FromStr for CardChecksV2Cardholder {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "match" => Ok(Self::Match),
            "not_match" => Ok(Self::NotMatch),
            "n_a" => Ok(Self::NA),
            "invalid" => Ok(Self::Invalid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardChecksV2Cardholder {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardChecksV2Cardholder {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardChecksV2Cardholder {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The result of CVV verification.
///
/// | Parameter value | Description |
/// | ----- | ----------- |
/// | `match` | CVV matches the card's CVV |
/// | `not_match` | CVV does not match the card's CVV |
/// | `incorrect` | CVV format is incorrect for this type of card |
/// | `not_processed` | CVV verification was not performed |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of CVV verification.\n\n| Parameter value | Description |\n| ----- | ----------- |\n| `match` | CVV matches the card's CVV |\n| `not_match` | CVV does not match the card's CVV |\n| `incorrect` | CVV format is incorrect for this type of card |\n| `not_processed` | CVV verification was not performed |",
///  "type": "string",
///  "enum": [
///    "match",
///    "not_match",
///    "incorrect",
///    "not_processed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardChecksV2CvvVerification {
    #[serde(rename = "match")]
    Match,
    #[serde(rename = "not_match")]
    NotMatch,
    #[serde(rename = "incorrect")]
    Incorrect,
    #[serde(rename = "not_processed")]
    NotProcessed,
}
impl ::std::fmt::Display for CardChecksV2CvvVerification {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Match => f.write_str("match"),
            Self::NotMatch => f.write_str("not_match"),
            Self::Incorrect => f.write_str("incorrect"),
            Self::NotProcessed => f.write_str("not_processed"),
        }
    }
}
impl ::std::str::FromStr for CardChecksV2CvvVerification {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "match" => Ok(Self::Match),
            "not_match" => Ok(Self::NotMatch),
            "incorrect" => Ok(Self::Incorrect),
            "not_processed" => Ok(Self::NotProcessed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardChecksV2CvvVerification {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardChecksV2CvvVerification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardChecksV2CvvVerification {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The result of postcode verification.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of postcode verification.",
///  "type": "string",
///  "enum": [
///    "match",
///    "not_match",
///    "n_a",
///    "invalid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardChecksV2Postcode {
    #[serde(rename = "match")]
    Match,
    #[serde(rename = "not_match")]
    NotMatch,
    #[serde(rename = "n_a")]
    NA,
    #[serde(rename = "invalid")]
    Invalid,
}
impl ::std::fmt::Display for CardChecksV2Postcode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Match => f.write_str("match"),
            Self::NotMatch => f.write_str("not_match"),
            Self::NA => f.write_str("n_a"),
            Self::Invalid => f.write_str("invalid"),
        }
    }
}
impl ::std::str::FromStr for CardChecksV2Postcode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "match" => Ok(Self::Match),
            "not_match" => Ok(Self::NotMatch),
            "n_a" => Ok(Self::NA),
            "invalid" => Ok(Self::Invalid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardChecksV2Postcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardChecksV2Postcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardChecksV2Postcode {
    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 3D Secure check. Only for orders with successful payments.
///
/// :::note
/// Not returned for Apple Pay and Google Pay payments.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the 3D Secure check. Only for orders with successful payments.\n\n:::note\nNot returned for Apple Pay and Google Pay payments.\n:::",
///  "type": "object",
///  "properties": {
///    "eci": {
///      "description": "The Electronic Commerce Indicator (ECI) value corresponds to the authentication result and indicates the level of security used when the payment information was provided.",
///      "type": "string"
///    },
///    "state": {
///      "description": "The result of 3D Secure check.",
///      "type": "string",
///      "enum": [
///        "verified",
///        "failed",
///        "challenge"
///      ]
///    },
///    "version": {
///      "description": "The 3D Secure version.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardChecksV2ThreeDs {
    ///The Electronic Commerce Indicator (ECI) value corresponds to the authentication result and indicates the level of security used when the payment information was provided.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub eci: ::std::option::Option<::std::string::String>,
    ///The result of 3D Secure check.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<CardChecksV2ThreeDsState>,
    ///The 3D Secure version.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub version: ::std::option::Option<i64>,
}
impl ::std::default::Default for CardChecksV2ThreeDs {
    fn default() -> Self {
        Self {
            eci: Default::default(),
            state: Default::default(),
            version: Default::default(),
        }
    }
}
///The result of 3D Secure check.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The result of 3D Secure check.",
///  "type": "string",
///  "enum": [
///    "verified",
///    "failed",
///    "challenge"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardChecksV2ThreeDsState {
    #[serde(rename = "verified")]
    Verified,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "challenge")]
    Challenge,
}
impl ::std::fmt::Display for CardChecksV2ThreeDsState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Verified => f.write_str("verified"),
            Self::Failed => f.write_str("failed"),
            Self::Challenge => f.write_str("challenge"),
        }
    }
}
impl ::std::str::FromStr for CardChecksV2ThreeDsState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "verified" => Ok(Self::Verified),
            "failed" => Ok(Self::Failed),
            "challenge" => Ok(Self::Challenge),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardChecksV2ThreeDsState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardChecksV2ThreeDsState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardChecksV2ThreeDsState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The expiry month of the payment card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The expiry month of the payment card.",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardExpiryMonth(pub i64);
impl ::std::ops::Deref for CardExpiryMonth {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<CardExpiryMonth> for i64 {
    fn from(value: CardExpiryMonth) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for CardExpiryMonth {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardExpiryMonth {
    type Err = <i64 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 CardExpiryMonth {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardExpiryMonth {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardExpiryMonth {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The expiry year of the payment card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The expiry year of the payment card.",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CardExpiryYear(pub i64);
impl ::std::ops::Deref for CardExpiryYear {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<CardExpiryYear> for i64 {
    fn from(value: CardExpiryYear) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for CardExpiryYear {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardExpiryYear {
    type Err = <i64 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 CardExpiryYear {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CardExpiryYear {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CardExpiryYear {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`CardForPaymentDetails`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "brand": {
///      "description": "The type of the card.",
///      "type": "string"
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned if the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string"
///    },
///    "type": {
///      "description": "The type of payment method used to pay for the order.",
///      "type": "string",
///      "enum": [
///        "card",
///        "revolut_pay"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardForPaymentDetails {
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub brand: ::std::option::Option<::std::string::String>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned if the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_four: ::std::option::Option<::std::string::String>,
    ///The type of payment method used to pay for the order.
    #[serde(rename = "type")]
    pub type_: CardForPaymentDetailsType,
}
///The type of payment method used to pay for the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of payment method used to pay for the order.",
///  "type": "string",
///  "enum": [
///    "card",
///    "revolut_pay"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardForPaymentDetailsType {
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "revolut_pay")]
    RevolutPay,
}
impl ::std::fmt::Display for CardForPaymentDetailsType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Card => f.write_str("card"),
            Self::RevolutPay => f.write_str("revolut_pay"),
        }
    }
}
impl ::std::str::FromStr for CardForPaymentDetailsType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "card" => Ok(Self::Card),
            "revolut_pay" => Ok(Self::RevolutPay),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardForPaymentDetailsType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardForPaymentDetailsType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardForPaymentDetailsType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The type of card funding.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of card funding.",
///  "type": "string",
///  "enum": [
///    "credit",
///    "debit",
///    "prepaid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardFunding {
    #[serde(rename = "credit")]
    Credit,
    #[serde(rename = "debit")]
    Debit,
    #[serde(rename = "prepaid")]
    Prepaid,
}
impl ::std::fmt::Display for CardFunding {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("credit"),
            Self::Debit => f.write_str("debit"),
            Self::Prepaid => f.write_str("prepaid"),
        }
    }
}
impl ::std::str::FromStr for CardFunding {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "credit" => Ok(Self::Credit),
            "debit" => Ok(Self::Debit),
            "prepaid" => Ok(Self::Prepaid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardFunding {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The funding type of the payment card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The funding type of the payment card.",
///  "type": "string",
///  "enum": [
///    "debit",
///    "credit",
///    "prepaid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CardFundingV2 {
    #[serde(rename = "debit")]
    Debit,
    #[serde(rename = "credit")]
    Credit,
    #[serde(rename = "prepaid")]
    Prepaid,
}
impl ::std::fmt::Display for CardFundingV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Debit => f.write_str("debit"),
            Self::Credit => f.write_str("credit"),
            Self::Prepaid => f.write_str("prepaid"),
        }
    }
}
impl ::std::str::FromStr for CardFundingV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "debit" => Ok(Self::Debit),
            "credit" => Ok(Self::Credit),
            "prepaid" => Ok(Self::Prepaid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CardFundingV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardFundingV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardFundingV2 {
    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 card-issuing bank or institution.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the card-issuing bank or institution.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CardIssuer(pub ::std::string::String);
impl ::std::ops::Deref for CardIssuer {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardIssuer> for ::std::string::String {
    fn from(value: CardIssuer) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CardIssuer {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardIssuer {
    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 CardIssuer {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ISO 3166-1 alpha-2 country code of the country where the payment card was issued.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ISO 3166-1 alpha-2 country code of the country where the payment card was issued.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardIssuerCountry(::std::string::String);
impl ::std::ops::Deref for CardIssuerCountry {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardIssuerCountry> for ::std::string::String {
    fn from(value: CardIssuerCountry) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardIssuerCountry {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardIssuerCountry {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardIssuerCountry {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardIssuerCountry {
    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 CardIssuerCountry {
    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 four digits of the payment card number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the payment card number.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CardLastFour(::std::string::String);
impl ::std::ops::Deref for CardLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardLastFour> for ::std::string::String {
    fn from(value: CardLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CardLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CardLastFour {
    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 CardLastFour {
    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 saved card payment method.
///
/// :::info
/// The `checks` object (3DS, CVV, address verification) is not included as it is specific to the transactional payment context.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Card payment method",
///  "description": "A saved card payment method.\n\n:::info\nThe `checks` object (3DS, CVV, address verification) is not included as it is specific to the transactional payment context.\n:::",
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "type"
///  ],
///  "properties": {
///    "billing_address": {
///      "$ref": "#/components/schemas/Billing-Address"
///    },
///    "bin": {
///      "$ref": "#/components/schemas/Card-Bin"
///    },
///    "brand": {
///      "$ref": "#/components/schemas/Card-Brand-v2"
///    },
///    "cardholder_name": {
///      "$ref": "#/components/schemas/Cardholder-Name"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/Payment-Method-Created-At"
///    },
///    "expiry_month": {
///      "$ref": "#/components/schemas/Card-Expiry-Month"
///    },
///    "expiry_year": {
///      "$ref": "#/components/schemas/Card-Expiry-Year"
///    },
///    "funding": {
///      "$ref": "#/components/schemas/Card-Funding-v2"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Method-Id"
///    },
///    "issuer": {
///      "$ref": "#/components/schemas/Card-Issuer"
///    },
///    "issuer_country": {
///      "$ref": "#/components/schemas/Card-Issuer-Country"
///    },
///    "last_four": {
///      "$ref": "#/components/schemas/Card-Last-Four"
///    },
///    "saved_for": {
///      "$ref": "#/components/schemas/Saved-For"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type-v2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CardV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub billing_address: ::std::option::Option<BillingAddress>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bin: ::std::option::Option<CardBin>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub brand: ::std::option::Option<CardBrandV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder_name: ::std::option::Option<CardholderName>,
    pub created_at: PaymentMethodCreatedAt,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_month: ::std::option::Option<CardExpiryMonth>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expiry_year: ::std::option::Option<CardExpiryYear>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub funding: ::std::option::Option<CardFundingV2>,
    pub id: PaymentMethodId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub issuer: ::std::option::Option<CardIssuer>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub issuer_country: ::std::option::Option<CardIssuerCountry>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_four: ::std::option::Option<CardLastFour>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub saved_for: ::std::option::Option<SavedFor>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodTypeV2,
}
///The name of the cardholder as it appears on the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the cardholder as it appears on the card.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CardholderName(pub ::std::string::String);
impl ::std::ops::Deref for CardholderName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CardholderName> for ::std::string::String {
    fn from(value: CardholderName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CardholderName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CardholderName {
    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 CardholderName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Link to a checkout page hosted by Revolut.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Link to a checkout page hosted by Revolut.",
///  "type": "string",
///  "format": "uri"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CheckoutUrl(pub ::std::string::String);
impl ::std::ops::Deref for CheckoutUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CheckoutUrl> for ::std::string::String {
    fn from(value: CheckoutUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CheckoutUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CheckoutUrl {
    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 CheckoutUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Contact details for someone responsible for the shipment.
///
/// :::caution
/// At least `email` or `phone` is required.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Contact details for someone responsible for the shipment.\n\n:::caution\nAt least `email` or `phone` is required.\n:::",
///  "type": "object",
///  "properties": {
///    "email": {
///      "description": "Email address of the contact person.",
///      "type": "string",
///      "format": "email"
///    },
///    "name": {
///      "description": "Full name of the contact person.",
///      "type": "string",
///      "maxLength": 250
///    },
///    "phone": {
///      "description": "Phone number of the contact person.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Contact {
    ///Email address of the contact person.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub email: ::std::option::Option<::std::string::String>,
    ///Full name of the contact person.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<ContactName>,
    ///Phone number of the contact person.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for Contact {
    fn default() -> Self {
        Self {
            email: Default::default(),
            name: Default::default(),
            phone: Default::default(),
        }
    }
}
///Full name of the contact person.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Full name of the contact person.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ContactName(::std::string::String);
impl ::std::ops::Deref for ContactName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ContactName> for ::std::string::String {
    fn from(value: ContactName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ContactName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ContactName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ContactName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ContactName {
    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 ContactName {
    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())
            })
    }
}
///`CryptoTransaction`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id",
///    "recipient",
///    "status"
///  ],
///  "properties": {
///    "id": {
///      "description": "The public transaction hash of the crypto transaction.",
///      "type": "string",
///      "maxLength": 255
///    },
///    "recipient_user_id": {
///      "description": "The user ID of the recipient.\n\n:::note\nAt least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.\n:::              ",
///      "type": "string",
///      "maxLength": 255
///    },
///    "recipient_wallet_id": {
///      "description": "The wallet ID of the recipient.\n\n:::note\nAt least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.\n::: ",
///      "type": "string",
///      "maxLength": 255
///    },
///    "status": {
///      "description": "The status of the crypto transaction.",
///      "type": "string",
///      "enum": [
///        "pending",
///        "failed",
///        "cancelled",
///        "completed"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CryptoTransaction {
    ///The public transaction hash of the crypto transaction.
    pub id: CryptoTransactionId,
    pub recipient: ::serde_json::Value,
    /// The user ID of the recipient.
    ///
    /// :::note
    /// At least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub recipient_user_id: ::std::option::Option<CryptoTransactionRecipientUserId>,
    /// The wallet ID of the recipient.
    ///
    /// :::note
    /// At least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub recipient_wallet_id: ::std::option::Option<CryptoTransactionRecipientWalletId>,
    ///The status of the crypto transaction.
    pub status: CryptoTransactionStatus,
}
///The public transaction hash of the crypto transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The public transaction hash of the crypto transaction.",
///  "type": "string",
///  "maxLength": 255
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CryptoTransactionId(::std::string::String);
impl ::std::ops::Deref for CryptoTransactionId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CryptoTransactionId> for ::std::string::String {
    fn from(value: CryptoTransactionId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CryptoTransactionId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 255usize {
            return Err("longer than 255 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CryptoTransactionId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionId {
    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 CryptoTransactionId {
    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 user ID of the recipient.
///
/// :::note
/// At least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The user ID of the recipient.\n\n:::note\nAt least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.\n:::              ",
///  "type": "string",
///  "maxLength": 255
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CryptoTransactionRecipientUserId(::std::string::String);
impl ::std::ops::Deref for CryptoTransactionRecipientUserId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CryptoTransactionRecipientUserId> for ::std::string::String {
    fn from(value: CryptoTransactionRecipientUserId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CryptoTransactionRecipientUserId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 255usize {
            return Err("longer than 255 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CryptoTransactionRecipientUserId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionRecipientUserId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionRecipientUserId {
    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 CryptoTransactionRecipientUserId {
    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 wallet ID of the recipient.
///
/// :::note
/// At least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The wallet ID of the recipient.\n\n:::note\nAt least one of the parameters: `recipient_user_id` or `recipient_wallet_id` is required.\n::: ",
///  "type": "string",
///  "maxLength": 255
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CryptoTransactionRecipientWalletId(::std::string::String);
impl ::std::ops::Deref for CryptoTransactionRecipientWalletId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CryptoTransactionRecipientWalletId> for ::std::string::String {
    fn from(value: CryptoTransactionRecipientWalletId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CryptoTransactionRecipientWalletId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 255usize {
            return Err("longer than 255 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for CryptoTransactionRecipientWalletId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionRecipientWalletId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionRecipientWalletId {
    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 CryptoTransactionRecipientWalletId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The status of the crypto transaction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the crypto transaction.",
///  "type": "string",
///  "enum": [
///    "pending",
///    "failed",
///    "cancelled",
///    "completed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum CryptoTransactionStatus {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "completed")]
    Completed,
}
impl ::std::fmt::Display for CryptoTransactionStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Failed => f.write_str("failed"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Completed => f.write_str("completed"),
        }
    }
}
impl ::std::str::FromStr for CryptoTransactionStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "failed" => Ok(Self::Failed),
            "cancelled" => Ok(Self::Cancelled),
            "completed" => Ok(Self::Completed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CryptoTransactionStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Object containing information about crypto transactions associated with the order.
///
/// :::info
/// Processing crypto on-ramp transactions with Revolut has additional compliance requirements. Please reach out to your account executive for additional details.
///
/// **Required data fields for crypto services:**
///
/// ```text
/// transactions[].id
/// transactions[].status
/// transactions[].recipient_wallet_id
/// seller.id
/// seller.name
/// seller.website
/// seller.phone
/// seller.address
/// seller.mcc
/// customer.full_name
/// customer.date_of_birth
/// ```text
///
/// Note that these requirements can be extended on a case by case basis as decided by Revolut.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing information about crypto transactions associated with the order.\n\n:::info\nProcessing crypto on-ramp transactions with Revolut has additional compliance requirements. Please reach out to your account executive for additional details.\n\n**Required data fields for crypto services:**\n\n```\ntransactions[].id\ntransactions[].status\ntransactions[].recipient_wallet_id\nseller.id\nseller.name\nseller.website\nseller.phone\nseller.address\nseller.mcc\ncustomer.full_name\ncustomer.date_of_birth\n```\n\nNote that these requirements can be extended on a case by case basis as decided by Revolut.\n:::",
///  "type": "object",
///  "required": [
///    "transactions"
///  ],
///  "properties": {
///    "seller": {
///      "description": "Information about the crypto conversion affiliate.\n\nThis should be provided when a customer completes a payment on a subseller's website rather than directly on the merchant's website, providing insight into the type of business conducted by the subseller.\n\n:::note\nThis needs to be provided only by crypto on-ramp providers for payments they are processing for conversion affiliates.\n\nFor their own payments, `seller` can be omitted.\n:::",
///      "type": "object",
///      "required": [
///        "address",
///        "id",
///        "mcc",
///        "name",
///        "phone",
///        "website"
///      ],
///      "properties": {
///        "address": {
///          "$ref": "#/components/schemas/Address-v4"
///        },
///        "id": {
///          "description": "The ID of the seller in the merchant's internal system.",
///          "type": "string",
///          "maxLength": 15,
///          "minLength": 1
///        },
///        "mcc": {
///          "$ref": "#/components/schemas/Mcc"
///        },
///        "name": {
///          "description": "The business or legal name of the seller.",
///          "type": "string",
///          "maxLength": 50,
///          "minLength": 1
///        },
///        "phone": {
///          "description": "The phone number of the seller.",
///          "type": "string"
///        },
///        "website": {
///          "description": "The URL of the website of the seller.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `255`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///          "type": "string",
///          "format": "uri",
///          "maxLength": 255,
///          "pattern": "^https?:\\/{2}.+/gi"
///        }
///      }
///    },
///    "transactions": {
///      "description": "Array of crypto transaction data associated with the order.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Crypto-Transaction"
///      },
///      "minItems": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CryptoTransactionsV3 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub seller: ::std::option::Option<CryptoTransactionsV3Seller>,
    ///Array of crypto transaction data associated with the order.
    pub transactions: ::std::vec::Vec<CryptoTransaction>,
}
/// Information about the crypto conversion affiliate.
///
/// This should be provided when a customer completes a payment on a subseller's website rather than directly on the merchant's website, providing insight into the type of business conducted by the subseller.
///
/// :::note
/// This needs to be provided only by crypto on-ramp providers for payments they are processing for conversion affiliates.
///
/// For their own payments, `seller` can be omitted.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Information about the crypto conversion affiliate.\n\nThis should be provided when a customer completes a payment on a subseller's website rather than directly on the merchant's website, providing insight into the type of business conducted by the subseller.\n\n:::note\nThis needs to be provided only by crypto on-ramp providers for payments they are processing for conversion affiliates.\n\nFor their own payments, `seller` can be omitted.\n:::",
///  "type": "object",
///  "required": [
///    "address",
///    "id",
///    "mcc",
///    "name",
///    "phone",
///    "website"
///  ],
///  "properties": {
///    "address": {
///      "$ref": "#/components/schemas/Address-v4"
///    },
///    "id": {
///      "description": "The ID of the seller in the merchant's internal system.",
///      "type": "string",
///      "maxLength": 15,
///      "minLength": 1
///    },
///    "mcc": {
///      "$ref": "#/components/schemas/Mcc"
///    },
///    "name": {
///      "description": "The business or legal name of the seller.",
///      "type": "string",
///      "maxLength": 50,
///      "minLength": 1
///    },
///    "phone": {
///      "description": "The phone number of the seller.",
///      "type": "string"
///    },
///    "website": {
///      "description": "The URL of the website of the seller.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `255`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 255,
///      "pattern": "^https?:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CryptoTransactionsV3Seller {
    pub address: AddressV4,
    ///The ID of the seller in the merchant's internal system.
    pub id: CryptoTransactionsV3SellerId,
    pub mcc: Mcc,
    ///The business or legal name of the seller.
    pub name: CryptoTransactionsV3SellerName,
    ///The phone number of the seller.
    pub phone: ::std::string::String,
    /// The URL of the website of the seller.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be either `http` or `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `255`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    pub website: ::std::string::String,
}
///The ID of the seller in the merchant's internal system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the seller in the merchant's internal system.",
///  "type": "string",
///  "maxLength": 15,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CryptoTransactionsV3SellerId(::std::string::String);
impl ::std::ops::Deref for CryptoTransactionsV3SellerId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CryptoTransactionsV3SellerId> for ::std::string::String {
    fn from(value: CryptoTransactionsV3SellerId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CryptoTransactionsV3SellerId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 15usize {
            return Err("longer than 15 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 CryptoTransactionsV3SellerId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionsV3SellerId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionsV3SellerId {
    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 CryptoTransactionsV3SellerId {
    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 business or legal name of the seller.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The business or legal name of the seller.",
///  "type": "string",
///  "maxLength": 50,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct CryptoTransactionsV3SellerName(::std::string::String);
impl ::std::ops::Deref for CryptoTransactionsV3SellerName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CryptoTransactionsV3SellerName> for ::std::string::String {
    fn from(value: CryptoTransactionsV3SellerName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for CryptoTransactionsV3SellerName {
    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 CryptoTransactionsV3SellerName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CryptoTransactionsV3SellerName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CryptoTransactionsV3SellerName {
    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 CryptoTransactionsV3SellerName {
    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())
            })
    }
}
/// [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// :::info
/// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///  "type": "string",
///  "format": "ISO 4217",
///  "maxLength": 3,
///  "minLength": 3
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Currency(pub ::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::convert::From<::std::string::String> for Currency {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for Currency {
    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 Currency {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///A customer object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Customer",
///  "description": "A customer object.",
///  "type": "object",
///  "required": [
///    "created_at",
///    "email",
///    "id",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the customer was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    },
///    "updated_at": {
///      "description": "The date and time the customer was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerCreated {
    ///The date and time the customer was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub email: Email,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    pub id: CustomerId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
    ///The date and time the customer was last updated.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The request body for creating a customer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Customer creation",
///  "description": "The request body for creating a customer.",
///  "type": "object",
///  "required": [
///    "email"
///  ],
///  "properties": {
///    "date_of_birth": {
///      "$ref": "#/components/schemas/Date-Of-Birth"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerCreationV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub date_of_birth: ::std::option::Option<DateOfBirth>,
    pub email: Email,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
}
///Unique identifier for the customer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the customer.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CustomerId(pub ::uuid::Uuid);
impl ::std::ops::Deref for CustomerId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<CustomerId> for ::uuid::Uuid {
    fn from(value: CustomerId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for CustomerId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CustomerId {
    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 CustomerId {
    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 CustomerId {
    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 CustomerId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`CustomerPaymentMethodsV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "payment_methods"
///  ],
///  "properties": {
///    "payment_methods": {
///      "description": "Saved payment methods associated with this customer. Each entry represents a\npayment method authorised for future charges. Two types are supported: `card`\n(with full card details) and `revolut_pay` (covers both card-backed and\naccount-to-account Revolut Pay variants). Use the `type` field on each item\nto identify the variant.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Payment-Method-v4"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerPaymentMethodsV2 {
    /// Saved payment methods associated with this customer. Each entry represents a
    /// payment method authorised for future charges. Two types are supported: `card`
    /// (with full card details) and `revolut_pay` (covers both card-backed and
    /// account-to-account Revolut Pay variants). Use the `type` field on each item
    /// to identify the variant.
    pub payment_methods: ::std::vec::Vec<PaymentMethodV4>,
}
///A customer object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Customer",
///  "description": "A customer object.",
///  "type": "object",
///  "required": [
///    "created_at",
///    "email",
///    "id",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the customer was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    },
///    "updated_at": {
///      "description": "The date and time the customer was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerSimplified {
    ///The date and time the customer was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub email: Email,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    pub id: CustomerId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
    ///The date and time the customer was last updated.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The request body for updating a customer.
///
/// All fields are optional. Only the fields provided in the request will be updated.
///
/// :::note
/// `business_name` is not supported in this version of the API.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Customer update",
///  "description": "The request body for updating a customer.\n\nAll fields are optional. Only the fields provided in the request will be updated.\n\n:::note\n`business_name` is not supported in this version of the API.\n:::",
///  "type": "object",
///  "properties": {
///    "date_of_birth": {
///      "$ref": "#/components/schemas/Date-Of-Birth"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerUpdateV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub date_of_birth: ::std::option::Option<DateOfBirth>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub email: ::std::option::Option<Email>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
}
impl ::std::default::Default for CustomerUpdateV2 {
    fn default() -> Self {
        Self {
            date_of_birth: Default::default(),
            email: Default::default(),
            full_name: Default::default(),
            phone: Default::default(),
        }
    }
}
/// Object containing information about a customer.
///
/// If you have it, we strongly advise providing at least either `id`, `phone`, or `email`.
///
/// Using the [Customers operations](https://developer.revolut.com/docs/merchant/customers), you can manage customer instances.
///
/// The following behaviours apply to different use cases:
///
///   | Use case | API behavior |
///   | -------- | ------------ |
///   | Existing customer | If `id` was provided, we ignore other customer details and associate the customer with the order.<br/><br/>If either `email`, `phone`, or `full_name` was provided (without an existing customer's `id`), we always create a new customer, irrespective of another, existing customer object having the same details. |
///   | New customer | If either `email`, `phone`, or `full_name` was provided, we create a new customer, irrespective of another customer object having the same details. <br/><br/>If `id` of a non-existent customer was provided, we return a `404` error, irrespective of other details provided. |
///
/// :::note
/// To avoid unintentional duplication of customer records, search for an existing customer by email or phone using the [List customers](https://developer.revolut.com/docs/merchant/retrieve-customer-list) endpoint first, then provide `customer.id` in the order.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing information about a customer.\n\nIf you have it, we strongly advise providing at least either `id`, `phone`, or `email`.\n\nUsing the [Customers operations](https://developer.revolut.com/docs/merchant/customers), you can manage customer instances.\n\nThe following behaviours apply to different use cases:\n\n  | Use case | API behavior |\n  | -------- | ------------ |\n  | Existing customer | If `id` was provided, we ignore other customer details and associate the customer with the order.<br/><br/>If either `email`, `phone`, or `full_name` was provided (without an existing customer's `id`), we always create a new customer, irrespective of another, existing customer object having the same details. |\n  | New customer | If either `email`, `phone`, or `full_name` was provided, we create a new customer, irrespective of another customer object having the same details. <br/><br/>If `id` of a non-existent customer was provided, we return a `404` error, irrespective of other details provided. |\n\n:::note\nTo avoid unintentional duplication of customer records, search for an existing customer by email or phone using the [List customers](https://developer.revolut.com/docs/merchant/retrieve-customer-list) endpoint first, then provide `customer.id` in the order.\n:::",
///  "type": "object",
///  "properties": {
///    "date_of_birth": {
///      "$ref": "#/components/schemas/Date-Of-Birth"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "id": {
///      "description": "Permanent ID of a customer used to retrieve, update, delete a customer. This ID can also be used to link customer to an order.\n\n:::note\nIf you provide the customer's ID during order creation, no other customer data is required, they will be parsed automatically from the referenced customer object.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub date_of_birth: ::std::option::Option<DateOfBirth>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub email: ::std::option::Option<Email>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    /// Permanent ID of a customer used to retrieve, update, delete a customer. This ID can also be used to link customer to an order.
    ///
    /// :::note
    /// If you provide the customer's ID during order creation, no other customer data is required, they will be parsed automatically from the referenced customer object.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
}
impl ::std::default::Default for CustomerV2 {
    fn default() -> Self {
        Self {
            date_of_birth: Default::default(),
            email: Default::default(),
            full_name: Default::default(),
            id: Default::default(),
            phone: Default::default(),
        }
    }
}
///A customer object.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Customer",
///  "description": "A customer object.",
///  "type": "object",
///  "required": [
///    "created_at",
///    "email",
///    "id",
///    "payment_methods",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "description": "The date and time the customer was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "payment_methods": {
///      "description": "Saved payment methods associated with this customer. Each entry represents a\npayment method authorised for future charges. Two types are supported: `card`\n(with full card details) and `revolut_pay` (covers both card-backed and\naccount-to-account Revolut Pay variants). Use the `type` field on each item\nto identify the variant.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Payment-Method-v4"
///      }
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    },
///    "updated_at": {
///      "description": "The date and time the customer was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CustomerV3 {
    ///The date and time the customer was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub email: Email,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    pub id: CustomerId,
    /// Saved payment methods associated with this customer. Each entry represents a
    /// payment method authorised for future charges. Two types are supported: `card`
    /// (with full card details) and `revolut_pay` (covers both card-backed and
    /// account-to-account Revolut Pay variants). Use the `type` field on each item
    /// to identify the variant.
    pub payment_methods: ::std::vec::Vec<PaymentMethodV4>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
    ///The date and time the customer was last updated.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
///`Customers`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "customers"
///  ],
///  "properties": {
///    "customers": {
///      "description": "List of customers.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Customer-Simplified"
///      }
///    },
///    "next_page_token": {
///      "$ref": "#/components/schemas/Next-Page-Token"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Customers {
    ///List of customers.
    pub customers: ::std::vec::Vec<CustomerSimplified>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub next_page_token: ::std::option::Option<NextPageToken>,
}
/// Number of billing cycles for this phase before moving to the next phase.
///
/// | Value | Behavior |
/// | ----- | -------- |
/// | `null` or omitted | Phase continues indefinitely. The subscription remains in this phase with no automatic progression. |
/// | Specific number (e.g., `1`, `3`, `12`) | After completing this many billing cycles, the subscription automatically moves to the next phase as determined by the `ordinal` field. |
///
/// **Example**: If `cycle_count=3` and `cycle_duration=P1M`, the subscription will complete 3 monthly cycles then move to the phase with the next highest `ordinal` value.
///
/// :::note
/// If no next phase exists in after a cycle with a specific `cycle_count`, the subscription will automatically stop when it completes its cycles.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Cycle-Count",
///  "description": "Number of billing cycles for this phase before moving to the next phase.\n\n| Value | Behavior |\n| ----- | -------- |\n| `null` or omitted | Phase continues indefinitely. The subscription remains in this phase with no automatic progression. |\n| Specific number (e.g., `1`, `3`, `12`) | After completing this many billing cycles, the subscription automatically moves to the next phase as determined by the `ordinal` field. |\n\n**Example**: If `cycle_count=3` and `cycle_duration=P1M`, the subscription will complete 3 monthly cycles then move to the phase with the next highest `ordinal` value.\n\n:::note\nIf no next phase exists in after a cycle with a specific `cycle_count`, the subscription will automatically stop when it completes its cycles.\n:::",
///  "type": [
///    "integer",
///    "null"
///  ],
///  "minimum": 1.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CycleCount(pub ::std::option::Option<::std::num::NonZeroU64>);
impl ::std::ops::Deref for CycleCount {
    type Target = ::std::option::Option<::std::num::NonZeroU64>;
    fn deref(&self) -> &::std::option::Option<::std::num::NonZeroU64> {
        &self.0
    }
}
impl ::std::convert::From<CycleCount> for ::std::option::Option<::std::num::NonZeroU64> {
    fn from(value: CycleCount) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::option::Option<::std::num::NonZeroU64>> for CycleCount {
    fn from(value: ::std::option::Option<::std::num::NonZeroU64>) -> Self {
        Self(value)
    }
}
/// The length of each billing cycle for this phase in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations).
///
/// This determines how often the customer is billed during this phase. The total time spent in a phase is `cycle_duration × cycle_count`.
///
/// **Common durations**:
///
/// | Duration | Description |
/// | -------- | ----------- |
/// | `P1M` | 1 month |
/// | `P1Y` | 1 year |
/// | `P15D` | 15 days |
/// | `P1W` | 1 week |
/// | `PT2H` | 2 hours |
///
/// **Example**: If `cycle_duration=P1M` and `cycle_count=12`, the customer will be billed monthly for 12 months (1 year total).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The length of each billing cycle for this phase in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations).\n\nThis determines how often the customer is billed during this phase. The total time spent in a phase is `cycle_duration × cycle_count`.\n\n**Common durations**:\n\n| Duration | Description |\n| -------- | ----------- |\n| `P1M` | 1 month |\n| `P1Y` | 1 year |\n| `P15D` | 15 days |\n| `P1W` | 1 week |\n| `PT2H` | 2 hours |\n\n**Example**: If `cycle_duration=P1M` and `cycle_count=12`, the customer will be billed monthly for 12 months (1 year total).",
///  "type": "string",
///  "format": "duration"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct CycleDuration(pub ::std::string::String);
impl ::std::ops::Deref for CycleDuration {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<CycleDuration> for ::std::string::String {
    fn from(value: CycleDuration) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for CycleDuration {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CycleDuration {
    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 CycleDuration {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The sequential cycle number within the subscription.
///
/// Starts at `1` for the first cycle and increments with each new billing cycle.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The sequential cycle number within the subscription.\n\nStarts at `1` for the first cycle and increments with each new billing cycle.",
///  "type": "integer",
///  "minimum": 1.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CycleNumber(pub ::std::num::NonZeroU64);
impl ::std::ops::Deref for CycleNumber {
    type Target = ::std::num::NonZeroU64;
    fn deref(&self) -> &::std::num::NonZeroU64 {
        &self.0
    }
}
impl ::std::convert::From<CycleNumber> for ::std::num::NonZeroU64 {
    fn from(value: CycleNumber) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::num::NonZeroU64> for CycleNumber {
    fn from(value: ::std::num::NonZeroU64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for CycleNumber {
    type Err = <::std::num::NonZeroU64 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 CycleNumber {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for CycleNumber {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for CycleNumber {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The birth date of the customer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The birth date of the customer.",
///  "type": "string",
///  "format": "date"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DateOfBirth(pub ::chrono::naive::NaiveDate);
impl ::std::ops::Deref for DateOfBirth {
    type Target = ::chrono::naive::NaiveDate;
    fn deref(&self) -> &::chrono::naive::NaiveDate {
        &self.0
    }
}
impl ::std::convert::From<DateOfBirth> for ::chrono::naive::NaiveDate {
    fn from(value: DateOfBirth) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::naive::NaiveDate> for DateOfBirth {
    fn from(value: ::chrono::naive::NaiveDate) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DateOfBirth {
    type Err = <::chrono::naive::NaiveDate 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 DateOfBirth {
    type Error = <::chrono::naive::NaiveDate as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for DateOfBirth {
    type Error = <::chrono::naive::NaiveDate as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for DateOfBirth {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// A list of one or more time intervals for a single day.
///
/// A day can have multiple intervals (e.g., closing for a lunch break).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of one or more time intervals for a single day. \n\nA day can have multiple intervals (e.g., closing for a lunch break).",
///  "type": "array",
///  "items": {
///    "type": "object",
///    "required": [
///      "from",
///      "to"
///    ],
///    "properties": {
///      "from": {
///        "description": "The local time when the interval begins.\n\n:::note\nThe format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.\n:::",
///        "type": "string",
///        "format": "time"
///      },
///      "to": {
///        "description": "The local time when the interval ends.\n\n:::note\nThe format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.\n:::",
///        "type": "string",
///        "format": "time"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DayOpeningHours(pub ::std::vec::Vec<DayOpeningHoursItem>);
impl ::std::ops::Deref for DayOpeningHours {
    type Target = ::std::vec::Vec<DayOpeningHoursItem>;
    fn deref(&self) -> &::std::vec::Vec<DayOpeningHoursItem> {
        &self.0
    }
}
impl ::std::convert::From<DayOpeningHours> for ::std::vec::Vec<DayOpeningHoursItem> {
    fn from(value: DayOpeningHours) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<DayOpeningHoursItem>> for DayOpeningHours {
    fn from(value: ::std::vec::Vec<DayOpeningHoursItem>) -> Self {
        Self(value)
    }
}
///`DayOpeningHoursItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "from",
///    "to"
///  ],
///  "properties": {
///    "from": {
///      "description": "The local time when the interval begins.\n\n:::note\nThe format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.\n:::",
///      "type": "string",
///      "format": "time"
///    },
///    "to": {
///      "description": "The local time when the interval ends.\n\n:::note\nThe format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.\n:::",
///      "type": "string",
///      "format": "time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DayOpeningHoursItem {
    /// The local time when the interval begins.
    ///
    /// :::note
    /// The format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.
    /// :::
    pub from: ::std::string::String,
    /// The local time when the interval ends.
    ///
    /// :::note
    /// The format is `hh:mm[:ss]`; seconds are optional and must be `00` if provided.
    /// :::
    pub to: ::std::string::String,
}
/// The reason for a `failed` or `declined` payment.
///
/// A failed or declined payment can result from multiple reasons. To learn more, check our [failure reasons](https://developer.revolut.com/docs/guides/merchant/reference/error-codes/decline-reasons).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason for a `failed` or `declined` payment.\n\nA failed or declined payment can result from multiple reasons. To learn more, check our [failure reasons](https://developer.revolut.com/docs/guides/merchant/reference/error-codes/decline-reasons).",
///  "type": "string",
///  "enum": [
///    "3ds_challenge_abandoned",
///    "3ds_challenge_failed_manually",
///    "cardholder_name_missing",
///    "customer_challenge_abandoned",
///    "customer_challenge_failed",
///    "customer_name_mismatch",
///    "do_not_honour",
///    "expired_card",
///    "high_risk",
///    "insufficient_funds",
///    "invalid_address",
///    "invalid_amount",
///    "invalid_card",
///    "invalid_country",
///    "invalid_cvv",
///    "invalid_email",
///    "invalid_expiry",
///    "invalid_merchant",
///    "invalid_phone",
///    "invalid_pin",
///    "issuer_not_available",
///    "pick_up_card",
///    "rejected_by_customer",
///    "restricted_card",
///    "suspected_fraud",
///    "technical_error",
///    "transaction_not_allowed_for_cardholder",
///    "unknown_card",
///    "withdrawal_limit_exceeded"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DeclineReasonV2 {
    #[serde(rename = "3ds_challenge_abandoned")]
    X3dsChallengeAbandoned,
    #[serde(rename = "3ds_challenge_failed_manually")]
    X3dsChallengeFailedManually,
    #[serde(rename = "cardholder_name_missing")]
    CardholderNameMissing,
    #[serde(rename = "customer_challenge_abandoned")]
    CustomerChallengeAbandoned,
    #[serde(rename = "customer_challenge_failed")]
    CustomerChallengeFailed,
    #[serde(rename = "customer_name_mismatch")]
    CustomerNameMismatch,
    #[serde(rename = "do_not_honour")]
    DoNotHonour,
    #[serde(rename = "expired_card")]
    ExpiredCard,
    #[serde(rename = "high_risk")]
    HighRisk,
    #[serde(rename = "insufficient_funds")]
    InsufficientFunds,
    #[serde(rename = "invalid_address")]
    InvalidAddress,
    #[serde(rename = "invalid_amount")]
    InvalidAmount,
    #[serde(rename = "invalid_card")]
    InvalidCard,
    #[serde(rename = "invalid_country")]
    InvalidCountry,
    #[serde(rename = "invalid_cvv")]
    InvalidCvv,
    #[serde(rename = "invalid_email")]
    InvalidEmail,
    #[serde(rename = "invalid_expiry")]
    InvalidExpiry,
    #[serde(rename = "invalid_merchant")]
    InvalidMerchant,
    #[serde(rename = "invalid_phone")]
    InvalidPhone,
    #[serde(rename = "invalid_pin")]
    InvalidPin,
    #[serde(rename = "issuer_not_available")]
    IssuerNotAvailable,
    #[serde(rename = "pick_up_card")]
    PickUpCard,
    #[serde(rename = "rejected_by_customer")]
    RejectedByCustomer,
    #[serde(rename = "restricted_card")]
    RestrictedCard,
    #[serde(rename = "suspected_fraud")]
    SuspectedFraud,
    #[serde(rename = "technical_error")]
    TechnicalError,
    #[serde(rename = "transaction_not_allowed_for_cardholder")]
    TransactionNotAllowedForCardholder,
    #[serde(rename = "unknown_card")]
    UnknownCard,
    #[serde(rename = "withdrawal_limit_exceeded")]
    WithdrawalLimitExceeded,
}
impl ::std::fmt::Display for DeclineReasonV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::X3dsChallengeAbandoned => f.write_str("3ds_challenge_abandoned"),
            Self::X3dsChallengeFailedManually => f.write_str("3ds_challenge_failed_manually"),
            Self::CardholderNameMissing => f.write_str("cardholder_name_missing"),
            Self::CustomerChallengeAbandoned => f.write_str("customer_challenge_abandoned"),
            Self::CustomerChallengeFailed => f.write_str("customer_challenge_failed"),
            Self::CustomerNameMismatch => f.write_str("customer_name_mismatch"),
            Self::DoNotHonour => f.write_str("do_not_honour"),
            Self::ExpiredCard => f.write_str("expired_card"),
            Self::HighRisk => f.write_str("high_risk"),
            Self::InsufficientFunds => f.write_str("insufficient_funds"),
            Self::InvalidAddress => f.write_str("invalid_address"),
            Self::InvalidAmount => f.write_str("invalid_amount"),
            Self::InvalidCard => f.write_str("invalid_card"),
            Self::InvalidCountry => f.write_str("invalid_country"),
            Self::InvalidCvv => f.write_str("invalid_cvv"),
            Self::InvalidEmail => f.write_str("invalid_email"),
            Self::InvalidExpiry => f.write_str("invalid_expiry"),
            Self::InvalidMerchant => f.write_str("invalid_merchant"),
            Self::InvalidPhone => f.write_str("invalid_phone"),
            Self::InvalidPin => f.write_str("invalid_pin"),
            Self::IssuerNotAvailable => f.write_str("issuer_not_available"),
            Self::PickUpCard => f.write_str("pick_up_card"),
            Self::RejectedByCustomer => f.write_str("rejected_by_customer"),
            Self::RestrictedCard => f.write_str("restricted_card"),
            Self::SuspectedFraud => f.write_str("suspected_fraud"),
            Self::TechnicalError => f.write_str("technical_error"),
            Self::TransactionNotAllowedForCardholder => {
                f.write_str("transaction_not_allowed_for_cardholder")
            }
            Self::UnknownCard => f.write_str("unknown_card"),
            Self::WithdrawalLimitExceeded => f.write_str("withdrawal_limit_exceeded"),
        }
    }
}
impl ::std::str::FromStr for DeclineReasonV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "3ds_challenge_abandoned" => Ok(Self::X3dsChallengeAbandoned),
            "3ds_challenge_failed_manually" => Ok(Self::X3dsChallengeFailedManually),
            "cardholder_name_missing" => Ok(Self::CardholderNameMissing),
            "customer_challenge_abandoned" => Ok(Self::CustomerChallengeAbandoned),
            "customer_challenge_failed" => Ok(Self::CustomerChallengeFailed),
            "customer_name_mismatch" => Ok(Self::CustomerNameMismatch),
            "do_not_honour" => Ok(Self::DoNotHonour),
            "expired_card" => Ok(Self::ExpiredCard),
            "high_risk" => Ok(Self::HighRisk),
            "insufficient_funds" => Ok(Self::InsufficientFunds),
            "invalid_address" => Ok(Self::InvalidAddress),
            "invalid_amount" => Ok(Self::InvalidAmount),
            "invalid_card" => Ok(Self::InvalidCard),
            "invalid_country" => Ok(Self::InvalidCountry),
            "invalid_cvv" => Ok(Self::InvalidCvv),
            "invalid_email" => Ok(Self::InvalidEmail),
            "invalid_expiry" => Ok(Self::InvalidExpiry),
            "invalid_merchant" => Ok(Self::InvalidMerchant),
            "invalid_phone" => Ok(Self::InvalidPhone),
            "invalid_pin" => Ok(Self::InvalidPin),
            "issuer_not_available" => Ok(Self::IssuerNotAvailable),
            "pick_up_card" => Ok(Self::PickUpCard),
            "rejected_by_customer" => Ok(Self::RejectedByCustomer),
            "restricted_card" => Ok(Self::RestrictedCard),
            "suspected_fraud" => Ok(Self::SuspectedFraud),
            "technical_error" => Ok(Self::TechnicalError),
            "transaction_not_allowed_for_cardholder" => {
                Ok(Self::TransactionNotAllowedForCardholder)
            }
            "unknown_card" => Ok(Self::UnknownCard),
            "withdrawal_limit_exceeded" => Ok(Self::WithdrawalLimitExceeded),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DeclineReasonV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DeclineReasonV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DeclineReasonV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Details of a discount applied to the line item, including its name and monetary value.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details of a discount applied to the line item, including its name and monetary value.",
///  "type": "object",
///  "required": [
///    "amount",
///    "name"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The monetary value of the discount. ",
///      "type": "integer",
///      "format": "int64",
///      "minimum": 0.0
///    },
///    "name": {
///      "description": "The specific name or label of the discount applied to the line item.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Discount {
    ///The monetary value of the discount.
    pub amount: i64,
    ///The specific name or label of the discount applied to the line item.
    pub name: DiscountName,
}
///The specific name or label of the discount applied to the line item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The specific name or label of the discount applied to the line item.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DiscountName(::std::string::String);
impl ::std::ops::Deref for DiscountName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<DiscountName> for ::std::string::String {
    fn from(value: DiscountName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for DiscountName {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for DiscountName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DiscountName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DiscountName {
    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 DiscountName {
    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())
            })
    }
}
///`Dispute`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "amount": {
///      "description": "Disputed amount expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.\n\n:::info\nConversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).\n:::",
///      "type": "integer"
///    },
///    "created_at": {
///      "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the dispute was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "description": "Unique identifier of the dispute.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "payment": {
///      "$ref": "#/components/schemas/Dispute-Payment"
///    },
///    "reason_code": {
///      "description": "Dispute reason code from the payment scheme, following standard formats defined by individual providers.\n\n:::info\nFor complete, official lists of dispute codes, see:  \n- **Visa**: [Visa Core Rules and Visa Product and Service Rules](https://corporate.visa.com/content/dam/VCOM/download/about-visa/visa-rules-public.pdf) \n- **Mastercard**: [Chargeback Guide - Merchant Edition](https://www.mastercard.com/content/dam/public/mastercardcom/na/global-site/documents/chargeback-guide.pdf)\n- **American Express**: [Chargeback Codes](https://www.americanexpress.com/content/dam/amex/au/en/merchant/static/chargebackcodeguide.pdf)\n:::",
///      "type": "string"
///    },
///    "reason_description": {
///      "description": "Provides a human-readable explanation for the dispute reason codes.",
///      "type": "string"
///    },
///    "response_due_date": {
///      "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time until when the merchant needs to respond to the dispute.\n\nThe response time by default is 15 days after the dispute is created. If no response is provided by this date, the dispute transitions to:\n  - `state: lost`\n  - `substate: lost_expired` ",
///      "type": "string",
///      "format": "date-time"
///    },
///    "state": {
///      "description": "Represents the state of the dispute.\n\nIt indicates either the final outcome of the dispute or if further action is required.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `needs_response` | Indicates that the dispute requires a response or action from the merchant. |\n| `under_review` | Indicates that the dispute is currently under review, and the outcome is pending. |\n| `won` | Indicates that the dispute has been resolved in favor of the merchant. |\n| `lost` | Indicates that the dispute has been resolved against the merchant. |",
///      "type": "string",
///      "enum": [
///        "needs_response",
///        "under_review",
///        "won",
///        "lost"
///      ]
///    },
///    "substate": {
///      "description": "Provides additional granularity about the dispute state.\n\nIt details the progression of the dispute process, showing the current stage or phase.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `new` | The dispute has been recently created and is in the initial phase, awaiting further processing. |\n| `lost_expired` | The dispute has been lost due to expiration, likely because the merchant did not respond within the required timeframe. |\n| `pre_arbitration` | The dispute is in the pre-arbitration phase, where preliminary evidence is being gathered before a formal arbitration process. |\n| `won_pre_arbitration`| The merchant secured a win during the pre-arbitration phase based on the evidence provided. |\n| `lost_pre_arbitration` | The dispute was lost during the pre-arbitration phase, indicating that the preliminary review did not favor the merchant. |\n| `lost_accepted` | The loss has been accepted as final, implying that no further contestation is likely or needed. |\n| `arbitration` | The dispute has escalated to the arbitration stage, where a neutral third party is reviewing the evidence. |\n| `won_arbitration` | The merchant won the dispute during the arbitration process. |\n| `lost_arbitration` | The merchant lost the dispute during the arbitration process. |",
///      "type": "string",
///      "enum": [
///        "arbitration",
///        "lost_accepted",
///        "lost_arbitration",
///        "lost_expired",
///        "lost_pre_arbitration",
///        "lost_representment",
///        "new",
///        "pre_arbitration",
///        "representment",
///        "won_arbitration",
///        "won_pre_arbitration",
///        "won_representment",
///        "won_reversal"
///      ]
///    },
///    "updated_at": {
///      "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the dispute was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Dispute {
    /// Disputed amount expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.
    ///
    /// :::info
    /// Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<i64>,
    ///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the dispute was created.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
    ///Unique identifier of the dispute.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment: ::std::option::Option<DisputePayment>,
    /// Dispute reason code from the payment scheme, following standard formats defined by individual providers.
    ///
    /// :::info
    /// For complete, official lists of dispute codes, see:
    /// - **Visa**: [Visa Core Rules and Visa Product and Service Rules](https://corporate.visa.com/content/dam/VCOM/download/about-visa/visa-rules-public.pdf)
    /// - **Mastercard**: [Chargeback Guide - Merchant Edition](https://www.mastercard.com/content/dam/public/mastercardcom/na/global-site/documents/chargeback-guide.pdf)
    /// - **American Express**: [Chargeback Codes](https://www.americanexpress.com/content/dam/amex/au/en/merchant/static/chargebackcodeguide.pdf)
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason_code: ::std::option::Option<::std::string::String>,
    ///Provides a human-readable explanation for the dispute reason codes.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason_description: ::std::option::Option<::std::string::String>,
    /// [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time until when the merchant needs to respond to the dispute.
    ///
    /// The response time by default is 15 days after the dispute is created. If no response is provided by this date, the dispute transitions to:
    ///   - `state: lost`
    ///   - `substate: lost_expired`
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub response_due_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    /// Represents the state of the dispute.
    ///
    /// It indicates either the final outcome of the dispute or if further action is required.
    ///
    /// | Parameter value | Description |
    /// | --------------- | ----------- |
    /// | `needs_response` | Indicates that the dispute requires a response or action from the merchant. |
    /// | `under_review` | Indicates that the dispute is currently under review, and the outcome is pending. |
    /// | `won` | Indicates that the dispute has been resolved in favor of the merchant. |
    /// | `lost` | Indicates that the dispute has been resolved against the merchant. |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<DisputeState>,
    /// Provides additional granularity about the dispute state.
    ///
    /// It details the progression of the dispute process, showing the current stage or phase.
    ///
    /// | Parameter value | Description |
    /// | --------------- | ----------- |
    /// | `new` | The dispute has been recently created and is in the initial phase, awaiting further processing. |
    /// | `lost_expired` | The dispute has been lost due to expiration, likely because the merchant did not respond within the required timeframe. |
    /// | `pre_arbitration` | The dispute is in the pre-arbitration phase, where preliminary evidence is being gathered before a formal arbitration process. |
    /// | `won_pre_arbitration`| The merchant secured a win during the pre-arbitration phase based on the evidence provided. |
    /// | `lost_pre_arbitration` | The dispute was lost during the pre-arbitration phase, indicating that the preliminary review did not favor the merchant. |
    /// | `lost_accepted` | The loss has been accepted as final, implying that no further contestation is likely or needed. |
    /// | `arbitration` | The dispute has escalated to the arbitration stage, where a neutral third party is reviewing the evidence. |
    /// | `won_arbitration` | The merchant won the dispute during the arbitration process. |
    /// | `lost_arbitration` | The merchant lost the dispute during the arbitration process. |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub substate: ::std::option::Option<DisputeSubstate>,
    ///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the dispute was last updated.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for Dispute {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            created_at: Default::default(),
            currency: Default::default(),
            id: Default::default(),
            payment: Default::default(),
            reason_code: Default::default(),
            reason_description: Default::default(),
            response_due_date: Default::default(),
            state: Default::default(),
            substate: Default::default(),
            updated_at: Default::default(),
        }
    }
}
///`DisputeChallenge`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "evidences",
///    "reason"
///  ],
///  "properties": {
///    "comment": {
///      "$ref": "#/components/schemas/Dispute-Challenge-Comment"
///    },
///    "evidences": {
///      "$ref": "#/components/schemas/Dispute-Challenge-Evidences"
///    },
///    "reason": {
///      "$ref": "#/components/schemas/Dispute-Challenge-Reason"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputeChallenge {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub comment: ::std::option::Option<DisputeChallengeComment>,
    pub evidences: DisputeChallengeEvidences,
    pub reason: DisputeChallengeReason,
}
///Additional explanation or comment for the challenge, if needed.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional explanation or comment for the challenge, if needed.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DisputeChallengeComment(::std::string::String);
impl ::std::ops::Deref for DisputeChallengeComment {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<DisputeChallengeComment> for ::std::string::String {
    fn from(value: DisputeChallengeComment) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for DisputeChallengeComment {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for DisputeChallengeComment {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DisputeChallengeComment {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DisputeChallengeComment {
    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 DisputeChallengeComment {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// A list of IDs of previously uploaded evidence files to associate with this challenge.
///
/// :::caution
/// Each evidence ID can only be used for **a single challenge**. This means, that evidences already assigned to a challenge **cannot be reused** for other challenges.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of IDs of previously uploaded evidence files to associate with this challenge.\n\n:::caution\nEach evidence ID can only be used for **a single challenge**. This means, that evidences already assigned to a challenge **cannot be reused** for other challenges.\n:::",
///  "type": "array",
///  "items": {
///    "description": "ID of a previously uploaded evidence file.",
///    "type": "string",
///    "format": "uuid"
///  },
///  "maxItems": 10,
///  "minItems": 1,
///  "uniqueItems": true
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DisputeChallengeEvidences(pub Vec<::uuid::Uuid>);
impl ::std::ops::Deref for DisputeChallengeEvidences {
    type Target = Vec<::uuid::Uuid>;
    fn deref(&self) -> &Vec<::uuid::Uuid> {
        &self.0
    }
}
impl ::std::convert::From<DisputeChallengeEvidences> for Vec<::uuid::Uuid> {
    fn from(value: DisputeChallengeEvidences) -> Self {
        value.0
    }
}
impl ::std::convert::From<Vec<::uuid::Uuid>> for DisputeChallengeEvidences {
    fn from(value: Vec<::uuid::Uuid>) -> Self {
        Self(value)
    }
}
///The reason for challenging the dispute.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The reason for challenging the dispute.",
///  "type": "string",
///  "enum": [
///    "product_already_delivered",
///    "refund_already_issued",
///    "disagree_with_customers_claim"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DisputeChallengeReason {
    #[serde(rename = "product_already_delivered")]
    ProductAlreadyDelivered,
    #[serde(rename = "refund_already_issued")]
    RefundAlreadyIssued,
    #[serde(rename = "disagree_with_customers_claim")]
    DisagreeWithCustomersClaim,
}
impl ::std::fmt::Display for DisputeChallengeReason {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::ProductAlreadyDelivered => f.write_str("product_already_delivered"),
            Self::RefundAlreadyIssued => f.write_str("refund_already_issued"),
            Self::DisagreeWithCustomersClaim => f.write_str("disagree_with_customers_claim"),
        }
    }
}
impl ::std::str::FromStr for DisputeChallengeReason {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "product_already_delivered" => Ok(Self::ProductAlreadyDelivered),
            "refund_already_issued" => Ok(Self::RefundAlreadyIssued),
            "disagree_with_customers_claim" => Ok(Self::DisagreeWithCustomersClaim),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DisputeChallengeReason {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DisputeChallengeReason {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DisputeChallengeReason {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`DisputeEvidence`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id"
///  ],
///  "properties": {
///    "id": {
///      "description": "The ID of the uploaded evidence.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputeEvidence {
    ///The ID of the uploaded evidence.
    pub id: ::uuid::Uuid,
}
///`DisputeEvidenceCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "file"
///  ],
///  "properties": {
///    "file": {
///      "description": "The single evidence file to upload.\n\nThe client must ensure this part has its own `Content-Type` header specifying the media type of the file (e.g., `application/pdf`, `image/png`, `image/jpeg`).\n\nMust be one of the allowed types: `PDF`, `PNG`, `JPEG`.",
///      "type": "string",
///      "format": "binary"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputeEvidenceCreation {
    /// The single evidence file to upload.
    ///
    /// The client must ensure this part has its own `Content-Type` header specifying the media type of the file (e.g., `application/pdf`, `image/png`, `image/jpeg`).
    ///
    /// Must be one of the allowed types: `PDF`, `PNG`, `JPEG`.
    pub file: ::std::string::String,
}
///Object containing the details of the original payment associated with the dispute.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing the details of the original payment associated with the dispute.",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Dispute-Payment-Amount"
///    },
///    "arn": {
///      "$ref": "#/components/schemas/Dispute-Payment-Arn"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/Dispute-Payment-Created-At"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Dispute-Payment-Id"
///    },
///    "order_id": {
///      "$ref": "#/components/schemas/Dispute-Payment-Order-Id"
///    },
///    "payment_method": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePayment {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<DisputePaymentAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub arn: ::std::option::Option<DisputePaymentArn>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub created_at: ::std::option::Option<DisputePaymentCreatedAt>,
    #[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 id: ::std::option::Option<DisputePaymentId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub order_id: ::std::option::Option<DisputePaymentOrderId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_method: ::std::option::Option<DisputePaymentMethod>,
}
impl ::std::default::Default for DisputePayment {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            arn: Default::default(),
            created_at: Default::default(),
            currency: Default::default(),
            id: Default::default(),
            order_id: Default::default(),
            payment_method: Default::default(),
        }
    }
}
/// Amount of the original payment expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.
///
/// :::info
/// Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Amount of the original payment expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.\n\n:::info\nConversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).\n:::",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DisputePaymentAmount(pub i64);
impl ::std::ops::Deref for DisputePaymentAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<DisputePaymentAmount> for i64 {
    fn from(value: DisputePaymentAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for DisputePaymentAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DisputePaymentAmount {
    type Err = <i64 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 DisputePaymentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for DisputePaymentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for DisputePaymentAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Acquirer Reference Number (ARN) of the original payment.
///
/// :::note
/// Only returned for payments made by a card.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Acquirer Reference Number (ARN) of the original payment.\n\n:::note\nOnly returned for payments made by a card.\n:::",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct DisputePaymentArn(pub ::std::string::String);
impl ::std::ops::Deref for DisputePaymentArn {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<DisputePaymentArn> for ::std::string::String {
    fn from(value: DisputePaymentArn) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for DisputePaymentArn {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DisputePaymentArn {
    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 DisputePaymentArn {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the original disputed payment was created.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the original disputed payment was created.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DisputePaymentCreatedAt(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for DisputePaymentCreatedAt {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<DisputePaymentCreatedAt> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: DisputePaymentCreatedAt) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for DisputePaymentCreatedAt {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DisputePaymentCreatedAt {
    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 DisputePaymentCreatedAt {
    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 DisputePaymentCreatedAt {
    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 DisputePaymentCreatedAt {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ID of the original payment that was disputed.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the original payment that was disputed.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DisputePaymentId(pub ::uuid::Uuid);
impl ::std::ops::Deref for DisputePaymentId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<DisputePaymentId> for ::uuid::Uuid {
    fn from(value: DisputePaymentId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for DisputePaymentId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DisputePaymentId {
    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 DisputePaymentId {
    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 DisputePaymentId {
    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 DisputePaymentId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Payment method used for the original payment.
///
/// Use the `type` field to determine the specific payment method variant.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Payment method used for the original payment.\n\nUse the `type` field to determine the specific payment method variant.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Apple-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Apple-Tap-To-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Card"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Google-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Revolut-Pay-Account"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Revolut-Pay-Card"
///    },
///    {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Sepa-Direct-Debit"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum DisputePaymentMethod {
    ApplePay(DisputePaymentMethodApplePay),
    AppleTapToPay(DisputePaymentMethodAppleTapToPay),
    Card(DisputePaymentMethodCard),
    GooglePay(DisputePaymentMethodGooglePay),
    RevolutPayAccount(DisputePaymentMethodRevolutPayAccount),
    RevolutPayCard(DisputePaymentMethodRevolutPayCard),
    SepaDirectDebit(DisputePaymentMethodSepaDirectDebit),
}
impl ::std::convert::From<DisputePaymentMethodApplePay> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodApplePay) -> Self {
        Self::ApplePay(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodAppleTapToPay> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodAppleTapToPay) -> Self {
        Self::AppleTapToPay(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodCard> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodCard) -> Self {
        Self::Card(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodGooglePay> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodGooglePay) -> Self {
        Self::GooglePay(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodRevolutPayAccount> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodRevolutPayAccount) -> Self {
        Self::RevolutPayAccount(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodRevolutPayCard> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodRevolutPayCard) -> Self {
        Self::RevolutPayCard(value)
    }
}
impl ::std::convert::From<DisputePaymentMethodSepaDirectDebit> for DisputePaymentMethod {
    fn from(value: DisputePaymentMethodSepaDirectDebit) -> Self {
        Self::SepaDirectDebit(value)
    }
}
///Object containing details of a card used via Apple Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Apple Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "card_brand": {
///      "$ref": "#/components/schemas/Card-Brand-v2"
///    },
///    "card_last_four": {
///      "$ref": "#/components/schemas/Card-Last-Four"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodApplePay {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<CardBrandV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<CardLastFour>,
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of a payment made via Apple Tap to Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a payment made via Apple Tap to Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodAppleTapToPay {
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of the card used for the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of the card used for the payment.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "card_brand": {
///      "$ref": "#/components/schemas/Card-Brand-v2"
///    },
///    "card_last_four": {
///      "$ref": "#/components/schemas/Card-Last-Four"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodCard {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<CardBrandV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<CardLastFour>,
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of a card used via Google Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Google Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "card_brand": {
///      "$ref": "#/components/schemas/Card-Brand-v2"
///    },
///    "card_last_four": {
///      "$ref": "#/components/schemas/Card-Last-Four"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodGooglePay {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<CardBrandV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<CardLastFour>,
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of a payment made via Revolut Pay account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a payment made via Revolut Pay account.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodRevolutPayAccount {
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of a card used via Revolut Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Revolut Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "card_brand": {
///      "$ref": "#/components/schemas/Card-Brand-v2"
///    },
///    "card_last_four": {
///      "$ref": "#/components/schemas/Card-Last-Four"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodRevolutPayCard {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<CardBrandV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<CardLastFour>,
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
///Object containing details of a SEPA Direct Debit payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a SEPA Direct Debit payment.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "debtor_iban_last_four": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Iban-Last-Four"
///    },
///    "debtor_name": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Name"
///    },
///    "mandate_reference": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Mandate-Reference"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Dispute-Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DisputePaymentMethodSepaDirectDebit {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_iban_last_four: ::std::option::Option<SepaDirectDebitDebtorIbanLastFour>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_name: ::std::option::Option<SepaDirectDebitDebtorName>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub mandate_reference: ::std::option::Option<SepaDirectDebitMandateReference>,
    #[serde(rename = "type")]
    pub type_: DisputePaymentMethodType,
}
/// Type of the payment method used for the original payment.
///
/// Available values:
///
/// | Payment method `type` | Description |
/// | --------------------- | ----------- |
/// | `apple_pay` | The customer paid the order using Apple Pay. |
/// | `apple_tap_to_pay` | The customer paid the order using Apple Tap to Pay. |
/// | `card` | The customer paid the order using their credit or debit card. |
/// | `google_pay` | The customer paid the order using Google Pay. |
/// | `revolut_pay_card` | The customer paid the order via Revolut Pay using their credit or debit card. |
/// | `revolut_pay_account` | The customer paid the order via Revolut Pay using their Revolut account. |
/// | `sepa_direct_debit` | The customer paid the order via SEPA Direct Debit. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of the payment method used for the original payment.\n\nAvailable values:\n\n| Payment method `type` | Description |\n| --------------------- | ----------- |\n| `apple_pay` | The customer paid the order using Apple Pay. |\n| `apple_tap_to_pay` | The customer paid the order using Apple Tap to Pay. |\n| `card` | The customer paid the order using their credit or debit card. |\n| `google_pay` | The customer paid the order using Google Pay. |\n| `revolut_pay_card` | The customer paid the order via Revolut Pay using their credit or debit card. |\n| `revolut_pay_account` | The customer paid the order via Revolut Pay using their Revolut account. |\n| `sepa_direct_debit` | The customer paid the order via SEPA Direct Debit. |",
///  "type": "string",
///  "enum": [
///    "apple_pay",
///    "apple_tap_to_pay",
///    "card",
///    "google_pay",
///    "revolut_pay_account",
///    "revolut_pay_card",
///    "sepa_direct_debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DisputePaymentMethodType {
    #[serde(rename = "apple_pay")]
    ApplePay,
    #[serde(rename = "apple_tap_to_pay")]
    AppleTapToPay,
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "google_pay")]
    GooglePay,
    #[serde(rename = "revolut_pay_account")]
    RevolutPayAccount,
    #[serde(rename = "revolut_pay_card")]
    RevolutPayCard,
    #[serde(rename = "sepa_direct_debit")]
    SepaDirectDebit,
}
impl ::std::fmt::Display for DisputePaymentMethodType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::ApplePay => f.write_str("apple_pay"),
            Self::AppleTapToPay => f.write_str("apple_tap_to_pay"),
            Self::Card => f.write_str("card"),
            Self::GooglePay => f.write_str("google_pay"),
            Self::RevolutPayAccount => f.write_str("revolut_pay_account"),
            Self::RevolutPayCard => f.write_str("revolut_pay_card"),
            Self::SepaDirectDebit => f.write_str("sepa_direct_debit"),
        }
    }
}
impl ::std::str::FromStr for DisputePaymentMethodType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "apple_pay" => Ok(Self::ApplePay),
            "apple_tap_to_pay" => Ok(Self::AppleTapToPay),
            "card" => Ok(Self::Card),
            "google_pay" => Ok(Self::GooglePay),
            "revolut_pay_account" => Ok(Self::RevolutPayAccount),
            "revolut_pay_card" => Ok(Self::RevolutPayCard),
            "sepa_direct_debit" => Ok(Self::SepaDirectDebit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DisputePaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DisputePaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DisputePaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The ID of the order linked to the original disputed payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the order linked to the original disputed payment.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DisputePaymentOrderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for DisputePaymentOrderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<DisputePaymentOrderId> for ::uuid::Uuid {
    fn from(value: DisputePaymentOrderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for DisputePaymentOrderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for DisputePaymentOrderId {
    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 DisputePaymentOrderId {
    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 DisputePaymentOrderId {
    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 DisputePaymentOrderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Represents the state of the dispute.
///
/// It indicates either the final outcome of the dispute or if further action is required.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `needs_response` | Indicates that the dispute requires a response or action from the merchant. |
/// | `under_review` | Indicates that the dispute is currently under review, and the outcome is pending. |
/// | `won` | Indicates that the dispute has been resolved in favor of the merchant. |
/// | `lost` | Indicates that the dispute has been resolved against the merchant. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Represents the state of the dispute.\n\nIt indicates either the final outcome of the dispute or if further action is required.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `needs_response` | Indicates that the dispute requires a response or action from the merchant. |\n| `under_review` | Indicates that the dispute is currently under review, and the outcome is pending. |\n| `won` | Indicates that the dispute has been resolved in favor of the merchant. |\n| `lost` | Indicates that the dispute has been resolved against the merchant. |",
///  "type": "string",
///  "enum": [
///    "needs_response",
///    "under_review",
///    "won",
///    "lost"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DisputeState {
    #[serde(rename = "needs_response")]
    NeedsResponse,
    #[serde(rename = "under_review")]
    UnderReview,
    #[serde(rename = "won")]
    Won,
    #[serde(rename = "lost")]
    Lost,
}
impl ::std::fmt::Display for DisputeState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::NeedsResponse => f.write_str("needs_response"),
            Self::UnderReview => f.write_str("under_review"),
            Self::Won => f.write_str("won"),
            Self::Lost => f.write_str("lost"),
        }
    }
}
impl ::std::str::FromStr for DisputeState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "needs_response" => Ok(Self::NeedsResponse),
            "under_review" => Ok(Self::UnderReview),
            "won" => Ok(Self::Won),
            "lost" => Ok(Self::Lost),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DisputeState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DisputeState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DisputeState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Provides additional granularity about the dispute state.
///
/// It details the progression of the dispute process, showing the current stage or phase.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `new` | The dispute has been recently created and is in the initial phase, awaiting further processing. |
/// | `lost_expired` | The dispute has been lost due to expiration, likely because the merchant did not respond within the required timeframe. |
/// | `pre_arbitration` | The dispute is in the pre-arbitration phase, where preliminary evidence is being gathered before a formal arbitration process. |
/// | `won_pre_arbitration`| The merchant secured a win during the pre-arbitration phase based on the evidence provided. |
/// | `lost_pre_arbitration` | The dispute was lost during the pre-arbitration phase, indicating that the preliminary review did not favor the merchant. |
/// | `lost_accepted` | The loss has been accepted as final, implying that no further contestation is likely or needed. |
/// | `arbitration` | The dispute has escalated to the arbitration stage, where a neutral third party is reviewing the evidence. |
/// | `won_arbitration` | The merchant won the dispute during the arbitration process. |
/// | `lost_arbitration` | The merchant lost the dispute during the arbitration process. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Provides additional granularity about the dispute state.\n\nIt details the progression of the dispute process, showing the current stage or phase.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `new` | The dispute has been recently created and is in the initial phase, awaiting further processing. |\n| `lost_expired` | The dispute has been lost due to expiration, likely because the merchant did not respond within the required timeframe. |\n| `pre_arbitration` | The dispute is in the pre-arbitration phase, where preliminary evidence is being gathered before a formal arbitration process. |\n| `won_pre_arbitration`| The merchant secured a win during the pre-arbitration phase based on the evidence provided. |\n| `lost_pre_arbitration` | The dispute was lost during the pre-arbitration phase, indicating that the preliminary review did not favor the merchant. |\n| `lost_accepted` | The loss has been accepted as final, implying that no further contestation is likely or needed. |\n| `arbitration` | The dispute has escalated to the arbitration stage, where a neutral third party is reviewing the evidence. |\n| `won_arbitration` | The merchant won the dispute during the arbitration process. |\n| `lost_arbitration` | The merchant lost the dispute during the arbitration process. |",
///  "type": "string",
///  "enum": [
///    "arbitration",
///    "lost_accepted",
///    "lost_arbitration",
///    "lost_expired",
///    "lost_pre_arbitration",
///    "lost_representment",
///    "new",
///    "pre_arbitration",
///    "representment",
///    "won_arbitration",
///    "won_pre_arbitration",
///    "won_representment",
///    "won_reversal"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum DisputeSubstate {
    #[serde(rename = "arbitration")]
    Arbitration,
    #[serde(rename = "lost_accepted")]
    LostAccepted,
    #[serde(rename = "lost_arbitration")]
    LostArbitration,
    #[serde(rename = "lost_expired")]
    LostExpired,
    #[serde(rename = "lost_pre_arbitration")]
    LostPreArbitration,
    #[serde(rename = "lost_representment")]
    LostRepresentment,
    #[serde(rename = "new")]
    New,
    #[serde(rename = "pre_arbitration")]
    PreArbitration,
    #[serde(rename = "representment")]
    Representment,
    #[serde(rename = "won_arbitration")]
    WonArbitration,
    #[serde(rename = "won_pre_arbitration")]
    WonPreArbitration,
    #[serde(rename = "won_representment")]
    WonRepresentment,
    #[serde(rename = "won_reversal")]
    WonReversal,
}
impl ::std::fmt::Display for DisputeSubstate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Arbitration => f.write_str("arbitration"),
            Self::LostAccepted => f.write_str("lost_accepted"),
            Self::LostArbitration => f.write_str("lost_arbitration"),
            Self::LostExpired => f.write_str("lost_expired"),
            Self::LostPreArbitration => f.write_str("lost_pre_arbitration"),
            Self::LostRepresentment => f.write_str("lost_representment"),
            Self::New => f.write_str("new"),
            Self::PreArbitration => f.write_str("pre_arbitration"),
            Self::Representment => f.write_str("representment"),
            Self::WonArbitration => f.write_str("won_arbitration"),
            Self::WonPreArbitration => f.write_str("won_pre_arbitration"),
            Self::WonRepresentment => f.write_str("won_representment"),
            Self::WonReversal => f.write_str("won_reversal"),
        }
    }
}
impl ::std::str::FromStr for DisputeSubstate {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "arbitration" => Ok(Self::Arbitration),
            "lost_accepted" => Ok(Self::LostAccepted),
            "lost_arbitration" => Ok(Self::LostArbitration),
            "lost_expired" => Ok(Self::LostExpired),
            "lost_pre_arbitration" => Ok(Self::LostPreArbitration),
            "lost_representment" => Ok(Self::LostRepresentment),
            "new" => Ok(Self::New),
            "pre_arbitration" => Ok(Self::PreArbitration),
            "representment" => Ok(Self::Representment),
            "won_arbitration" => Ok(Self::WonArbitration),
            "won_pre_arbitration" => Ok(Self::WonPreArbitration),
            "won_representment" => Ok(Self::WonRepresentment),
            "won_reversal" => Ok(Self::WonReversal),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for DisputeSubstate {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DisputeSubstate {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DisputeSubstate {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///An array containing a list of disputes.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "An array containing a list of disputes.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Dispute"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Disputes(pub ::std::vec::Vec<Dispute>);
impl ::std::ops::Deref for Disputes {
    type Target = ::std::vec::Vec<Dispute>;
    fn deref(&self) -> &::std::vec::Vec<Dispute> {
        &self.0
    }
}
impl ::std::convert::From<Disputes> for ::std::vec::Vec<Dispute> {
    fn from(value: Disputes) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Dispute>> for Disputes {
    fn from(value: ::std::vec::Vec<Dispute>) -> Self {
        Self(value)
    }
}
///The email address of the customer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The email address of the customer.",
///  "type": "string",
///  "format": "email"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Email(pub ::std::string::String);
impl ::std::ops::Deref for Email {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Email> for ::std::string::String {
    fn from(value: Email) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for Email {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for Email {
    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 Email {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The enforce challenge mode. `automatic` is used by default.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `automatic` | The payments created for an order will have challenge requirement calculated by our fraud mechanisms. Not all payments will trigger a 3DS challenge. |
/// | `forced` | The payments created for an order will always require a 3DS challenge. Currently only supported for card payments. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The enforce challenge mode. `automatic` is used by default.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `automatic` | The payments created for an order will have challenge requirement calculated by our fraud mechanisms. Not all payments will trigger a 3DS challenge. |\n| `forced` | The payments created for an order will always require a 3DS challenge. Currently only supported for card payments. |",
///  "type": "string",
///  "enum": [
///    "automatic",
///    "forced"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum EnforceChallengeV2 {
    #[serde(rename = "automatic")]
    Automatic,
    #[serde(rename = "forced")]
    Forced,
}
impl ::std::fmt::Display for EnforceChallengeV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Automatic => f.write_str("automatic"),
            Self::Forced => f.write_str("forced"),
        }
    }
}
impl ::std::str::FromStr for EnforceChallengeV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "automatic" => Ok(Self::Automatic),
            "forced" => Ok(Self::Forced),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for EnforceChallengeV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EnforceChallengeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EnforceChallengeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Environment object, indicating in which environment the payment was made.
///
/// :::caution
/// Only required if `initiator: customer`.
/// :::
///
/// :::note
/// Only `browser` is available at the moment.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Environment object, indicating in which environment the payment was made.\n\n:::caution\nOnly required if `initiator: customer`.\n:::\n\n:::note\nOnly `browser` is available at the moment.\n:::",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Browser-Environment"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Environment(pub BrowserEnvironment);
impl ::std::ops::Deref for Environment {
    type Target = BrowserEnvironment;
    fn deref(&self) -> &BrowserEnvironment {
        &self.0
    }
}
impl ::std::convert::From<Environment> for BrowserEnvironment {
    fn from(value: Environment) -> Self {
        value.0
    }
}
impl ::std::convert::From<BrowserEnvironment> for Environment {
    fn from(value: BrowserEnvironment) -> Self {
        Self(value)
    }
}
///`Error`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Error",
///  "type": "object",
///  "required": [
///    "errorId",
///    "timestamp"
///  ],
///  "properties": {
///    "errorId": {
///      "description": "The ID of the error. You can share this ID with Revolut support for troubleshooting.",
///      "type": "string"
///    },
///    "timestamp": {
///      "description": "The date and time the error happened.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Error {
    ///The ID of the error. You can share this ID with Revolut support for troubleshooting.
    #[serde(rename = "errorId")]
    pub error_id: ::std::string::String,
    ///The date and time the error happened.
    pub timestamp: i64,
}
///`ErrorV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Error",
///  "type": "object",
///  "properties": {
///    "code": {
///      "description": "An identifier that can be used to determine what went wrong.\n\nError codes are not globally unique, but uniqueness is guaranteed within endpoints.",
///      "type": "string"
///    },
///    "message": {
///      "description": "Some human readable text describing what went wrong.",
///      "type": "string"
///    },
///    "timestamp": {
///      "description": "The [UNIX timestamp](https://www.unixtimestamp.com/) of the date and time the error happened.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ErrorV2 {
    /// An identifier that can be used to determine what went wrong.
    ///
    /// Error codes are not globally unique, but uniqueness is guaranteed within endpoints.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub code: ::std::option::Option<::std::string::String>,
    ///Some human readable text describing what went wrong.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub message: ::std::option::Option<::std::string::String>,
    ///The [UNIX timestamp](https://www.unixtimestamp.com/) of the date and time the error happened.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub timestamp: ::std::option::Option<i64>,
}
impl ::std::default::Default for ErrorV2 {
    fn default() -> Self {
        Self {
            code: Default::default(),
            message: Default::default(),
            timestamp: Default::default(),
        }
    }
}
///Object containing booking information about a specific event.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing booking information about a specific event. ",
///  "type": "object",
///  "properties": {
///    "category": {
///      "description": "The type of the event.",
///      "type": "string",
///      "enum": [
///        "concert",
///        "conference",
///        "convention",
///        "exhibition",
///        "festival",
///        "party",
///        "performance",
///        "other"
///      ]
///    },
///    "end_date": {
///      "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the event ends.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "location": {
///      "description": "The address of the event location.",
///      "type": "object",
///      "required": [
///        "city",
///        "country_code",
///        "postcode",
///        "street_line_1"
///      ],
///      "properties": {
///        "city": {
///          "description": "City of the address.",
///          "type": "string",
///          "maxLength": 100
///        },
///        "country_code": {
///          "description": "ISO 2-letter country code.",
///          "type": "string",
///          "maxLength": 2,
///          "minLength": 2,
///          "pattern": "^[A-Z]{2}$"
///        },
///        "postcode": {
///          "description": "Postal code of the address.",
///          "type": "string",
///          "maxLength": 100
///        },
///        "region": {
///          "description": "State or province of the address.",
///          "type": "string",
///          "maxLength": 100
///        },
///        "street_line_1": {
///          "description": "Primary address line.",
///          "type": "string",
///          "maxLength": 100
///        },
///        "street_line_2": {
///          "description": "Secondary address line, such as floor and apartment number.",
///          "type": "string",
///          "maxLength": 100
///        }
///      }
///    },
///    "market": {
///      "description": "Indicates the relationship between the ticket vendor and the event organiser. \n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `primary`       | The merchant is the organiser and primary distributor of the tickets. |\n| `secondary`     | The merchant is a reseller, only distributing the tickets. |",
///      "type": "string",
///      "enum": [
///        "primary",
///        "secondary"
///      ]
///    },
///    "name": {
///      "description": "The name of the event.",
///      "type": "string"
///    },
///    "start_date": {
///      "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the event starts.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "supplier": {
///      "description": "Legal name of the ticket vendor/event organiser.",
///      "type": "string"
///    },
///    "supplier_payment_date": {
///      "$ref": "#/components/schemas/Supplier-Payment-Date"
///    },
///    "tickets": {
///      "description": "A list of tickets associated with the booking.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Ticket"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Event {
    ///The type of the event.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub category: ::std::option::Option<EventCategory>,
    ///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the event ends.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub end_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location: ::std::option::Option<EventLocation>,
    /// Indicates the relationship between the ticket vendor and the event organiser.
    ///
    /// | Parameter value | Description |
    /// | --------------- | ----------- |
    /// | `primary`       | The merchant is the organiser and primary distributor of the tickets. |
    /// | `secondary`     | The merchant is a reseller, only distributing the tickets. |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub market: ::std::option::Option<EventMarket>,
    ///The name of the event.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
    ///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the event starts.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub start_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///Legal name of the ticket vendor/event organiser.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub supplier: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub supplier_payment_date: ::std::option::Option<SupplierPaymentDate>,
    ///A list of tickets associated with the booking.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub tickets: ::std::vec::Vec<Ticket>,
}
impl ::std::default::Default for Event {
    fn default() -> Self {
        Self {
            category: Default::default(),
            end_date: Default::default(),
            location: Default::default(),
            market: Default::default(),
            name: Default::default(),
            start_date: Default::default(),
            supplier: Default::default(),
            supplier_payment_date: Default::default(),
            tickets: Default::default(),
        }
    }
}
///The type of the event.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the event.",
///  "type": "string",
///  "enum": [
///    "concert",
///    "conference",
///    "convention",
///    "exhibition",
///    "festival",
///    "party",
///    "performance",
///    "other"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum EventCategory {
    #[serde(rename = "concert")]
    Concert,
    #[serde(rename = "conference")]
    Conference,
    #[serde(rename = "convention")]
    Convention,
    #[serde(rename = "exhibition")]
    Exhibition,
    #[serde(rename = "festival")]
    Festival,
    #[serde(rename = "party")]
    Party,
    #[serde(rename = "performance")]
    Performance,
    #[serde(rename = "other")]
    Other,
}
impl ::std::fmt::Display for EventCategory {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Concert => f.write_str("concert"),
            Self::Conference => f.write_str("conference"),
            Self::Convention => f.write_str("convention"),
            Self::Exhibition => f.write_str("exhibition"),
            Self::Festival => f.write_str("festival"),
            Self::Party => f.write_str("party"),
            Self::Performance => f.write_str("performance"),
            Self::Other => f.write_str("other"),
        }
    }
}
impl ::std::str::FromStr for EventCategory {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "concert" => Ok(Self::Concert),
            "conference" => Ok(Self::Conference),
            "convention" => Ok(Self::Convention),
            "exhibition" => Ok(Self::Exhibition),
            "festival" => Ok(Self::Festival),
            "party" => Ok(Self::Party),
            "performance" => Ok(Self::Performance),
            "other" => Ok(Self::Other),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for EventCategory {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventCategory {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventCategory {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The address of the event location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The address of the event location.",
///  "type": "object",
///  "required": [
///    "city",
///    "country_code",
///    "postcode",
///    "street_line_1"
///  ],
///  "properties": {
///    "city": {
///      "description": "City of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "ISO 2-letter country code.",
///      "type": "string",
///      "maxLength": 2,
///      "minLength": 2,
///      "pattern": "^[A-Z]{2}$"
///    },
///    "postcode": {
///      "description": "Postal code of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "State or province of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Primary address line.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Secondary address line, such as floor and apartment number.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EventLocation {
    ///City of the address.
    pub city: EventLocationCity,
    ///ISO 2-letter country code.
    pub country_code: EventLocationCountryCode,
    ///Postal code of the address.
    pub postcode: EventLocationPostcode,
    ///State or province of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<EventLocationRegion>,
    ///Primary address line.
    pub street_line_1: EventLocationStreetLine1,
    ///Secondary address line, such as floor and apartment number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<EventLocationStreetLine2>,
}
///City of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "City of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationCity(::std::string::String);
impl ::std::ops::Deref for EventLocationCity {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationCity> for ::std::string::String {
    fn from(value: EventLocationCity) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationCity {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for EventLocationCity {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationCity {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationCity {
    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 EventLocationCity {
    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())
            })
    }
}
///ISO 2-letter country code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "ISO 2-letter country code.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2,
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationCountryCode(::std::string::String);
impl ::std::ops::Deref for EventLocationCountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationCountryCode> for ::std::string::String {
    fn from(value: EventLocationCountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationCountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        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 EventLocationCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationCountryCode {
    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 EventLocationCountryCode {
    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())
            })
    }
}
///Postal code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Postal code of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationPostcode(::std::string::String);
impl ::std::ops::Deref for EventLocationPostcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationPostcode> for ::std::string::String {
    fn from(value: EventLocationPostcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationPostcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for EventLocationPostcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationPostcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationPostcode {
    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 EventLocationPostcode {
    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())
            })
    }
}
///State or province of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "State or province of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationRegion(::std::string::String);
impl ::std::ops::Deref for EventLocationRegion {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationRegion> for ::std::string::String {
    fn from(value: EventLocationRegion) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationRegion {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for EventLocationRegion {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationRegion {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationRegion {
    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 EventLocationRegion {
    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())
            })
    }
}
///Primary address line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Primary address line.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationStreetLine1(::std::string::String);
impl ::std::ops::Deref for EventLocationStreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationStreetLine1> for ::std::string::String {
    fn from(value: EventLocationStreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationStreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for EventLocationStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationStreetLine1 {
    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 EventLocationStreetLine1 {
    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())
            })
    }
}
///Secondary address line, such as floor and apartment number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Secondary address line, such as floor and apartment number.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct EventLocationStreetLine2(::std::string::String);
impl ::std::ops::Deref for EventLocationStreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<EventLocationStreetLine2> for ::std::string::String {
    fn from(value: EventLocationStreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for EventLocationStreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for EventLocationStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventLocationStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventLocationStreetLine2 {
    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 EventLocationStreetLine2 {
    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 relationship between the ticket vendor and the event organiser.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `primary`       | The merchant is the organiser and primary distributor of the tickets. |
/// | `secondary`     | The merchant is a reseller, only distributing the tickets. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates the relationship between the ticket vendor and the event organiser. \n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `primary`       | The merchant is the organiser and primary distributor of the tickets. |\n| `secondary`     | The merchant is a reseller, only distributing the tickets. |",
///  "type": "string",
///  "enum": [
///    "primary",
///    "secondary"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum EventMarket {
    #[serde(rename = "primary")]
    Primary,
    #[serde(rename = "secondary")]
    Secondary,
}
impl ::std::fmt::Display for EventMarket {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Primary => f.write_str("primary"),
            Self::Secondary => f.write_str("secondary"),
        }
    }
}
impl ::std::str::FromStr for EventMarket {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "primary" => Ok(Self::Primary),
            "secondary" => Ok(Self::Secondary),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for EventMarket {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for EventMarket {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for EventMarket {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Object containing booking information for a list of event tickets associated with the order.
///
/// :::info
/// These are the specific data field requirements for merchants who must provide event data. Note that these requirements can be extended on a case by case basis as decided by Revolut.
///
/// ```text
/// booking_id
/// events[].start_date
/// events[].end_date
/// events[].supplier
/// events[].tickets[].id
/// ```text
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing booking information for a list of event tickets associated with the order.\n\n:::info\nThese are the specific data field requirements for merchants who must provide event data. Note that these requirements can be extended on a case by case basis as decided by Revolut.\n\n```\nbooking_id\nevents[].start_date\nevents[].end_date\nevents[].supplier\nevents[].tickets[].id\n```\n:::",
///  "type": "object",
///  "required": [
///    "booking_id"
///  ],
///  "properties": {
///    "booking_id": {
///      "$ref": "#/components/schemas/Booking-Id"
///    },
///    "events": {
///      "description": "A list of events associated with the booking.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Event"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EventsV2 {
    pub booking_id: BookingId,
    ///A list of events associated with the booking.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub events: ::std::vec::Vec<Event>,
}
/// Automatic expiration period for pending orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// Orders in `pending` state will be automatically failed if they stay unpaid for longer than the period specified.
///
/// When the order expires, it transitions to the `failed` state and an `ORDER_FAILED` webhook event is triggered.
///
/// :::note
/// - This field can only be set during order creation and cannot be updated afterward.
/// - Must be between `PT1M` (1 minute) and `PT720H` (30 days).
/// - Cannot be a negative value.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Automatic expiration period for pending orders, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nOrders in `pending` state will be automatically failed if they stay unpaid for longer than the period specified.\n\nWhen the order expires, it transitions to the `failed` state and an `ORDER_FAILED` webhook event is triggered.\n\n:::note\n- This field can only be set during order creation and cannot be updated afterward.\n- Must be between `PT1M` (1 minute) and `PT720H` (30 days).\n- Cannot be a negative value.\n:::",
///  "type": "string",
///  "format": "duration"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ExpirePendingAfter(pub ::std::string::String);
impl ::std::ops::Deref for ExpirePendingAfter {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExpirePendingAfter> for ::std::string::String {
    fn from(value: ExpirePendingAfter) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ExpirePendingAfter {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ExpirePendingAfter {
    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 ExpirePendingAfter {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`Fee`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "amount": {
///      "description": "The amount of the payment fee (minor currency unit). For example, enter `7034` for €70.34 in the field.",
///      "type": "integer"
///    },
///    "currency": {
///      "description": "The currency of the payment fee. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///      "type": "string"
///    },
///    "type": {
///      "description": "The type of the order fee.",
///      "type": "string",
///      "enum": [
///        "fx",
///        "acquiring"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Fee {
    ///The amount of the payment fee (minor currency unit). For example, enter `7034` for €70.34 in the field.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<i64>,
    /// The currency of the payment fee. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
    ///
    /// :::info
    /// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<::std::string::String>,
    ///The type of the order fee.
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<FeeType>,
}
impl ::std::default::Default for Fee {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            currency: Default::default(),
            type_: Default::default(),
        }
    }
}
///The type of the order fee.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the order fee.",
///  "type": "string",
///  "enum": [
///    "fx",
///    "acquiring"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum FeeType {
    #[serde(rename = "fx")]
    Fx,
    #[serde(rename = "acquiring")]
    Acquiring,
}
impl ::std::fmt::Display for FeeType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Fx => f.write_str("fx"),
            Self::Acquiring => f.write_str("acquiring"),
        }
    }
}
impl ::std::str::FromStr for FeeType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "fx" => Ok(Self::Fx),
            "acquiring" => Ok(Self::Acquiring),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for FeeType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for FeeType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for FeeType {
    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 order fee.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the order fee.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Fee"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Fees(pub ::std::vec::Vec<Fee>);
impl ::std::ops::Deref for Fees {
    type Target = ::std::vec::Vec<Fee>;
    fn deref(&self) -> &::std::vec::Vec<Fee> {
        &self.0
    }
}
impl ::std::convert::From<Fees> for ::std::vec::Vec<Fee> {
    fn from(value: Fees) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Fee>> for Fees {
    fn from(value: ::std::vec::Vec<Fee>) -> Self {
        Self(value)
    }
}
/// A unique identifier for a payment method, always 44 characters long. This fingerprint can be used to uniquely identify various payment methods.
///
/// #### Fingerprint generation
///
/// | Payment method | Description |
/// | -------- | ----------- |
/// | **All payment methods** | A fingerprint is generated for all payment methods, including cards, Revolut Pay (card, account-to-account payments), Apple Pay, and Google Pay. |
/// | **Cards (Revolut Pay & Card Gateway)** | For cards, the fingerprint is based on the PAN. Cards processed via Revolut Pay and our card gateway will share the same fingerprint. Renewed cards (new expiry/CVV) retain the same fingerprint for efficient blocking. |
/// | **Apple Pay & Google Pay** | Since Apple Pay and Google Pay provide us Device PANs (DPAN), the fingerprint is based on the DPAN provided by Apple/Google, not the connected card's PAN. This means that a new DPAN (and fingerprint) is generated for cards in case they are re-added to the customer's digital wallet, or added to different devices. |
///
/// #### Detecting duplicate payment methods
///
/// Fingerprints are a valuable tool for detecting duplicate payment methods by identifying if a payment method has been seen before. This capability, in turn, helps in preventing various types of misuse (e.g., exploitation of free trials, or association with known problematic accounts, which can be a form of fraud). To effectively use fingerprints for this purpose, you will need to create and maintain your own lists (e.g., blocklists of known problematic fingerprints, allowlists for trusted customers, or tracking frequently used fingerprints).
///
/// The ideal way to utilise fingerprints is by combining them with a manual capture process. While automatic capture with subsequent refunds for problematic payments is possible, manual capture based on fingerprint validation is recommended.
///
/// During your manual capture workflow, after a payment was authorised:
///
///   - Check the fingerprint status by comparing it against your maintained lists and internal business rules.
///   - If you decide to proceed with the payment (e.g., the fingerprint is not on a blocklist, or matches a trusted customer's previous payment method): [Capture the order](https://developer.revolut.com/docs/merchant/capture-order).
///   - If you decide not to proceed with the payment (e.g., the fingerprint matches a known fraudulent fingerprint, or exhibits suspicious patterns): [Cancel the order](https://developer.revolut.com/docs/merchant/cancel-order).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A unique identifier for a payment method, always 44 characters long. This fingerprint can be used to uniquely identify various payment methods.\n\n#### Fingerprint generation\n\n| Payment method | Description |\n| -------- | ----------- |\n| **All payment methods** | A fingerprint is generated for all payment methods, including cards, Revolut Pay (card, account-to-account payments), Apple Pay, and Google Pay. |\n| **Cards (Revolut Pay & Card Gateway)** | For cards, the fingerprint is based on the PAN. Cards processed via Revolut Pay and our card gateway will share the same fingerprint. Renewed cards (new expiry/CVV) retain the same fingerprint for efficient blocking. |\n| **Apple Pay & Google Pay** | Since Apple Pay and Google Pay provide us Device PANs (DPAN), the fingerprint is based on the DPAN provided by Apple/Google, not the connected card's PAN. This means that a new DPAN (and fingerprint) is generated for cards in case they are re-added to the customer's digital wallet, or added to different devices. |\n\n#### Detecting duplicate payment methods\n\nFingerprints are a valuable tool for detecting duplicate payment methods by identifying if a payment method has been seen before. This capability, in turn, helps in preventing various types of misuse (e.g., exploitation of free trials, or association with known problematic accounts, which can be a form of fraud). To effectively use fingerprints for this purpose, you will need to create and maintain your own lists (e.g., blocklists of known problematic fingerprints, allowlists for trusted customers, or tracking frequently used fingerprints). \n\nThe ideal way to utilise fingerprints is by combining them with a manual capture process. While automatic capture with subsequent refunds for problematic payments is possible, manual capture based on fingerprint validation is recommended.\n\nDuring your manual capture workflow, after a payment was authorised:\n  \n  - Check the fingerprint status by comparing it against your maintained lists and internal business rules.\n  - If you decide to proceed with the payment (e.g., the fingerprint is not on a blocklist, or matches a trusted customer's previous payment method): [Capture the order](https://developer.revolut.com/docs/merchant/capture-order).\n  - If you decide not to proceed with the payment (e.g., the fingerprint matches a known fraudulent fingerprint, or exhibits suspicious patterns): [Cancel the order](https://developer.revolut.com/docs/merchant/cancel-order).",
///  "type": "string",
///  "maxLength": 44,
///  "minLength": 44
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Fingerprint(::std::string::String);
impl ::std::ops::Deref for Fingerprint {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Fingerprint> for ::std::string::String {
    fn from(value: Fingerprint) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for Fingerprint {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 44usize {
            return Err("longer than 44 characters".into());
        }
        if value.chars().count() < 44usize {
            return Err("shorter than 44 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for Fingerprint {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Fingerprint {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Fingerprint {
    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 Fingerprint {
    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 of the customer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The full name of the customer.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct FullName(pub ::std::string::String);
impl ::std::ops::Deref for FullName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<FullName> for ::std::string::String {
    fn from(value: FullName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for FullName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for FullName {
    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 FullName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Coordinates of the location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Coordinates of the location.",
///  "type": "object",
///  "required": [
///    "lat",
///    "lon"
///  ],
///  "properties": {
///    "lat": {
///      "description": "The latitude of the location, in decimal degrees.",
///      "type": "number",
///      "format": "double",
///      "maximum": 90.0,
///      "minimum": -90.0
///    },
///    "lon": {
///      "description": "To longitude of the location, in decimal degrees.",
///      "type": "number",
///      "format": "double",
///      "maximum": 180.0,
///      "minimum": -180.0
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GeoLocation {
    ///The latitude of the location, in decimal degrees.
    pub lat: f64,
    ///To longitude of the location, in decimal degrees.
    pub lon: f64,
}
///Object containing details of a card used via Google Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Google Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "arn": {
///      "$ref": "#/components/schemas/Arn"
///    },
///    "authorisation_code": {
///      "$ref": "#/components/schemas/Authorisation-Code"
///    },
///    "capture_deadline": {
///      "$ref": "#/components/schemas/Capture-Deadline"
///    },
///    "card_bin": {
///      "description": "The BIN of the card.",
///      "type": "string",
///      "maxLength": 6,
///      "minLength": 6
///    },
///    "card_brand": {
///      "description": "The type of the card.",
///      "type": "string",
///      "enum": [
///        "visa",
///        "mastercard",
///        "american_express"
///      ]
///    },
///    "card_country_code": {
///      "description": "The 2-letter country code of the country where the card was issued.",
///      "type": "string"
///    },
///    "card_expiry": {
///      "description": "The expiry date of the card in the format of MM/YY.",
///      "type": "string",
///      "format": "MM/YY"
///    },
///    "card_last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string",
///      "maxLength": 4,
///      "minLength": 4
///    },
///    "cardholder_name": {
///      "description": "The name of the cardholder.",
///      "type": "string"
///    },
///    "checks": {
///      "$ref": "#/components/schemas/Card-Checks-v2"
///    },
///    "fingerprint": {
///      "$ref": "#/components/schemas/Fingerprint"
///    },
///    "funding": {
///      "description": "The type of card funding.",
///      "type": "string",
///      "enum": [
///        "credit",
///        "debit",
///        "prepaid"
///      ]
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "network_transaction_id": {
///      "$ref": "#/components/schemas/Network-Transaction-Id"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GooglePay {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub arn: ::std::option::Option<Arn>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_code: ::std::option::Option<AuthorisationCode>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_deadline: ::std::option::Option<CaptureDeadline>,
    ///The BIN of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_bin: ::std::option::Option<GooglePayCardBin>,
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<GooglePayCardBrand>,
    ///The 2-letter country code of the country where the card was issued.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_country_code: ::std::option::Option<::std::string::String>,
    ///The expiry date of the card in the format of MM/YY.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_expiry: ::std::option::Option<::std::string::String>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<GooglePayCardLastFour>,
    ///The name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub checks: ::std::option::Option<CardChecksV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<Fingerprint>,
    ///The type of card funding.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub funding: ::std::option::Option<GooglePayFunding>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub network_transaction_id: ::std::option::Option<NetworkTransactionId>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///The BIN of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The BIN of the card.",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 6
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GooglePayCardBin(::std::string::String);
impl ::std::ops::Deref for GooglePayCardBin {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<GooglePayCardBin> for ::std::string::String {
    fn from(value: GooglePayCardBin) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for GooglePayCardBin {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 6usize {
            return Err("shorter than 6 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for GooglePayCardBin {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for GooglePayCardBin {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for GooglePayCardBin {
    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 GooglePayCardBin {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the card.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard",
///    "american_express"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum GooglePayCardBrand {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
    #[serde(rename = "american_express")]
    AmericanExpress,
}
impl ::std::fmt::Display for GooglePayCardBrand {
    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"),
            Self::AmericanExpress => f.write_str("american_express"),
        }
    }
}
impl ::std::str::FromStr for GooglePayCardBrand {
    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),
            "american_express" => Ok(Self::AmericanExpress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for GooglePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for GooglePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for GooglePayCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The last four digits of the card number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the card number.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GooglePayCardLastFour(::std::string::String);
impl ::std::ops::Deref for GooglePayCardLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<GooglePayCardLastFour> for ::std::string::String {
    fn from(value: GooglePayCardLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for GooglePayCardLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for GooglePayCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for GooglePayCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for GooglePayCardLastFour {
    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 GooglePayCardLastFour {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of card funding.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of card funding.",
///  "type": "string",
///  "enum": [
///    "credit",
///    "debit",
///    "prepaid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum GooglePayFunding {
    #[serde(rename = "credit")]
    Credit,
    #[serde(rename = "debit")]
    Debit,
    #[serde(rename = "prepaid")]
    Prepaid,
}
impl ::std::fmt::Display for GooglePayFunding {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("credit"),
            Self::Debit => f.write_str("debit"),
            Self::Prepaid => f.write_str("prepaid"),
        }
    }
}
impl ::std::str::FromStr for GooglePayFunding {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "credit" => Ok(Self::Credit),
            "debit" => Ok(Self::Debit),
            "prepaid" => Ok(Self::Prepaid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for GooglePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for GooglePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for GooglePayFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`Guest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "Guest's first name.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "Guest's last name.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Guest {
    ///Guest's first name.
    pub first_name: ::std::string::String,
    ///Guest's last name.
    pub last_name: ::std::string::String,
}
///List of guests associated with the booking.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "List of guests associated with the booking.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Guest"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Guests(pub ::std::vec::Vec<Guest>);
impl ::std::ops::Deref for Guests {
    type Target = ::std::vec::Vec<Guest>;
    fn deref(&self) -> &::std::vec::Vec<Guest> {
        &self.0
    }
}
impl ::std::convert::From<Guests> for ::std::vec::Vec<Guest> {
    fn from(value: Guests) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Guest>> for Guests {
    fn from(value: ::std::vec::Vec<Guest>) -> Self {
        Self(value)
    }
}
/// Permanent ID of of the IC++ fee related to a payout transaction.
///
/// This ID can be obtained from the `related_icpp_charge_id` column of a payout statement report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Permanent ID of of the IC++ fee related to a payout transaction.\n\nThis ID can be obtained from the `related_icpp_charge_id` column of a payout statement report.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct IcppChargeId(pub ::uuid::Uuid);
impl ::std::ops::Deref for IcppChargeId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<IcppChargeId> for ::uuid::Uuid {
    fn from(value: IcppChargeId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for IcppChargeId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for IcppChargeId {
    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 IcppChargeId {
    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 IcppChargeId {
    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 IcppChargeId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// URL to an image associated with the line item.
///
/// :::caution
/// Restrictions:
/// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
/// - URI scheme is required and must be either `http` or `https`
/// - URI host is required and cannot be `localhost` or an IP address
/// - Max length: `2000`
/// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "URL to an image associated with the line item.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///  "type": "string",
///  "format": "uri",
///  "maxLength": 2000,
///  "pattern": "^https?:\\/{2}.+/gi"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct ImageUrl(pub ::std::string::String);
impl ::std::ops::Deref for ImageUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ImageUrl> for ::std::string::String {
    fn from(value: ImageUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for ImageUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ImageUrl {
    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 ImageUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The new total amount to be authorised (in minor units, e.g., cents).
///
/// This should be the **full new amount**, not the increment value.
/// For example, if the current authorised amount is `500` and you want to add 100, pass `600`.
///
/// :::caution
/// - Must be greater than or equal to the current authorised amount (incrementing with same amount allowed to extend capture deadline for Mastercard)
/// - The sum of all increment amounts cannot exceed 5x the initial authorised amount (e.g., initial amount £100 allows up to £500 in total increments)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The new total amount to be authorised (in minor units, e.g., cents).\n\nThis should be the **full new amount**, not the increment value.\nFor example, if the current authorised amount is `500` and you want to add 100, pass `600`.\n\n:::caution\n- Must be greater than or equal to the current authorised amount (incrementing with same amount allowed to extend capture deadline for Mastercard)\n- The sum of all increment amounts cannot exceed 5x the initial authorised amount (e.g., initial amount £100 allows up to £500 in total increments)\n:::",
///  "type": "integer",
///  "minimum": 1.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct IncrementAmount(pub ::std::num::NonZeroU64);
impl ::std::ops::Deref for IncrementAmount {
    type Target = ::std::num::NonZeroU64;
    fn deref(&self) -> &::std::num::NonZeroU64 {
        &self.0
    }
}
impl ::std::convert::From<IncrementAmount> for ::std::num::NonZeroU64 {
    fn from(value: IncrementAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::num::NonZeroU64> for IncrementAmount {
    fn from(value: ::std::num::NonZeroU64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for IncrementAmount {
    type Err = <::std::num::NonZeroU64 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 IncrementAmount {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for IncrementAmount {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for IncrementAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// External reference for this incremental authorisation.
///
/// :::tip
/// Use your internal charge or invoice ID. This reference is returned in webhooks for easy matching to your system.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "External reference for this incremental authorisation.\n\n:::tip\nUse your internal charge or invoice ID. This reference is returned in webhooks for easy matching to your system.\n:::",
///  "type": "string",
///  "maxLength": 255
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct IncrementReference(::std::string::String);
impl ::std::ops::Deref for IncrementReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<IncrementReference> for ::std::string::String {
    fn from(value: IncrementReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for IncrementReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 255usize {
            return Err("longer than 255 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for IncrementReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for IncrementReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for IncrementReference {
    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 IncrementReference {
    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())
            })
    }
}
/// Represents a single incremental authorisation attempt on an order.
///
/// The `incremental_authorisations` array tracks all increment attempts (successful and failed) in chronological order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Represents a single incremental authorisation attempt on an order.\n\nThe `incremental_authorisations` array tracks all increment attempts (successful and failed) in chronological order.",
///  "type": "object",
///  "properties": {
///    "line_items": {
///      "description": "Line items associated with this increment (if provided).\n\n:::note\nIf the increment is successful, these line items will override the existing order line items.\n:::",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Line-Item"
///      }
///    },
///    "new_amount": {
///      "description": "The new total amount requested in this increment (in minor units).",
///      "type": "integer"
///    },
///    "old_amount": {
///      "description": "The previously authorised amount before this increment (in minor units).",
///      "type": "integer"
///    },
///    "reason": {
///      "description": "Reason why increment was declined or failed.\n\n:::note\nOnly present when `state` is `declined` or `failed`.\n:::",
///      "type": "string"
///    },
///    "reference": {
///      "$ref": "#/components/schemas/Increment-Reference"
///    },
///    "state": {
///      "description": "The state of this incremental authorization attempt.\n\n| State | Description |\n|-------|-------------|\n| `pending` | Increment registered in system, not yet submitted to card network |\n| `processing` | Increment is being processed by card network |\n| `authorised` | Increment was successfully authorised |\n| `declined` | Increment was declined by card issuer |\n| `failed` | Increment failed due to technical error (not an issuer decline) |",
///      "type": "string",
///      "enum": [
///        "pending",
///        "processing",
///        "authorised",
///        "declined",
///        "failed"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IncrementalAuthorisation {
    /// Line items associated with this increment (if provided).
    ///
    /// :::note
    /// If the increment is successful, these line items will override the existing order line items.
    /// :::
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub line_items: ::std::vec::Vec<LineItem>,
    ///The new total amount requested in this increment (in minor units).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub new_amount: ::std::option::Option<i64>,
    ///The previously authorised amount before this increment (in minor units).
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub old_amount: ::std::option::Option<i64>,
    /// Reason why increment was declined or failed.
    ///
    /// :::note
    /// Only present when `state` is `declined` or `failed`.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reason: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<IncrementReference>,
    /// The state of this incremental authorization attempt.
    ///
    /// | State | Description |
    /// |-------|-------------|
    /// | `pending` | Increment registered in system, not yet submitted to card network |
    /// | `processing` | Increment is being processed by card network |
    /// | `authorised` | Increment was successfully authorised |
    /// | `declined` | Increment was declined by card issuer |
    /// | `failed` | Increment failed due to technical error (not an issuer decline) |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<IncrementalAuthorisationState>,
}
impl ::std::default::Default for IncrementalAuthorisation {
    fn default() -> Self {
        Self {
            line_items: Default::default(),
            new_amount: Default::default(),
            old_amount: Default::default(),
            reason: Default::default(),
            reference: Default::default(),
            state: Default::default(),
        }
    }
}
///`IncrementalAuthorisationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "amount"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Increment-Amount"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    },
///    "reference": {
///      "$ref": "#/components/schemas/Increment-Reference"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IncrementalAuthorisationRequest {
    pub amount: IncrementAmount,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<IncrementReference>,
}
/// The state of this incremental authorization attempt.
///
/// | State | Description |
/// |-------|-------------|
/// | `pending` | Increment registered in system, not yet submitted to card network |
/// | `processing` | Increment is being processed by card network |
/// | `authorised` | Increment was successfully authorised |
/// | `declined` | Increment was declined by card issuer |
/// | `failed` | Increment failed due to technical error (not an issuer decline) |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of this incremental authorization attempt.\n\n| State | Description |\n|-------|-------------|\n| `pending` | Increment registered in system, not yet submitted to card network |\n| `processing` | Increment is being processed by card network |\n| `authorised` | Increment was successfully authorised |\n| `declined` | Increment was declined by card issuer |\n| `failed` | Increment failed due to technical error (not an issuer decline) |",
///  "type": "string",
///  "enum": [
///    "pending",
///    "processing",
///    "authorised",
///    "declined",
///    "failed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum IncrementalAuthorisationState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "authorised")]
    Authorised,
    #[serde(rename = "declined")]
    Declined,
    #[serde(rename = "failed")]
    Failed,
}
impl ::std::fmt::Display for IncrementalAuthorisationState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Processing => f.write_str("processing"),
            Self::Authorised => f.write_str("authorised"),
            Self::Declined => f.write_str("declined"),
            Self::Failed => f.write_str("failed"),
        }
    }
}
impl ::std::str::FromStr for IncrementalAuthorisationState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "processing" => Ok(Self::Processing),
            "authorised" => Ok(Self::Authorised),
            "declined" => Ok(Self::Declined),
            "failed" => Ok(Self::Failed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for IncrementalAuthorisationState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for IncrementalAuthorisationState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for IncrementalAuthorisationState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// History of incremental authorisation attempts for this order.
///
/// Only present for orders with `authorisation_type: pre_authorisation`.
///
/// Contains all increment attempts in chronological order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "History of incremental authorisation attempts for this order.\n\nOnly present for orders with `authorisation_type: pre_authorisation`.\n\nContains all increment attempts in chronological order.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Incremental-Authorisation"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct IncrementalAuthorisations(pub ::std::vec::Vec<IncrementalAuthorisation>);
impl ::std::ops::Deref for IncrementalAuthorisations {
    type Target = ::std::vec::Vec<IncrementalAuthorisation>;
    fn deref(&self) -> &::std::vec::Vec<IncrementalAuthorisation> {
        &self.0
    }
}
impl ::std::convert::From<IncrementalAuthorisations> for ::std::vec::Vec<IncrementalAuthorisation> {
    fn from(value: IncrementalAuthorisations) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<IncrementalAuthorisation>> for IncrementalAuthorisations {
    fn from(value: ::std::vec::Vec<IncrementalAuthorisation>) -> Self {
        Self(value)
    }
}
/// Object containing industry-specific information associated with the order.
///
/// You can provide data for one or multiple industries in a single order.
///
/// :::info
/// In the following cases, industry-specific info is required. Omitting this information may trigger additional scrutiny and risk mitigation actions by the Revolut risk team.
///
///   | Transaction type | Required for |
///   | ---------------- | ----------- |
///   | `airline`        | Airlines and Online Travel Agencies (OTAs). |
///   | `car_rental`     | Car Rental Merchants and Online Travel Agencies (OTAs). |
///   | `crypto`         | Crypto merchants. |
///   | `marketplace`    | Marketplace merchants. |
///   | `event`          | Event ticket sellers. |
///   | `lodging`        | Lodging providers. |
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing industry-specific information associated with the order.\n\nYou can provide data for one or multiple industries in a single order.\n\n:::info\nIn the following cases, industry-specific info is required. Omitting this information may trigger additional scrutiny and risk mitigation actions by the Revolut risk team.\n\n  | Transaction type | Required for |\n  | ---------------- | ----------- |\n  | `airline`        | Airlines and Online Travel Agencies (OTAs). |\n  | `car_rental`     | Car Rental Merchants and Online Travel Agencies (OTAs). |\n  | `crypto`         | Crypto merchants. |\n  | `marketplace`    | Marketplace merchants. |\n  | `event`          | Event ticket sellers. |\n  | `lodging`        | Lodging providers. |\n:::",
///  "type": "object",
///  "properties": {
///    "airline": {
///      "$ref": "#/components/schemas/Airline-Data-v2"
///    },
///    "car_rental": {
///      "$ref": "#/components/schemas/Car-Rental-v2"
///    },
///    "crypto": {
///      "$ref": "#/components/schemas/Crypto-Transactions-v3"
///    },
///    "event": {
///      "$ref": "#/components/schemas/Events-v2"
///    },
///    "lodging": {
///      "$ref": "#/components/schemas/Lodging-v3"
///    },
///    "marketplace": {
///      "$ref": "#/components/schemas/Marketplace-v3"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IndustryDataV3 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub airline: ::std::option::Option<AirlineDataV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub car_rental: ::std::option::Option<CarRentalV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub crypto: ::std::option::Option<CryptoTransactionsV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub event: ::std::option::Option<EventsV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub lodging: ::std::option::Option<LodgingV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub marketplace: ::std::option::Option<MarketplaceV3>,
}
impl ::std::default::Default for IndustryDataV3 {
    fn default() -> Self {
        Self {
            airline: Default::default(),
            car_rental: Default::default(),
            crypto: Default::default(),
            event: Default::default(),
            lodging: Default::default(),
            marketplace: Default::default(),
        }
    }
}
///`JourneyLeg`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "airline_code",
///    "airline_name",
///    "arrival_airport_code",
///    "departure_airport_code",
///    "sequence",
///    "travel_date"
///  ],
///  "properties": {
///    "airline_code": {
///      "description": "The IATA 2-letter accounting code identifying the airline associated with the journey leg.",
///      "type": "string"
///    },
///    "airline_name": {
///      "description": "The name of the airline associated with the journey leg.",
///      "type": "string"
///    },
///    "arrival_airport_code": {
///      "description": "The [IATA](https://www.iata.org/en/services/codes) 3-letter airport code for the arrival airport.",
///      "type": "string"
///    },
///    "departure_airport_code": {
///      "description": "The [IATA](https://www.iata.org/en/services/codes) 3-letter airport code for the departure airport.",
///      "type": "string"
///    },
///    "fare_base_code": {
///      "description": "The fare base code for the given journey leg.",
///      "type": "string"
///    },
///    "flight_number": {
///      "description": "The flight identifier, without airline code.",
///      "type": "string"
///    },
///    "pnr": {
///      "description": "The Passenger Name Record (PNR) for the journey leg issued by the airline. \n\nPNR is a unique identifier for the booking, acting as a digital certificate allowing passengers to retrieve or manage their booking details.\n\n:::caution\nThis is a required field for OTAs.\n:::",
///      "type": "string",
///      "format": "alphanumeric",
///      "maxLength": 20,
///      "pattern": "^[a-zA-Z0-9]*$"
///    },
///    "sequence": {
///      "description": "Sequence of the journey legs. Increment by 1 for each flight included in the ticket.\n\nFor example: For a `FRA > LHR > DUB > LHR > FRA` journey the sequence will be assigned as:\n  - `FRA > LHR`: 1\n  - `LHR > DUB`: 2\n  - `DUB > LHR`: 3\n  - `LHR > FRA`: 4",
///      "type": "integer"
///    },
///    "travel_date": {
///      "description": "The UTC date and time of the flight departure for the given journey leg.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JourneyLeg {
    ///The IATA 2-letter accounting code identifying the airline associated with the journey leg.
    pub airline_code: ::std::string::String,
    ///The name of the airline associated with the journey leg.
    pub airline_name: ::std::string::String,
    ///The [IATA](https://www.iata.org/en/services/codes) 3-letter airport code for the arrival airport.
    pub arrival_airport_code: ::std::string::String,
    ///The [IATA](https://www.iata.org/en/services/codes) 3-letter airport code for the departure airport.
    pub departure_airport_code: ::std::string::String,
    ///The fare base code for the given journey leg.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fare_base_code: ::std::option::Option<::std::string::String>,
    ///The flight identifier, without airline code.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub flight_number: ::std::option::Option<::std::string::String>,
    /// The Passenger Name Record (PNR) for the journey leg issued by the airline.
    ///
    /// PNR is a unique identifier for the booking, acting as a digital certificate allowing passengers to retrieve or manage their booking details.
    ///
    /// :::caution
    /// This is a required field for OTAs.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub pnr: ::std::option::Option<::std::string::String>,
    /// Sequence of the journey legs. Increment by 1 for each flight included in the ticket.
    ///
    /// For example: For a `FRA > LHR > DUB > LHR > FRA` journey the sequence will be assigned as:
    ///   - `FRA > LHR`: 1
    ///   - `LHR > DUB`: 2
    ///   - `DUB > LHR`: 3
    ///   - `LHR > FRA`: 4
    pub sequence: i64,
    ///The UTC date and time of the flight departure for the given journey leg.
    pub travel_date: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// Array containing information of journey legs associated with the booking.
///
/// :::info
/// This field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app.
///
/// This information is used to compile a tracking widget that provides real-time updates on flight status and sends notifications, such as a check-in reminders, boarding alerts, and notifications for cancellations or delays.
///
/// To enable the widget the following fields are required on order creation or update, before capturing the order:
///
///   ```text
///   sequence,
///   departure_airport_code,
///   arrival_airport_code,
///   flight_number,
///   travel_date,
///   airline_name,
///   airline_code,
///   ```text
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Array containing information of journey legs associated with the booking.\n\n:::info\nThis field is required for activating **Revolut Flight Alerts** functionalities within the Revolut app. \n\nThis information is used to compile a tracking widget that provides real-time updates on flight status and sends notifications, such as a check-in reminders, boarding alerts, and notifications for cancellations or delays. \n\nTo enable the widget the following fields are required on order creation or update, before capturing the order:\n\n  ```\n  sequence,\n  departure_airport_code,\n  arrival_airport_code,\n  flight_number,\n  travel_date,\n  airline_name,\n  airline_code,\n  ```\n:::",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Journey-Leg"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct JourneyLegs(pub ::std::vec::Vec<JourneyLeg>);
impl ::std::ops::Deref for JourneyLegs {
    type Target = ::std::vec::Vec<JourneyLeg>;
    fn deref(&self) -> &::std::vec::Vec<JourneyLeg> {
        &self.0
    }
}
impl ::std::convert::From<JourneyLegs> for ::std::vec::Vec<JourneyLeg> {
    fn from(value: JourneyLegs) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<JourneyLeg>> for JourneyLegs {
    fn from(value: ::std::vec::Vec<JourneyLeg>) -> Self {
        Self(value)
    }
}
///`LineItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "name",
///    "quantity",
///    "total_amount",
///    "type",
///    "unit_price_amount"
///  ],
///  "properties": {
///    "description": {
///      "description": "Description of the line item.",
///      "type": "string",
///      "maxLength": 1024
///    },
///    "discounts": {
///      "description": "A list of discounts applied to the line item. Each discount should be subtracted from the total amount payable for the item.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Discount"
///      },
///      "maxItems": 50
///    },
///    "external_id": {
///      "description": "Unique identifier of line item in the merchant's system.",
///      "type": "string",
///      "maxLength": 250
///    },
///    "image_urls": {
///      "description": "A list of URLs pointing to images related to the line item. These images can provide visual details or representations of the item.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Image-Url"
///      },
///      "maxItems": 50
///    },
///    "name": {
///      "description": "Name of the line item.",
///      "type": "string",
///      "maxLength": 250
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Quantity"
///    },
///    "taxes": {
///      "description": "A list of taxes applied to the line item. Each tax should be added to the total amount payable for the item.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Tax"
///      },
///      "maxItems": 50
///    },
///    "total_amount": {
///      "description": "The total amount to be paid for the line item, including taxes and discounts.",
///      "type": "integer",
///      "format": "int64"
///    },
///    "type": {
///      "description": "Type of the line item.",
///      "type": "string",
///      "enum": [
///        "physical",
///        "service"
///      ]
///    },
///    "unit_price_amount": {
///      "description": "The unit price of the line item.",
///      "type": "integer",
///      "format": "int64",
///      "minimum": 0.0
///    },
///    "url": {
///      "description": "An HTTP/HTTPS URL that links to more information about the line item, such as a product page or details.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 2000,
///      "pattern": "^https?:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LineItem {
    ///Description of the line item.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<LineItemDescription>,
    ///A list of discounts applied to the line item. Each discount should be subtracted from the total amount payable for the item.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub discounts: ::std::vec::Vec<Discount>,
    ///Unique identifier of line item in the merchant's system.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub external_id: ::std::option::Option<LineItemExternalId>,
    ///A list of URLs pointing to images related to the line item. These images can provide visual details or representations of the item.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub image_urls: ::std::vec::Vec<ImageUrl>,
    ///Name of the line item.
    pub name: LineItemName,
    pub quantity: Quantity,
    ///A list of taxes applied to the line item. Each tax should be added to the total amount payable for the item.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub taxes: ::std::vec::Vec<Tax>,
    ///The total amount to be paid for the line item, including taxes and discounts.
    pub total_amount: i64,
    ///Type of the line item.
    #[serde(rename = "type")]
    pub type_: LineItemType,
    ///The unit price of the line item.
    pub unit_price_amount: i64,
    /// An HTTP/HTTPS URL that links to more information about the line item, such as a product page or details.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be either `http` or `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `2000`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<::std::string::String>,
}
///Description of the line item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Description of the line item.",
///  "type": "string",
///  "maxLength": 1024
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LineItemDescription(::std::string::String);
impl ::std::ops::Deref for LineItemDescription {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LineItemDescription> for ::std::string::String {
    fn from(value: LineItemDescription) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LineItemDescription {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 1024usize {
            return Err("longer than 1024 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LineItemDescription {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LineItemDescription {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LineItemDescription {
    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 LineItemDescription {
    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())
            })
    }
}
///Unique identifier of line item in the merchant's system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier of line item in the merchant's system.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LineItemExternalId(::std::string::String);
impl ::std::ops::Deref for LineItemExternalId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LineItemExternalId> for ::std::string::String {
    fn from(value: LineItemExternalId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LineItemExternalId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LineItemExternalId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LineItemExternalId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LineItemExternalId {
    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 LineItemExternalId {
    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())
            })
    }
}
///Name of the line item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Name of the line item.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LineItemName(::std::string::String);
impl ::std::ops::Deref for LineItemName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LineItemName> for ::std::string::String {
    fn from(value: LineItemName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LineItemName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LineItemName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LineItemName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LineItemName {
    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 LineItemName {
    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())
            })
    }
}
///Type of the line item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of the line item.",
///  "type": "string",
///  "enum": [
///    "physical",
///    "service"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum LineItemType {
    #[serde(rename = "physical")]
    Physical,
    #[serde(rename = "service")]
    Service,
}
impl ::std::fmt::Display for LineItemType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Physical => f.write_str("physical"),
            Self::Service => f.write_str("service"),
        }
    }
}
impl ::std::str::FromStr for LineItemType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "physical" => Ok(Self::Physical),
            "service" => Ok(Self::Service),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for LineItemType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LineItemType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LineItemType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// An array of line items included in the order. Each line item represents an individual product or service, along with its quantity, price, taxes, and discounts.
///
/// :::info
/// Required for merchants collecting payment for one or multiple products/services in one transaction. Omitting this information may trigger additional scrutiny and risk mitigation actions by Revolut.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "An array of line items included in the order. Each line item represents an individual product or service, along with its quantity, price, taxes, and discounts.\n\n:::info\nRequired for merchants collecting payment for one or multiple products/services in one transaction. Omitting this information may trigger additional scrutiny and risk mitigation actions by Revolut.\n:::",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Line-Item"
///  },
///  "maxItems": 250
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LineItems(pub ::std::vec::Vec<LineItem>);
impl ::std::ops::Deref for LineItems {
    type Target = ::std::vec::Vec<LineItem>;
    fn deref(&self) -> &::std::vec::Vec<LineItem> {
        &self.0
    }
}
impl ::std::convert::From<LineItems> for ::std::vec::Vec<LineItem> {
    fn from(value: LineItems) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<LineItem>> for LineItems {
    fn from(value: ::std::vec::Vec<LineItem>) -> Self {
        Self(value)
    }
}
///Location object represents merchant locations depending on type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Location",
///  "description": "Location object represents merchant locations depending on type.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Location-Online"
///    },
///    {
///      "$ref": "#/components/schemas/Location-Physical"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum Location {
    Online(LocationOnline),
    Physical(LocationPhysical),
}
impl ::std::convert::From<LocationOnline> for Location {
    fn from(value: LocationOnline) -> Self {
        Self::Online(value)
    }
}
impl ::std::convert::From<LocationPhysical> for Location {
    fn from(value: LocationPhysical) -> Self {
        Self::Physical(value)
    }
}
///Request body for creating a location. The structure of the `details` object depends on the `type` of the location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Request body for creating a location. The structure of the `details` object depends on the `type` of the location.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Location-Creation-Online"
///    },
///    {
///      "$ref": "#/components/schemas/Location-Creation-Physical"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum LocationCreation {
    Online(LocationCreationOnline),
    Physical(LocationCreationPhysical),
}
impl ::std::convert::From<LocationCreationOnline> for LocationCreation {
    fn from(value: LocationCreationOnline) -> Self {
        Self::Online(value)
    }
}
impl ::std::convert::From<LocationCreationPhysical> for LocationCreation {
    fn from(value: LocationCreationPhysical) -> Self {
        Self::Physical(value)
    }
}
///`LocationCreationOnline`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "details",
///    "name",
///    "type"
///  ],
///  "properties": {
///    "details": {
///      "$ref": "#/components/schemas/Location-Online-Details"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Location-Name"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Location-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationCreationOnline {
    pub details: LocationOnlineDetails,
    pub name: LocationName,
    #[serde(rename = "type")]
    pub type_: LocationType,
}
///`LocationCreationPhysical`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "details",
///    "name",
///    "type"
///  ],
///  "properties": {
///    "details": {
///      "$ref": "#/components/schemas/Location-Physical-Details"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Location-Name"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Location-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationCreationPhysical {
    pub details: LocationPhysicalDetails,
    pub name: LocationName,
    #[serde(rename = "type")]
    pub type_: LocationType,
}
/// Unique ID representing the location where merchants sells products.
///
/// :::info
/// For more information, see: [Locations](https://developer.revolut.com/docs/merchant/locations).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique ID representing the location where merchants sells products.\n\n:::info\nFor more information, see: [Locations](https://developer.revolut.com/docs/merchant/locations).\n:::        ",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LocationId(pub ::uuid::Uuid);
impl ::std::ops::Deref for LocationId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<LocationId> for ::uuid::Uuid {
    fn from(value: LocationId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for LocationId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for LocationId {
    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 LocationId {
    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 LocationId {
    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 LocationId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Name of the location.
///
/// :::caution
/// The `name` parameter's value must be unique across all locations.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Name of the location. \n\n:::caution\nThe `name` parameter's value must be unique across all locations.\n:::",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct LocationName(pub ::std::string::String);
impl ::std::ops::Deref for LocationName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LocationName> for ::std::string::String {
    fn from(value: LocationName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for LocationName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for LocationName {
    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 LocationName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`LocationOnline`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "details",
///    "id",
///    "name",
///    "type"
///  ],
///  "properties": {
///    "details": {
///      "$ref": "#/components/schemas/Location-Online-Details"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Location-Name"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Location-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationOnline {
    pub details: LocationOnlineDetails,
    pub id: LocationId,
    pub name: LocationName,
    #[serde(rename = "type")]
    pub type_: LocationType,
}
///Additional details of the location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional details of the location.",
///  "type": "object",
///  "required": [
///    "domain"
///  ],
///  "properties": {
///    "domain": {
///      "description": "Domain address of the location. Required for online locations.\n\n:::caution\nThe `domain` parameter's value must be unique across all locations.\n:::",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationOnlineDetails {
    /// Domain address of the location. Required for online locations.
    ///
    /// :::caution
    /// The `domain` parameter's value must be unique across all locations.
    /// :::
    pub domain: ::std::string::String,
}
///`LocationPhysical`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Location",
///  "type": "object",
///  "required": [
///    "details",
///    "id",
///    "name",
///    "type"
///  ],
///  "properties": {
///    "details": {
///      "$ref": "#/components/schemas/Location-Physical-Details"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Location-Name"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Location-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationPhysical {
    pub details: LocationPhysicalDetails,
    pub id: LocationId,
    pub name: LocationName,
    #[serde(rename = "type")]
    pub type_: LocationType,
}
///Additional details of the location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional details of the location.",
///  "type": "object",
///  "required": [
///    "address",
///    "geo_location",
///    "opening_hours"
///  ],
///  "properties": {
///    "address": {
///      "$ref": "#/components/schemas/Address-v3"
///    },
///    "geo_location": {
///      "$ref": "#/components/schemas/Geo-Location"
///    },
///    "opening_hours": {
///      "$ref": "#/components/schemas/Opening-Hours"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationPhysicalDetails {
    pub address: AddressV3,
    pub geo_location: GeoLocation,
    pub opening_hours: OpeningHours,
}
/// Type of the location.
///
/// | Value | Description |
/// | ----- | ----------- |
/// | `online` | Represents an online store. |
/// | `physical` | Represents a physical point of sale. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of the location.\n\n| Value | Description |\n| ----- | ----------- |\n| `online` | Represents an online store. |\n| `physical` | Represents a physical point of sale. |",
///  "type": "string",
///  "enum": [
///    "online",
///    "physical"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum LocationType {
    #[serde(rename = "online")]
    Online,
    #[serde(rename = "physical")]
    Physical,
}
impl ::std::fmt::Display for LocationType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Online => f.write_str("online"),
            Self::Physical => f.write_str("physical"),
        }
    }
}
impl ::std::str::FromStr for LocationType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "online" => Ok(Self::Online),
            "physical" => Ok(Self::Physical),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for LocationType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LocationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LocationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Request body for updating a location. The structure of the `details` object depends on the `type` of the location.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Request body for updating a location. The structure of the `details` object depends on the `type` of the location.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Location-Update-Online"
///    },
///    {
///      "$ref": "#/components/schemas/Location-Update-Physical"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum LocationUpdate {
    Online(LocationUpdateOnline),
    Physical(LocationUpdatePhysical),
}
impl ::std::convert::From<LocationUpdateOnline> for LocationUpdate {
    fn from(value: LocationUpdateOnline) -> Self {
        Self::Online(value)
    }
}
impl ::std::convert::From<LocationUpdatePhysical> for LocationUpdate {
    fn from(value: LocationUpdatePhysical) -> Self {
        Self::Physical(value)
    }
}
///`LocationUpdateOnline`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "details": {
///      "$ref": "#/components/schemas/Location-Online-Details"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Location-Name"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationUpdateOnline {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub details: ::std::option::Option<LocationOnlineDetails>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<LocationName>,
}
impl ::std::default::Default for LocationUpdateOnline {
    fn default() -> Self {
        Self {
            details: Default::default(),
            name: Default::default(),
        }
    }
}
///Location object represents merchant locations depending on type.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Location",
///  "description": "Location object represents merchant locations depending on type.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Location-Online"
///    },
///    {
///      "$ref": "#/components/schemas/Location-Physical"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum LocationUpdatePhysical {
    Online(LocationOnline),
    Physical(LocationPhysical),
}
impl ::std::convert::From<LocationOnline> for LocationUpdatePhysical {
    fn from(value: LocationOnline) -> Self {
        Self::Online(value)
    }
}
impl ::std::convert::From<LocationPhysical> for LocationUpdatePhysical {
    fn from(value: LocationPhysical) -> Self {
        Self::Physical(value)
    }
}
/// Indicates whether the booking terms are fixed or flexible.
///
/// | Parameter value | Description |
/// | --------------- | ----------- |
/// | `fixed`         | Non-modifiable once confirmed. |
/// | `flexible`      | Allows modifications or cancellations under specified conditions.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the booking terms are fixed or flexible.\n\n| Parameter value | Description |\n| --------------- | ----------- |\n| `fixed`         | Non-modifiable once confirmed. |\n| `flexible`      | Allows modifications or cancellations under specified conditions.",
///  "type": "string",
///  "enum": [
///    "fixed",
///    "flexible"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum LodgingBookingType {
    #[serde(rename = "fixed")]
    Fixed,
    #[serde(rename = "flexible")]
    Flexible,
}
impl ::std::fmt::Display for LodgingBookingType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Fixed => f.write_str("fixed"),
            Self::Flexible => f.write_str("flexible"),
        }
    }
}
impl ::std::str::FromStr for LodgingBookingType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "fixed" => Ok(Self::Fixed),
            "flexible" => Ok(Self::Flexible),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for LodgingBookingType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingBookingType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingBookingType {
    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 accommodation associated with the booking.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the accommodation associated with the booking.",
///  "type": "string",
///  "enum": [
///    "bed_and_breakfast",
///    "hostel",
///    "hotel",
///    "short_term_rental",
///    "other"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum LodgingCategory {
    #[serde(rename = "bed_and_breakfast")]
    BedAndBreakfast,
    #[serde(rename = "hostel")]
    Hostel,
    #[serde(rename = "hotel")]
    Hotel,
    #[serde(rename = "short_term_rental")]
    ShortTermRental,
    #[serde(rename = "other")]
    Other,
}
impl ::std::fmt::Display for LodgingCategory {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::BedAndBreakfast => f.write_str("bed_and_breakfast"),
            Self::Hostel => f.write_str("hostel"),
            Self::Hotel => f.write_str("hotel"),
            Self::ShortTermRental => f.write_str("short_term_rental"),
            Self::Other => f.write_str("other"),
        }
    }
}
impl ::std::str::FromStr for LodgingCategory {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "bed_and_breakfast" => Ok(Self::BedAndBreakfast),
            "hostel" => Ok(Self::Hostel),
            "hotel" => Ok(Self::Hotel),
            "short_term_rental" => Ok(Self::ShortTermRental),
            "other" => Ok(Self::Other),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for LodgingCategory {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingCategory {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingCategory {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time of the check-in.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time of the check-in.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LodgingCheckInDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for LodgingCheckInDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<LodgingCheckInDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: LodgingCheckInDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for LodgingCheckInDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for LodgingCheckInDate {
    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 LodgingCheckInDate {
    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 LodgingCheckInDate {
    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 LodgingCheckInDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time of the check-out.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time of the check-out.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LodgingCheckOutDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for LodgingCheckOutDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<LodgingCheckOutDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: LodgingCheckOutDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for LodgingCheckOutDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for LodgingCheckOutDate {
    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 LodgingCheckOutDate {
    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 LodgingCheckOutDate {
    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 LodgingCheckOutDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Object containing details of an individual lodging entry.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of an individual lodging entry.",
///  "type": "object",
///  "properties": {
///    "booking_type": {
///      "$ref": "#/components/schemas/Lodging-Booking-Type"
///    },
///    "category": {
///      "$ref": "#/components/schemas/Lodging-Category"
///    },
///    "check_in_date": {
///      "$ref": "#/components/schemas/Lodging-Check-In-Date"
///    },
///    "check_out_date": {
///      "$ref": "#/components/schemas/Lodging-Check-Out-Date"
///    },
///    "guests": {
///      "$ref": "#/components/schemas/Guests"
///    },
///    "location": {
///      "$ref": "#/components/schemas/Lodging-Location"
///    },
///    "refundability": {
///      "$ref": "#/components/schemas/Refundability"
///    },
///    "supplier": {
///      "$ref": "#/components/schemas/Lodging-Supplier"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LodgingItem {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub booking_type: ::std::option::Option<LodgingBookingType>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub category: ::std::option::Option<LodgingCategory>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub check_in_date: ::std::option::Option<LodgingCheckInDate>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub check_out_date: ::std::option::Option<LodgingCheckOutDate>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub guests: ::std::option::Option<Guests>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location: ::std::option::Option<LodgingLocation>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub refundability: ::std::option::Option<Refundability>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub supplier: ::std::option::Option<LodgingSupplier>,
}
impl ::std::default::Default for LodgingItem {
    fn default() -> Self {
        Self {
            booking_type: Default::default(),
            category: Default::default(),
            check_in_date: Default::default(),
            check_out_date: Default::default(),
            guests: Default::default(),
            location: Default::default(),
            refundability: Default::default(),
            supplier: Default::default(),
        }
    }
}
///Address of the accommodation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Address of the accommodation.",
///  "type": "object",
///  "required": [
///    "city",
///    "country_code",
///    "postcode",
///    "street_line_1"
///  ],
///  "properties": {
///    "city": {
///      "description": "City of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "country_code": {
///      "description": "ISO 2-letter country code.",
///      "type": "string",
///      "maxLength": 2,
///      "minLength": 2,
///      "pattern": "^[A-Z]{2}$"
///    },
///    "postcode": {
///      "description": "Postal code of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "region": {
///      "description": "State or province of the address.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_1": {
///      "description": "Primary address line.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "street_line_2": {
///      "description": "Secondary address line, such as floor and apartment number.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LodgingLocation {
    ///City of the address.
    pub city: LodgingLocationCity,
    ///ISO 2-letter country code.
    pub country_code: LodgingLocationCountryCode,
    ///Postal code of the address.
    pub postcode: LodgingLocationPostcode,
    ///State or province of the address.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub region: ::std::option::Option<LodgingLocationRegion>,
    ///Primary address line.
    pub street_line_1: LodgingLocationStreetLine1,
    ///Secondary address line, such as floor and apartment number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub street_line_2: ::std::option::Option<LodgingLocationStreetLine2>,
}
///City of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "City of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationCity(::std::string::String);
impl ::std::ops::Deref for LodgingLocationCity {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationCity> for ::std::string::String {
    fn from(value: LodgingLocationCity) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationCity {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LodgingLocationCity {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationCity {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationCity {
    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 LodgingLocationCity {
    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())
            })
    }
}
///ISO 2-letter country code.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "ISO 2-letter country code.",
///  "type": "string",
///  "maxLength": 2,
///  "minLength": 2,
///  "pattern": "^[A-Z]{2}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationCountryCode(::std::string::String);
impl ::std::ops::Deref for LodgingLocationCountryCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationCountryCode> for ::std::string::String {
    fn from(value: LodgingLocationCountryCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationCountryCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 2usize {
            return Err("longer than 2 characters".into());
        }
        if value.chars().count() < 2usize {
            return Err("shorter than 2 characters".into());
        }
        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 LodgingLocationCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationCountryCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationCountryCode {
    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 LodgingLocationCountryCode {
    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())
            })
    }
}
///Postal code of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Postal code of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationPostcode(::std::string::String);
impl ::std::ops::Deref for LodgingLocationPostcode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationPostcode> for ::std::string::String {
    fn from(value: LodgingLocationPostcode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationPostcode {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LodgingLocationPostcode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationPostcode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationPostcode {
    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 LodgingLocationPostcode {
    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())
            })
    }
}
///State or province of the address.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "State or province of the address.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationRegion(::std::string::String);
impl ::std::ops::Deref for LodgingLocationRegion {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationRegion> for ::std::string::String {
    fn from(value: LodgingLocationRegion) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationRegion {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LodgingLocationRegion {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationRegion {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationRegion {
    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 LodgingLocationRegion {
    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())
            })
    }
}
///Primary address line.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Primary address line.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationStreetLine1(::std::string::String);
impl ::std::ops::Deref for LodgingLocationStreetLine1 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationStreetLine1> for ::std::string::String {
    fn from(value: LodgingLocationStreetLine1) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationStreetLine1 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LodgingLocationStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationStreetLine1 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationStreetLine1 {
    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 LodgingLocationStreetLine1 {
    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())
            })
    }
}
///Secondary address line, such as floor and apartment number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Secondary address line, such as floor and apartment number.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct LodgingLocationStreetLine2(::std::string::String);
impl ::std::ops::Deref for LodgingLocationStreetLine2 {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<LodgingLocationStreetLine2> for ::std::string::String {
    fn from(value: LodgingLocationStreetLine2) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for LodgingLocationStreetLine2 {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for LodgingLocationStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for LodgingLocationStreetLine2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for LodgingLocationStreetLine2 {
    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 LodgingLocationStreetLine2 {
    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())
            })
    }
}
///Object containing supplier information about the lodging provider.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing supplier information about the lodging provider.",
///  "type": "object",
///  "properties": {
///    "id": {
///      "description": "Unique identifier of the lodging supplier.",
///      "type": "string"
///    },
///    "name": {
///      "description": "Legal name of the lodging supplier.",
///      "type": "string"
///    },
///    "payment_date": {
///      "$ref": "#/components/schemas/Supplier-Payment-Date"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LodgingSupplier {
    ///Unique identifier of the lodging supplier.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::std::string::String>,
    ///Legal name of the lodging supplier.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_date: ::std::option::Option<SupplierPaymentDate>,
}
impl ::std::default::Default for LodgingSupplier {
    fn default() -> Self {
        Self {
            id: Default::default(),
            name: Default::default(),
            payment_date: Default::default(),
        }
    }
}
/// Object containing details of a lodging booking.
///
/// :::info
/// These are the specific data field requirements for merchants who must provide lodging data. Note that these requirements can be extended on a case by case basis as decided by Revolut.
///
/// ```text
/// booking_id
/// lodgings[].check_in_date
/// lodgings[].check_out_date
/// lodgings[].supplier.payment_date
/// ```text
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a lodging booking.\n\n:::info\nThese are the specific data field requirements for merchants who must provide lodging data. Note that these requirements can be extended on a case by case basis as decided by Revolut.\n\n```\nbooking_id\nlodgings[].check_in_date\nlodgings[].check_out_date\nlodgings[].supplier.payment_date\n```\n:::",
///  "type": "object",
///  "required": [
///    "booking_id"
///  ],
///  "properties": {
///    "booking_id": {
///      "$ref": "#/components/schemas/Booking-Id"
///    },
///    "lodgings": {
///      "description": "List of lodging entries associated with this booking.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Lodging-Item"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LodgingV3 {
    pub booking_id: BookingId,
    ///List of lodging entries associated with this booking.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub lodgings: ::std::vec::Vec<LodgingItem>,
}
/// This object is required by Mastercard and Visa for merchants operating as marketplaces under the Merchant Category Code (MCC) `5262`. The marketplace object ensures compliance with the card schemes' regulations by providing detailed information about the seller involved in the transaction.
///
/// :::info
/// These are the specific data field requirements for merchants who must provide marketplace data.
///
/// ```text
/// seller.id
/// seller.name
/// seller.website
/// seller.phone
/// seller.address
/// ```text
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "This object is required by Mastercard and Visa for merchants operating as marketplaces under the Merchant Category Code (MCC) `5262`. The marketplace object ensures compliance with the card schemes' regulations by providing detailed information about the seller involved in the transaction.\n\n:::info\nThese are the specific data field requirements for merchants who must provide marketplace data.\n\n```\nseller.id\nseller.name\nseller.website\nseller.phone\nseller.address\n```\n:::",
///  "type": "object",
///  "required": [
///    "seller"
///  ],
///  "properties": {
///    "seller": {
///      "description": "Information about the subseller on the marketplace platform.",
///      "type": "object",
///      "required": [
///        "address",
///        "id",
///        "name",
///        "phone",
///        "website"
///      ],
///      "properties": {
///        "address": {
///          "$ref": "#/components/schemas/Address-v4"
///        },
///        "id": {
///          "description": "The ID of the seller in the merchant's internal system.",
///          "type": "string",
///          "maxLength": 15,
///          "minLength": 1
///        },
///        "name": {
///          "description": "The business or legal name of the seller.",
///          "type": "string",
///          "maxLength": 50,
///          "minLength": 1
///        },
///        "phone": {
///          "description": "The phone number of the seller.",
///          "type": "string"
///        },
///        "website": {
///          "description": "The URL of the website of the seller.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `255`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///          "type": "string",
///          "format": "uri",
///          "maxLength": 255,
///          "pattern": "^https?:\\/{2}.+/gi"
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MarketplaceV3 {
    pub seller: MarketplaceV3Seller,
}
///Information about the subseller on the marketplace platform.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Information about the subseller on the marketplace platform.",
///  "type": "object",
///  "required": [
///    "address",
///    "id",
///    "name",
///    "phone",
///    "website"
///  ],
///  "properties": {
///    "address": {
///      "$ref": "#/components/schemas/Address-v4"
///    },
///    "id": {
///      "description": "The ID of the seller in the merchant's internal system.",
///      "type": "string",
///      "maxLength": 15,
///      "minLength": 1
///    },
///    "name": {
///      "description": "The business or legal name of the seller.",
///      "type": "string",
///      "maxLength": 50,
///      "minLength": 1
///    },
///    "phone": {
///      "description": "The phone number of the seller.",
///      "type": "string"
///    },
///    "website": {
///      "description": "The URL of the website of the seller.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `255`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 255,
///      "pattern": "^https?:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MarketplaceV3Seller {
    pub address: AddressV4,
    ///The ID of the seller in the merchant's internal system.
    pub id: MarketplaceV3SellerId,
    ///The business or legal name of the seller.
    pub name: MarketplaceV3SellerName,
    ///The phone number of the seller.
    pub phone: ::std::string::String,
    /// The URL of the website of the seller.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be either `http` or `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `255`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    pub website: ::std::string::String,
}
///The ID of the seller in the merchant's internal system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the seller in the merchant's internal system.",
///  "type": "string",
///  "maxLength": 15,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct MarketplaceV3SellerId(::std::string::String);
impl ::std::ops::Deref for MarketplaceV3SellerId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<MarketplaceV3SellerId> for ::std::string::String {
    fn from(value: MarketplaceV3SellerId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for MarketplaceV3SellerId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 15usize {
            return Err("longer than 15 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 MarketplaceV3SellerId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for MarketplaceV3SellerId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for MarketplaceV3SellerId {
    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 MarketplaceV3SellerId {
    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 business or legal name of the seller.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The business or legal name of the seller.",
///  "type": "string",
///  "maxLength": 50,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct MarketplaceV3SellerName(::std::string::String);
impl ::std::ops::Deref for MarketplaceV3SellerName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<MarketplaceV3SellerName> for ::std::string::String {
    fn from(value: MarketplaceV3SellerName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for MarketplaceV3SellerName {
    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 MarketplaceV3SellerName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for MarketplaceV3SellerName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for MarketplaceV3SellerName {
    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 MarketplaceV3SellerName {
    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 string representing the four-digit [Merchant Category Code (MCC)](https://en.wikipedia.org/wiki/Merchant_category_code) of the conversion affiliate.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A string representing the four-digit [Merchant Category Code (MCC)](https://en.wikipedia.org/wiki/Merchant_category_code) of the conversion affiliate.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4,
///  "pattern": "^\\d{4}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Mcc(::std::string::String);
impl ::std::ops::Deref for Mcc {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Mcc> for ::std::string::String {
    fn from(value: Mcc) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for Mcc {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^\\d{4}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^\\d{4}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for Mcc {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Mcc {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Mcc {
    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 Mcc {
    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())
            })
    }
}
///Object for providing additional information stored in the merchant's order management system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object for providing additional information stored in the merchant's order management system. ",
///  "type": "object",
///  "properties": {
///    "reference": {
///      "$ref": "#/components/schemas/Merchant-Order-External-Reference"
///    },
///    "url": {
///      "$ref": "#/components/schemas/Merchant-Order-Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MerchantOrderData {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<MerchantOrderExternalReference>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<MerchantOrderUrl>,
}
impl ::std::default::Default for MerchantOrderData {
    fn default() -> Self {
        Self {
            reference: Default::default(),
            url: Default::default(),
        }
    }
}
/// Merchant order ID for external reference.
///
/// Use this field to set the ID that your own system can use to easily track orders.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Merchant order ID for external reference.\n\nUse this field to set the ID that your own system can use to easily track orders.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct MerchantOrderExternalReference(pub ::std::string::String);
impl ::std::ops::Deref for MerchantOrderExternalReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<MerchantOrderExternalReference> for ::std::string::String {
    fn from(value: MerchantOrderExternalReference) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for MerchantOrderExternalReference {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for MerchantOrderExternalReference {
    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 MerchantOrderExternalReference {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The URL of the order stored in the merchant's order management system.
///
/// This URL will be included in the order confirmation email for payments made via Revolut Pay. If specified, this URL will override the default link to the merchant's **Business website** configured in the Revolut Business account.
///
/// :::caution
/// Restrictions:
/// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
/// - URI scheme is required and must be either `http` or `https`
/// - URI host is required and cannot be `localhost` or an IP address
/// - Max length: `2000`
/// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The URL of the order stored in the merchant's order management system.\n\nThis URL will be included in the order confirmation email for payments made via Revolut Pay. If specified, this URL will override the default link to the merchant's **Business website** configured in the Revolut Business account.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///  "type": "string",
///  "format": "uri",
///  "maxLength": 2000,
///  "pattern": "^https?:\\/{2}.+/gi"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct MerchantOrderUrl(pub ::std::string::String);
impl ::std::ops::Deref for MerchantOrderUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<MerchantOrderUrl> for ::std::string::String {
    fn from(value: MerchantOrderUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for MerchantOrderUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for MerchantOrderUrl {
    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 MerchantOrderUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Additional information to track your orders in your system, by providing custom metadata using `"<key>" : "<value>"` pairs.
///
/// :::caution
/// **Restrictions:**
///
/// - Both keys and values must be `string`s
/// - Values cannot be `null`.
/// - Max number of key-value pairs: `50`
/// - Max length of values: `500` characters
/// - Format of keys: Must start with a letter and contain only letters, digits, and underscores. Max 40 characters. Pattern: `^[a-zA-Z][a-zA-Z\\d_]{0,39}$`
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional information to track your orders in your system, by providing custom metadata using `\"<key>\" : \"<value>\"` pairs.\n\n:::caution \n**Restrictions:**\n\n- Both keys and values must be `string`s\n- Values cannot be `null`.\n- Max number of key-value pairs: `50`\n- Max length of values: `500` characters\n- Format of keys: Must start with a letter and contain only letters, digits, and underscores. Max 40 characters. Pattern: `^[a-zA-Z][a-zA-Z\\\\d_]{0,39}$`\n:::",
///  "type": "object",
///  "maxProperties": 50,
///  "additionalProperties": {
///    "description": "Additional metadata value provided with the corresponding metadata key.",
///    "type": "string",
///    "maxLength": 500
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Metadata(pub ::std::collections::HashMap<::std::string::String, MetadataValue>);
impl ::std::ops::Deref for Metadata {
    type Target = ::std::collections::HashMap<::std::string::String, MetadataValue>;
    fn deref(&self) -> &::std::collections::HashMap<::std::string::String, MetadataValue> {
        &self.0
    }
}
impl ::std::convert::From<Metadata>
    for ::std::collections::HashMap<::std::string::String, MetadataValue>
{
    fn from(value: Metadata) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, MetadataValue>>
    for Metadata
{
    fn from(value: ::std::collections::HashMap<::std::string::String, MetadataValue>) -> Self {
        Self(value)
    }
}
///Additional metadata value provided with the corresponding metadata key.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Additional metadata value provided with the corresponding metadata key.",
///  "type": "string",
///  "maxLength": 500
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct MetadataValue(::std::string::String);
impl ::std::ops::Deref for MetadataValue {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<MetadataValue> for ::std::string::String {
    fn from(value: MetadataValue) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for MetadataValue {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for MetadataValue {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for MetadataValue {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for MetadataValue {
    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 MetadataValue {
    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 Network Transaction ID (NTI) is a unique identifier assigned by the card scheme (e.g., Visa or Mastercard) to a card transaction.
///
/// It can be used to trace the transaction across the payment network, link recurring or instalment payments to the original authorisation, and support dispute resolution.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The Network Transaction ID (NTI) is a unique identifier assigned by the card scheme (e.g., Visa or Mastercard) to a card transaction.\n\nIt can be used to trace the transaction across the payment network, link recurring or instalment payments to the original authorisation, and support dispute resolution.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct NetworkTransactionId(pub ::std::string::String);
impl ::std::ops::Deref for NetworkTransactionId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<NetworkTransactionId> for ::std::string::String {
    fn from(value: NetworkTransactionId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for NetworkTransactionId {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for NetworkTransactionId {
    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 NetworkTransactionId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Token for retrieving the next page of results. Use this token as the value of the `page_token` query parameter in your next request to retrieve the next page.
///
/// If not present, there are no more results to retrieve.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Token for retrieving the next page of results. Use this token as the value of the `page_token` query parameter in your next request to retrieve the next page.\n\nIf not present, there are no more results to retrieve.",
///  "type": [
///    "string",
///    "null"
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct NextPageToken(pub ::std::option::Option<::std::string::String>);
impl ::std::ops::Deref for NextPageToken {
    type Target = ::std::option::Option<::std::string::String>;
    fn deref(&self) -> &::std::option::Option<::std::string::String> {
        &self.0
    }
}
impl ::std::convert::From<NextPageToken> for ::std::option::Option<::std::string::String> {
    fn from(value: NextPageToken) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::option::Option<::std::string::String>> for NextPageToken {
    fn from(value: ::std::option::Option<::std::string::String>) -> Self {
        Self(value)
    }
}
/// An object containing the opening hours for each day of the week.
///
/// A day can have multiple intervals (e.g., closing for a lunch break).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "An object containing the opening hours for each day of the week.\n\nA day can have multiple intervals (e.g., closing for a lunch break).",
///  "type": "object",
///  "properties": {
///    "friday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "monday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "saturday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "sunday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "thursday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "tuesday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    },
///    "wednesday": {
///      "$ref": "#/components/schemas/Day-Opening-Hours"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OpeningHours {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub friday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub monday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub saturday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub sunday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub thursday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub tuesday: ::std::option::Option<DayOpeningHours>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub wednesday: ::std::option::Option<DayOpeningHours>,
}
impl ::std::default::Default for OpeningHours {
    fn default() -> Self {
        Self {
            friday: Default::default(),
            monday: Default::default(),
            saturday: Default::default(),
            sunday: Default::default(),
            thursday: Default::default(),
            tuesday: Default::default(),
            wednesday: Default::default(),
        }
    }
}
/// The order total expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.
///
/// :::info
/// - Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
/// - If `line_items` are provided, the order `amount` must equal the sum of all line items' `total_amount`.
/// - For card payments with a non-zero amount, the order `amount` must be at least **$0.005** (or equivalent in different currencies, calculated using Revolut's exchange rate on the payment date). Otherwise, card payments can't be performed.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The order total expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.\n\n:::info\n- Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).\n- If `line_items` are provided, the order `amount` must equal the sum of all line items' `total_amount`.\n- For card payments with a non-zero amount, the order `amount` must be at least **$0.005** (or equivalent in different currencies, calculated using Revolut's exchange rate on the payment date). Otherwise, card payments can't be performed.\n:::",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OrderAmountV2(pub i64);
impl ::std::ops::Deref for OrderAmountV2 {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<OrderAmountV2> for i64 {
    fn from(value: OrderAmountV2) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for OrderAmountV2 {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OrderAmountV2 {
    type Err = <i64 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 OrderAmountV2 {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for OrderAmountV2 {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for OrderAmountV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Specify an amount to capture, in minor currency units. The amount must not exceed the authorised amount.
///
/// An order can only be captured once. Partial capture is supported by sending an amount lower than the authorised amount. The uncaptured amount will be voided.
///
/// If you resend a capture request for an order that is already captured, no additional capture is performed. Resending with the same amount returns the current order state, while resending with a different amount returns an error.
///
/// If not provided, it defaults to the authorised amount (full capture will be executed).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Specify an amount to capture, in minor currency units. The amount must not exceed the authorised amount.\n\nAn order can only be captured once. Partial capture is supported by sending an amount lower than the authorised amount. The uncaptured amount will be voided.\n\nIf you resend a capture request for an order that is already captured, no additional capture is performed. Resending with the same amount returns the current order state, while resending with a different amount returns an error.\n\nIf not provided, it defaults to the authorised amount (full capture will be executed).",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OrderCaptureAmount(pub i64);
impl ::std::ops::Deref for OrderCaptureAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<OrderCaptureAmount> for i64 {
    fn from(value: OrderCaptureAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for OrderCaptureAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OrderCaptureAmount {
    type Err = <i64 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 OrderCaptureAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for OrderCaptureAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for OrderCaptureAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Order capture request parameters.
///
/// You can optionally provide line items when capturing an order. This is useful when you need to adjust the final order details at capture time (for example, when doing partial captures with specific items, or when the final delivered items differ from the initial authorisation).
///
/// :::caution
/// If you provide `line_items` when capturing, they will **overwrite** the original line items that were provided during order creation or update. Make sure to include all the items you want to be associated with the captured order.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Order capture request parameters.\n\nYou can optionally provide line items when capturing an order. This is useful when you need to adjust the final order details at capture time (for example, when doing partial captures with specific items, or when the final delivered items differ from the initial authorisation).\n\n:::caution\nIf you provide `line_items` when capturing, they will **overwrite** the original line items that were provided during order creation or update. Make sure to include all the items you want to be associated with the captured order.\n:::",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Order-Capture-Amount"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderCaptureV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<OrderCaptureAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
}
impl ::std::default::Default for OrderCaptureV2 {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            line_items: Default::default(),
        }
    }
}
///Object schema containing information about order creation body request parameters.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object schema containing information about order creation body request parameters.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Order-Amount-v2"
///    },
///    "authorisation_type": {
///      "$ref": "#/components/schemas/Authorisation-Type"
///    },
///    "cancel_authorised_after": {
///      "$ref": "#/components/schemas/Cancel-Authorised-After-v2"
///    },
///    "capture_mode": {
///      "$ref": "#/components/schemas/Capture-Mode-v2"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "customer": {
///      "$ref": "#/components/schemas/Customer-v2"
///    },
///    "description": {
///      "$ref": "#/components/schemas/Order-Description"
///    },
///    "enforce_challenge": {
///      "$ref": "#/components/schemas/Enforce-Challenge-v2"
///    },
///    "expire_pending_after": {
///      "$ref": "#/components/schemas/Expire-Pending-After"
///    },
///    "industry_data": {
///      "$ref": "#/components/schemas/Industry-Data-v3"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "merchant_order_data": {
///      "$ref": "#/components/schemas/Merchant-Order-Data"
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Metadata"
///    },
///    "redirect_url": {
///      "$ref": "#/components/schemas/Redirect-Url"
///    },
///    "settlement_currency": {
///      "$ref": "#/components/schemas/Settlement-Currency"
///    },
///    "shipping": {
///      "$ref": "#/components/schemas/Shipping"
///    },
///    "statement_descriptor_suffix": {
///      "$ref": "#/components/schemas/Statement-Descriptor-Suffix"
///    },
///    "upcoming_payment_data": {
///      "$ref": "#/components/schemas/Upcoming-Payment"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderCreationV7 {
    pub amount: OrderAmountV2,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_type: ::std::option::Option<AuthorisationType>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancel_authorised_after: ::std::option::Option<CancelAuthorisedAfterV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_mode: ::std::option::Option<CaptureModeV2>,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub customer: ::std::option::Option<CustomerV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<OrderDescription>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub enforce_challenge: ::std::option::Option<EnforceChallengeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expire_pending_after: ::std::option::Option<ExpirePendingAfter>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub industry_data: ::std::option::Option<IndustryDataV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<LocationId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_data: ::std::option::Option<MerchantOrderData>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<Metadata>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub redirect_url: ::std::option::Option<RedirectUrl>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settlement_currency: ::std::option::Option<SettlementCurrency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub shipping: ::std::option::Option<Shipping>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub statement_descriptor_suffix: ::std::option::Option<StatementDescriptorSuffix>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub upcoming_payment_data: ::std::option::Option<UpcomingPayment>,
}
/// A lightweight customer object embedded in an order.
///
/// This is a simplified representation intended for the order context. For the full customer object including all payment methods, use the [Retrieve a customer](https://developer.revolut.com/docs/merchant/retrieve-customer) endpoint.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Order customer",
///  "description": "A lightweight customer object embedded in an order.\n\nThis is a simplified representation intended for the order context. For the full customer object including all payment methods, use the [Retrieve a customer](https://developer.revolut.com/docs/merchant/retrieve-customer) endpoint.",
///  "type": "object",
///  "required": [
///    "id"
///  ],
///  "properties": {
///    "date_of_birth": {
///      "$ref": "#/components/schemas/Date-Of-Birth"
///    },
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "full_name": {
///      "$ref": "#/components/schemas/Full-Name"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderCustomerV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub date_of_birth: ::std::option::Option<DateOfBirth>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub email: ::std::option::Option<Email>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub full_name: ::std::option::Option<FullName>,
    pub id: CustomerId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
}
///The description of the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The description of the order.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct OrderDescription(pub ::std::string::String);
impl ::std::ops::Deref for OrderDescription {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<OrderDescription> for ::std::string::String {
    fn from(value: OrderDescription) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for OrderDescription {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OrderDescription {
    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 OrderDescription {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Permanent order ID used to retrieve, capture, cancel, or refund an order after authorization.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Permanent order ID used to retrieve, capture, cancel, or refund an order after authorization.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OrderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for OrderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<OrderId> for ::uuid::Uuid {
    fn from(value: OrderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for OrderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OrderId {
    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 OrderId {
    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 OrderId {
    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 OrderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The request body for creating a refund order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The request body for creating a refund order.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Refund-Amount"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Refund-Currency"
///    },
///    "description": {
///      "description": "An optional, user-facing description for the refund. This may be displayed to the customer.",
///      "type": "string"
///    },
///    "merchant_order_data": {
///      "description": "Object for providing additional information stored in the merchant's order management system.",
///      "type": "object",
///      "properties": {
///        "reference": {
///          "$ref": "#/components/schemas/Merchant-Order-External-Reference"
///        }
///      }
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Metadata"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderRefundV2 {
    pub amount: RefundAmount,
    pub currency: RefundCurrency,
    ///An optional, user-facing description for the refund. This may be displayed to the customer.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_data: ::std::option::Option<OrderRefundV2MerchantOrderData>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<Metadata>,
}
///Object for providing additional information stored in the merchant's order management system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object for providing additional information stored in the merchant's order management system.",
///  "type": "object",
///  "properties": {
///    "reference": {
///      "$ref": "#/components/schemas/Merchant-Order-External-Reference"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderRefundV2MerchantOrderData {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub reference: ::std::option::Option<MerchantOrderExternalReference>,
}
impl ::std::default::Default for OrderRefundV2MerchantOrderData {
    fn default() -> Self {
        Self {
            reference: Default::default(),
        }
    }
}
/// A simplified order object returned in list responses.
///
/// To get the full details of an order, use the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Simplified order",
///  "description": "A simplified order object returned in list responses.\n\nTo get the full details of an order, use the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint.",
///  "type": "object",
///  "required": [
///    "amount",
///    "capture_mode",
///    "created_at",
///    "currency",
///    "enforce_challenge",
///    "id",
///    "outstanding_amount",
///    "state",
///    "type",
///    "updated_at"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Order-Amount-v2"
///    },
///    "authorisation_type": {
///      "$ref": "#/components/schemas/Authorisation-Type"
///    },
///    "cancel_authorised_after": {
///      "$ref": "#/components/schemas/Cancel-Authorised-After"
///    },
///    "capture_mode": {
///      "$ref": "#/components/schemas/Capture-Mode-v2"
///    },
///    "created_at": {
///      "description": "The date and time the order was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "customer": {
///      "$ref": "#/components/schemas/Order-Customer-v2"
///    },
///    "description": {
///      "$ref": "#/components/schemas/Order-Description"
///    },
///    "enforce_challenge": {
///      "$ref": "#/components/schemas/Enforce-Challenge-v2"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Order-Id"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "merchant_order_data": {
///      "$ref": "#/components/schemas/Merchant-Order-Data"
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Metadata"
///    },
///    "outstanding_amount": {
///      "$ref": "#/components/schemas/Outstanding-Amount"
///    },
///    "redirect_url": {
///      "$ref": "#/components/schemas/Redirect-Url"
///    },
///    "related_order_id": {
///      "$ref": "#/components/schemas/Related-Order-Id"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Order-State"
///    },
///    "statement_descriptor_suffix": {
///      "$ref": "#/components/schemas/Statement-Descriptor-Suffix"
///    },
///    "token": {
///      "$ref": "#/components/schemas/Order-Token"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Order-Type-v2"
///    },
///    "updated_at": {
///      "description": "The date and time the order was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderSimplifiedV2 {
    pub amount: OrderAmountV2,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_type: ::std::option::Option<AuthorisationType>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancel_authorised_after: ::std::option::Option<CancelAuthorisedAfter>,
    pub capture_mode: CaptureModeV2,
    ///The date and time the order was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub customer: ::std::option::Option<OrderCustomerV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<OrderDescription>,
    pub enforce_challenge: EnforceChallengeV2,
    pub id: OrderId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<LocationId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_data: ::std::option::Option<MerchantOrderData>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<Metadata>,
    pub outstanding_amount: OutstandingAmount,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub redirect_url: ::std::option::Option<RedirectUrl>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub related_order_id: ::std::option::Option<RelatedOrderId>,
    pub state: OrderState,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub statement_descriptor_suffix: ::std::option::Option<StatementDescriptorSuffix>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token: ::std::option::Option<OrderToken>,
    #[serde(rename = "type")]
    pub type_: OrderTypeV2,
    ///The date and time the order was last updated.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The state of the order in its lifecycle.
///
/// | State | Description |
/// |-------|-------------|
/// | `pending` | Order created, awaiting payment |
/// | `processing` | Payment is being processed |
/// | `authorised` | Payment authorised but not yet captured (for manual capture) |
/// | `completed` | Payment successfully captured and settled |
/// | `cancelled` | Order was cancelled |
/// | `failed` | Payment failed |
///
/// For more information, see: [Order and payment lifecycle](https://developer.revolut.com/docs/guides/merchant/reference/order-lifecycle)
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of the order in its lifecycle.\n\n| State | Description |\n|-------|-------------|\n| `pending` | Order created, awaiting payment |\n| `processing` | Payment is being processed |\n| `authorised` | Payment authorised but not yet captured (for manual capture) |\n| `completed` | Payment successfully captured and settled |\n| `cancelled` | Order was cancelled |\n| `failed` | Payment failed |\n\nFor more information, see: [Order and payment lifecycle](https://developer.revolut.com/docs/guides/merchant/reference/order-lifecycle)",
///  "type": "string",
///  "enum": [
///    "pending",
///    "processing",
///    "authorised",
///    "completed",
///    "cancelled",
///    "failed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum OrderState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "authorised")]
    Authorised,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "failed")]
    Failed,
}
impl ::std::fmt::Display for OrderState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Processing => f.write_str("processing"),
            Self::Authorised => f.write_str("authorised"),
            Self::Completed => f.write_str("completed"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Failed => f.write_str("failed"),
        }
    }
}
impl ::std::str::FromStr for OrderState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "processing" => Ok(Self::Processing),
            "authorised" => Ok(Self::Authorised),
            "completed" => Ok(Self::Completed),
            "cancelled" => Ok(Self::Cancelled),
            "failed" => Ok(Self::Failed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for OrderState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for OrderState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for OrderState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Temporary ID for the order, which expires when the payment is authorised.
///
/// The order `token` is used for [token-based initialisation](https://developer.revolut.com/docs/sdks/merchant-web-sdk/initialisation/token-based), and is returned by the `createOrder` callback in the following payment methods:
///
/// - [Embedded Checkout](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/embedded-checkout#embeddedcheckout options-interface)
/// - [Revolut Pay](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/revolut-pay#widgetpaymentsrevolutpayoptions)
/// - [Apple Pay and Google Pay](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/apple-pay-google-pay#paymentrequestoptions-interface)
/// - [Pay by Bank](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/pay-by-bank#paybybankoptions-interface)
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Temporary ID for the order, which expires when the payment is authorised.\n\nThe order `token` is used for [token-based initialisation](https://developer.revolut.com/docs/sdks/merchant-web-sdk/initialisation/token-based), and is returned by the `createOrder` callback in the following payment methods:\n\n- [Embedded Checkout](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/embedded-checkout#embeddedcheckout options-interface)\n- [Revolut Pay](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/revolut-pay#widgetpaymentsrevolutpayoptions)\n- [Apple Pay and Google Pay](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/apple-pay-google-pay#paymentrequestoptions-interface)\n- [Pay by Bank](https://developer.revolut.com/docs/sdks/merchant-web-sdk/payment-methods/pay-by-bank#paybybankoptions-interface)",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct OrderToken(pub ::std::string::String);
impl ::std::ops::Deref for OrderToken {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<OrderToken> for ::std::string::String {
    fn from(value: OrderToken) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for OrderToken {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OrderToken {
    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 OrderToken {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The type of the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the order.",
///  "type": "string",
///  "enum": [
///    "payment",
///    "payment_request",
///    "refund",
///    "chargeback",
///    "chargeback_reversal",
///    "credit_reimbursement"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum OrderTypeV2 {
    #[serde(rename = "payment")]
    Payment,
    #[serde(rename = "payment_request")]
    PaymentRequest,
    #[serde(rename = "refund")]
    Refund,
    #[serde(rename = "chargeback")]
    Chargeback,
    #[serde(rename = "chargeback_reversal")]
    ChargebackReversal,
    #[serde(rename = "credit_reimbursement")]
    CreditReimbursement,
}
impl ::std::fmt::Display for OrderTypeV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Payment => f.write_str("payment"),
            Self::PaymentRequest => f.write_str("payment_request"),
            Self::Refund => f.write_str("refund"),
            Self::Chargeback => f.write_str("chargeback"),
            Self::ChargebackReversal => f.write_str("chargeback_reversal"),
            Self::CreditReimbursement => f.write_str("credit_reimbursement"),
        }
    }
}
impl ::std::str::FromStr for OrderTypeV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "payment" => Ok(Self::Payment),
            "payment_request" => Ok(Self::PaymentRequest),
            "refund" => Ok(Self::Refund),
            "chargeback" => Ok(Self::Chargeback),
            "chargeback_reversal" => Ok(Self::ChargebackReversal),
            "credit_reimbursement" => Ok(Self::CreditReimbursement),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for OrderTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for OrderTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for OrderTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Object schema containing information about order update body request parameters.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object schema containing information about order update body request parameters.",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Order-Amount-v2"
///    },
///    "cancel_authorised_after": {
///      "$ref": "#/components/schemas/Cancel-Authorised-After-v2"
///    },
///    "capture_mode": {
///      "$ref": "#/components/schemas/Capture-Mode-v2"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "customer": {
///      "$ref": "#/components/schemas/Customer-v2"
///    },
///    "description": {
///      "$ref": "#/components/schemas/Order-Description"
///    },
///    "enforce_challenge": {
///      "$ref": "#/components/schemas/Enforce-Challenge-v2"
///    },
///    "expire_pending_after": {
///      "$ref": "#/components/schemas/Expire-Pending-After"
///    },
///    "industry_data": {
///      "$ref": "#/components/schemas/Industry-Data-v3"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    },
///    "merchant_order_data": {
///      "$ref": "#/components/schemas/Merchant-Order-Data"
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Metadata"
///    },
///    "redirect_url": {
///      "$ref": "#/components/schemas/Redirect-Url"
///    },
///    "settlement_currency": {
///      "$ref": "#/components/schemas/Settlement-Currency"
///    },
///    "shipping": {
///      "$ref": "#/components/schemas/Shipping"
///    },
///    "statement_descriptor_suffix": {
///      "$ref": "#/components/schemas/Statement-Descriptor-Suffix"
///    },
///    "upcoming_payment_data": {
///      "$ref": "#/components/schemas/Upcoming-Payment"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderUpdateV7 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<OrderAmountV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancel_authorised_after: ::std::option::Option<CancelAuthorisedAfterV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_mode: ::std::option::Option<CaptureModeV2>,
    #[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 customer: ::std::option::Option<CustomerV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<OrderDescription>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub enforce_challenge: ::std::option::Option<EnforceChallengeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub expire_pending_after: ::std::option::Option<ExpirePendingAfter>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub industry_data: ::std::option::Option<IndustryDataV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_data: ::std::option::Option<MerchantOrderData>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<Metadata>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub redirect_url: ::std::option::Option<RedirectUrl>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settlement_currency: ::std::option::Option<SettlementCurrency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub shipping: ::std::option::Option<Shipping>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub statement_descriptor_suffix: ::std::option::Option<StatementDescriptorSuffix>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub upcoming_payment_data: ::std::option::Option<UpcomingPayment>,
}
impl ::std::default::Default for OrderUpdateV7 {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            cancel_authorised_after: Default::default(),
            capture_mode: Default::default(),
            currency: Default::default(),
            customer: Default::default(),
            description: Default::default(),
            enforce_challenge: Default::default(),
            expire_pending_after: Default::default(),
            industry_data: Default::default(),
            line_items: Default::default(),
            merchant_order_data: Default::default(),
            metadata: Default::default(),
            redirect_url: Default::default(),
            settlement_currency: Default::default(),
            shipping: Default::default(),
            statement_descriptor_suffix: Default::default(),
            upcoming_payment_data: Default::default(),
        }
    }
}
///To process the order from a credit or debit card, you create an `Order` object. You can then retrieve, capture, cancel, refund, or pay an order using its unique `id`. Alternatively, you can use its unique `token` to process a card payment with the Revolut Checkout Widget.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Order v7",
///  "description": "To process the order from a credit or debit card, you create an `Order` object. You can then retrieve, capture, cancel, refund, or pay an order using its unique `id`. Alternatively, you can use its unique `token` to process a card payment with the Revolut Checkout Widget.",
///  "type": "object",
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Order-Amount-v2"
///    },
///    "authorisation_type": {
///      "$ref": "#/components/schemas/Authorisation-Type"
///    },
///    "cancel_authorised_after": {
///      "$ref": "#/components/schemas/Cancel-Authorised-After"
///    },
///    "capture_mode": {
///      "$ref": "#/components/schemas/Capture-Mode-v2"
///    },
///    "checkout_url": {
///      "$ref": "#/components/schemas/Checkout-Url"
///    },
///    "created_at": {
///      "description": "The date and time the order was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "customer": {
///      "$ref": "#/components/schemas/Customer-v2"
///    },
///    "description": {
///      "$ref": "#/components/schemas/Order-Description"
///    },
///    "enforce_challenge": {
///      "$ref": "#/components/schemas/Enforce-Challenge-v2"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Order-Id"
///    },
///    "incremental_authorisations": {
///      "$ref": "#/components/schemas/Incremental-Authorisations"
///    },
///    "industry_data": {
///      "$ref": "#/components/schemas/Industry-Data-v3"
///    },
///    "line_items": {
///      "$ref": "#/components/schemas/Line-Items"
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "merchant_order_data": {
///      "$ref": "#/components/schemas/Merchant-Order-Data"
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Metadata"
///    },
///    "outstanding_amount": {
///      "$ref": "#/components/schemas/Outstanding-Amount"
///    },
///    "payments": {
///      "description": "The details of all the payments that have been made towards this order (successful or unsuccessful).",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Payment-v3"
///      }
///    },
///    "redirect_url": {
///      "$ref": "#/components/schemas/Redirect-Url"
///    },
///    "refunded_amount": {
///      "$ref": "#/components/schemas/Refunded-Amount"
///    },
///    "related_order_id": {
///      "$ref": "#/components/schemas/Related-Order-Id"
///    },
///    "settlement_currency": {
///      "$ref": "#/components/schemas/Settlement-Currency"
///    },
///    "shipping": {
///      "$ref": "#/components/schemas/Shipping"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Order-State"
///    },
///    "statement_descriptor_suffix": {
///      "$ref": "#/components/schemas/Statement-Descriptor-Suffix"
///    },
///    "token": {
///      "$ref": "#/components/schemas/Order-Token"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Order-Type-v2"
///    },
///    "upcoming_payment_data": {
///      "$ref": "#/components/schemas/Upcoming-Payment"
///    },
///    "updated_at": {
///      "description": "The date and time the order was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrderV7 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<OrderAmountV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_type: ::std::option::Option<AuthorisationType>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cancel_authorised_after: ::std::option::Option<CancelAuthorisedAfter>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_mode: ::std::option::Option<CaptureModeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub checkout_url: ::std::option::Option<CheckoutUrl>,
    ///The date and time the order was created.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    #[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 customer: ::std::option::Option<CustomerV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub description: ::std::option::Option<OrderDescription>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub enforce_challenge: ::std::option::Option<EnforceChallengeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<OrderId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub incremental_authorisations: ::std::option::Option<IncrementalAuthorisations>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub industry_data: ::std::option::Option<IndustryDataV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub line_items: ::std::option::Option<LineItems>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<LocationId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_data: ::std::option::Option<MerchantOrderData>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<Metadata>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub outstanding_amount: ::std::option::Option<OutstandingAmount>,
    ///The details of all the payments that have been made towards this order (successful or unsuccessful).
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub payments: ::std::vec::Vec<PaymentV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub redirect_url: ::std::option::Option<RedirectUrl>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub refunded_amount: ::std::option::Option<RefundedAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub related_order_id: ::std::option::Option<RelatedOrderId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settlement_currency: ::std::option::Option<SettlementCurrency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub shipping: ::std::option::Option<Shipping>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<OrderState>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub statement_descriptor_suffix: ::std::option::Option<StatementDescriptorSuffix>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token: ::std::option::Option<OrderToken>,
    #[serde(
        rename = "type",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub type_: ::std::option::Option<OrderTypeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub upcoming_payment_data: ::std::option::Option<UpcomingPayment>,
    ///The date and time the order was last updated.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for OrderV7 {
    fn default() -> Self {
        Self {
            amount: Default::default(),
            authorisation_type: Default::default(),
            cancel_authorised_after: Default::default(),
            capture_mode: Default::default(),
            checkout_url: Default::default(),
            created_at: Default::default(),
            currency: Default::default(),
            customer: Default::default(),
            description: Default::default(),
            enforce_challenge: Default::default(),
            id: Default::default(),
            incremental_authorisations: Default::default(),
            industry_data: Default::default(),
            line_items: Default::default(),
            location_id: Default::default(),
            merchant_order_data: Default::default(),
            metadata: Default::default(),
            outstanding_amount: Default::default(),
            payments: Default::default(),
            redirect_url: Default::default(),
            refunded_amount: Default::default(),
            related_order_id: Default::default(),
            settlement_currency: Default::default(),
            shipping: Default::default(),
            state: Default::default(),
            statement_descriptor_suffix: Default::default(),
            token: Default::default(),
            type_: Default::default(),
            upcoming_payment_data: Default::default(),
            updated_at: Default::default(),
        }
    }
}
///`OrdersV2`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "orders"
///  ],
///  "properties": {
///    "orders": {
///      "description": "List of orders.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Order-Simplified-v2"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrdersV2 {
    ///List of orders.
    pub orders: ::std::vec::Vec<OrderSimplifiedV2>,
}
/// The amount not yet paid for a given order (in minor currency units). For example, `7034` represents €70.34.
///
/// The value in this field may differ from `amount` if there are partial payments associated with the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount not yet paid for a given order (in minor currency units). For example, `7034` represents €70.34. \n\nThe value in this field may differ from `amount` if there are partial payments associated with the order.",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct OutstandingAmount(pub i64);
impl ::std::ops::Deref for OutstandingAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<OutstandingAmount> for i64 {
    fn from(value: OutstandingAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for OutstandingAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for OutstandingAmount {
    type Err = <i64 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 OutstandingAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for OutstandingAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for OutstandingAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`Passenger`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "first_name",
///    "last_name"
///  ],
///  "properties": {
///    "first_name": {
///      "description": "Passenger's first name.",
///      "type": "string"
///    },
///    "last_name": {
///      "description": "Passenger's last name.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Passenger {
    ///Passenger's first name.
    pub first_name: ::std::string::String,
    ///Passenger's last name.
    pub last_name: ::std::string::String,
}
///Array containing information of passengers associated with the booking.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Array containing information of passengers associated with the booking.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Passenger"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Passengers(pub ::std::vec::Vec<Passenger>);
impl ::std::ops::Deref for Passengers {
    type Target = ::std::vec::Vec<Passenger>;
    fn deref(&self) -> &::std::vec::Vec<Passenger> {
        &self.0
    }
}
impl ::std::convert::From<Passengers> for ::std::vec::Vec<Passenger> {
    fn from(value: Passengers) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Passenger>> for Passengers {
    fn from(value: ::std::vec::Vec<Passenger>) -> Self {
        Self(value)
    }
}
/// The person who made the payment. This object is present when an email or phone number is provided during the payment flow.
///
/// Capturing payer details lets you identify exactly who authorised the charge, reach the right person for receipts or refund queries, and support compliance or fraud-review workflows where the paying identity matters.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payer",
///  "description": "The person who made the payment. This object is present when an email or phone number is provided during the payment flow.\n\nCapturing payer details lets you identify exactly who authorised the charge, reach the right person for receipts or refund queries, and support compliance or fraud-review workflows where the paying identity matters.",
///  "type": "object",
///  "properties": {
///    "email": {
///      "$ref": "#/components/schemas/Email"
///    },
///    "phone": {
///      "$ref": "#/components/schemas/Phone"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Payer {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub email: ::std::option::Option<Email>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub phone: ::std::option::Option<Phone>,
}
impl ::std::default::Default for Payer {
    fn default() -> Self {
        Self {
            email: Default::default(),
            phone: Default::default(),
        }
    }
}
/// The payment amount in minor units (e.g., cents). The value of this field depends on the payment type and state.
///
/// | Payment type | State | Amount value |
/// |--------------|-------|--------------|
/// | Standard payment | Any | Total payment amount |
/// | Pre-authorised payment | `authorisation_started` | New amount being authorised (during increment processing) |
/// | Pre-authorised payment | `authorised` | Currently authorised amount (equals `authorised_amount`) |
///
/// :::info
/// For pre-authorised payments, see the `authorised_amount` field for tracking the currently authorised amount separately.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The payment amount in minor units (e.g., cents). The value of this field depends on the payment type and state.\n\n| Payment type | State | Amount value |\n|--------------|-------|--------------|\n| Standard payment | Any | Total payment amount |\n| Pre-authorised payment | `authorisation_started` | New amount being authorised (during increment processing) |\n| Pre-authorised payment | `authorised` | Currently authorised amount (equals `authorised_amount`) |\n\n:::info\nFor pre-authorised payments, see the `authorised_amount` field for tracking the currently authorised amount separately.\n:::",
///  "type": "integer",
///  "format": "int64",
///  "minimum": 0.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentAmount(pub i64);
impl ::std::ops::Deref for PaymentAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<PaymentAmount> for i64 {
    fn from(value: PaymentAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for PaymentAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentAmount {
    type Err = <i64 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 PaymentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PaymentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PaymentAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The currently authorised amount for this payment (in minor units).
///
/// For pre-authorised payments with incremental authorization:
/// - Initially equals the `amount` field
/// - Remains unchanged during increment processing
/// - Updates to new amount upon successful increment
/// - Remains at original amount if increment is declined
///
/// For standard payments, this field may not be present or will equal the `amount` field.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currently authorised amount for this payment (in minor units).\n\nFor pre-authorised payments with incremental authorization:\n- Initially equals the `amount` field\n- Remains unchanged during increment processing\n- Updates to new amount upon successful increment\n- Remains at original amount if increment is declined\n\nFor standard payments, this field may not be present or will equal the `amount` field.",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentAuthorisedAmount(pub i64);
impl ::std::ops::Deref for PaymentAuthorisedAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<PaymentAuthorisedAmount> for i64 {
    fn from(value: PaymentAuthorisedAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for PaymentAuthorisedAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentAuthorisedAmount {
    type Err = <i64 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 PaymentAuthorisedAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PaymentAuthorisedAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PaymentAuthorisedAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time the payment was created.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the payment was created.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentCreated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for PaymentCreated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<PaymentCreated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: PaymentCreated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for PaymentCreated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentCreated {
    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 PaymentCreated {
    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 PaymentCreated {
    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 PaymentCreated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The ID of the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the payment.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentId(pub ::uuid::Uuid);
impl ::std::ops::Deref for PaymentId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PaymentId> for ::uuid::Uuid {
    fn from(value: PaymentId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PaymentId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentId {
    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 PaymentId {
    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 PaymentId {
    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 PaymentId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Represents a payment intent that has been pushed to a Revolut Terminal device.
///
/// When the payment intent reaches `completed` state, it includes a `payment_id` that can be used to [retrieve the final payment status](https://developer.revolut.com/docs/merchant/retrieve-payment-details).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment Intent",
///  "description": "Represents a payment intent that has been pushed to a Revolut Terminal device.\n\nWhen the payment intent reaches `completed` state, it includes a `payment_id` that can be used to [retrieve the final payment status](https://developer.revolut.com/docs/merchant/retrieve-payment-details).",
///  "type": "object",
///  "required": [
///    "amount",
///    "created_at",
///    "currency",
///    "id",
///    "order_id",
///    "state",
///    "terminal_id",
///    "updated_at"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payment-Intent-Amount"
///    },
///    "created_at": {
///      "description": "The date and time the payment intent was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Intent-Id"
///    },
///    "order_id": {
///      "$ref": "#/components/schemas/Order-Id"
///    },
///    "payment_id": {
///      "$ref": "#/components/schemas/Payment-Id"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Payment-Intent-State"
///    },
///    "terminal_id": {
///      "$ref": "#/components/schemas/Terminal-Id"
///    },
///    "updated_at": {
///      "description": "The date and time the payment intent was last updated.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentIntent {
    pub amount: PaymentIntentAmount,
    ///The date and time the payment intent was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    pub currency: Currency,
    pub id: PaymentIntentId,
    pub order_id: OrderId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_id: ::std::option::Option<PaymentId>,
    pub state: PaymentIntentState,
    pub terminal_id: TerminalId,
    ///The date and time the payment intent was last updated.
    pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
}
/// The payment amount expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.
///
/// :::info
/// Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment Intent amount",
///  "description": "The payment amount expressed in minor currency units, according to the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217). For example, `7034` in `EUR` corresponds to €70.34.\n\n:::info\nConversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).\n:::",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentIntentAmount(pub i64);
impl ::std::ops::Deref for PaymentIntentAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<PaymentIntentAmount> for i64 {
    fn from(value: PaymentIntentAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for PaymentIntentAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentIntentAmount {
    type Err = <i64 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 PaymentIntentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PaymentIntentAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PaymentIntentAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Request body for creating a payment intent to push to a terminal.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment Intent creation",
///  "description": "Request body for creating a payment intent to push to a terminal.",
///  "type": "object",
///  "required": [
///    "amount",
///    "terminal_id"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payment-Intent-Amount"
///    },
///    "terminal_id": {
///      "$ref": "#/components/schemas/Terminal-Id"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentIntentCreation {
    pub amount: PaymentIntentAmount,
    pub terminal_id: TerminalId,
}
///The unique identifier of the payment intent.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment Intent ID",
///  "description": "The unique identifier of the payment intent.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentIntentId(pub ::uuid::Uuid);
impl ::std::ops::Deref for PaymentIntentId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PaymentIntentId> for ::uuid::Uuid {
    fn from(value: PaymentIntentId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PaymentIntentId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentIntentId {
    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 PaymentIntentId {
    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 PaymentIntentId {
    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 PaymentIntentId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The current state of the payment intent.
///
/// | State | Description |
/// |-------|-------------|
/// | `pending` | Payment intent created and sent to terminal, customer has not yet started interacting |
/// | `processing` | Customer is actively interacting with the terminal (e.g., inserting card, entering PIN) |
/// | `completed` | Payment authorization is complete, includes a `payment_id` in the response |
/// | `cancelled` | Payment intent was cancelled (by system or customer) |
/// | `failed` | Payment intent failed due to technical issues (timeout, terminal unavailable, network error) |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The current state of the payment intent.\n\n| State | Description |\n|-------|-------------|\n| `pending` | Payment intent created and sent to terminal, customer has not yet started interacting |\n| `processing` | Customer is actively interacting with the terminal (e.g., inserting card, entering PIN) |\n| `completed` | Payment authorization is complete, includes a `payment_id` in the response |\n| `cancelled` | Payment intent was cancelled (by system or customer) |\n| `failed` | Payment intent failed due to technical issues (timeout, terminal unavailable, network error) |",
///  "type": "string",
///  "enum": [
///    "pending",
///    "processing",
///    "completed",
///    "cancelled",
///    "failed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentIntentState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "failed")]
    Failed,
}
impl ::std::fmt::Display for PaymentIntentState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Processing => f.write_str("processing"),
            Self::Completed => f.write_str("completed"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Failed => f.write_str("failed"),
        }
    }
}
impl ::std::str::FromStr for PaymentIntentState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "processing" => Ok(Self::Processing),
            "completed" => Ok(Self::Completed),
            "cancelled" => Ok(Self::Cancelled),
            "failed" => Ok(Self::Failed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentIntentState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentIntentState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentIntentState {
    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 payment method was added.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the payment method was added.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentMethodCreatedAt(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for PaymentMethodCreatedAt {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<PaymentMethodCreatedAt> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: PaymentMethodCreatedAt) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for PaymentMethodCreatedAt {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentMethodCreatedAt {
    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 PaymentMethodCreatedAt {
    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 PaymentMethodCreatedAt {
    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 PaymentMethodCreatedAt {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Unique identifier for the payment method.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the payment method.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentMethodId(pub ::uuid::Uuid);
impl ::std::ops::Deref for PaymentMethodId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PaymentMethodId> for ::uuid::Uuid {
    fn from(value: PaymentMethodId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PaymentMethodId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentMethodId {
    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 PaymentMethodId {
    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 PaymentMethodId {
    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 PaymentMethodId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The type of payment method used to pay for the order.
///
/// Available values:
///
/// | Payment method `type` | Description |
/// | --------------------- | ----------- |
/// | `apple_pay` | The customer paid the order using Apple Pay. |
/// | `card` | The customer paid the order using their credit or debit card. |
/// | `google_pay` | The customer paid the order using Google Pay. |
/// | `revolut_pay_card` | The customer paid the order via Revolut Pay using their credit or debit card. |
/// | `revolut_pay_account` | The customer paid the order via Revolut Pay using their Revolut account. |
/// | `sepa_direct_debit` | The customer paid the order using SEPA Direct Debit. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of payment method used to pay for the order.\n\nAvailable values:\n\n| Payment method `type` | Description |\n| --------------------- | ----------- |\n| `apple_pay` | The customer paid the order using Apple Pay. |\n| `card` | The customer paid the order using their credit or debit card. |\n| `google_pay` | The customer paid the order using Google Pay. |\n| `revolut_pay_card` | The customer paid the order via Revolut Pay using their credit or debit card. |\n| `revolut_pay_account` | The customer paid the order via Revolut Pay using their Revolut account. |\n| `sepa_direct_debit` | The customer paid the order using SEPA Direct Debit. |",
///  "type": "string",
///  "enum": [
///    "apple_pay",
///    "card",
///    "google_pay",
///    "revolut_pay_card",
///    "revolut_pay_account",
///    "sepa_direct_debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentMethodType {
    #[serde(rename = "apple_pay")]
    ApplePay,
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "google_pay")]
    GooglePay,
    #[serde(rename = "revolut_pay_card")]
    RevolutPayCard,
    #[serde(rename = "revolut_pay_account")]
    RevolutPayAccount,
    #[serde(rename = "sepa_direct_debit")]
    SepaDirectDebit,
}
impl ::std::fmt::Display for PaymentMethodType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::ApplePay => f.write_str("apple_pay"),
            Self::Card => f.write_str("card"),
            Self::GooglePay => f.write_str("google_pay"),
            Self::RevolutPayCard => f.write_str("revolut_pay_card"),
            Self::RevolutPayAccount => f.write_str("revolut_pay_account"),
            Self::SepaDirectDebit => f.write_str("sepa_direct_debit"),
        }
    }
}
impl ::std::str::FromStr for PaymentMethodType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "apple_pay" => Ok(Self::ApplePay),
            "card" => Ok(Self::Card),
            "google_pay" => Ok(Self::GooglePay),
            "revolut_pay_card" => Ok(Self::RevolutPayCard),
            "revolut_pay_account" => Ok(Self::RevolutPayAccount),
            "sepa_direct_debit" => Ok(Self::SepaDirectDebit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentMethodType {
    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 payment method.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the payment method.",
///  "type": "string",
///  "enum": [
///    "card",
///    "revolut_pay",
///    "sepa_direct_debit"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentMethodTypeV2 {
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "revolut_pay")]
    RevolutPay,
    #[serde(rename = "sepa_direct_debit")]
    SepaDirectDebit,
}
impl ::std::fmt::Display for PaymentMethodTypeV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Card => f.write_str("card"),
            Self::RevolutPay => f.write_str("revolut_pay"),
            Self::SepaDirectDebit => f.write_str("sepa_direct_debit"),
        }
    }
}
impl ::std::str::FromStr for PaymentMethodTypeV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "card" => Ok(Self::Card),
            "revolut_pay" => Ok(Self::RevolutPay),
            "sepa_direct_debit" => Ok(Self::SepaDirectDebit),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentMethodTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentMethodTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentMethodTypeV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Fields to update on a saved payment method.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment method update",
///  "description": "Fields to update on a saved payment method.",
///  "type": "object",
///  "properties": {
///    "saved_for": {
///      "description": "Update the value of `saved_for` from `merchant` to `customer`.\n\nOnce updated, this payment method can no longer be used for merchant-initiated transactions (MIT). It can only be used when the customer is present on the checkout page.\n\n| Value | Description |\n| ----- | ----------- |\n| `customer` | Restrict this payment method to customer-initiated transactions only. |",
///      "type": "string",
///      "enum": [
///        "customer"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentMethodUpdate {
    /// Update the value of `saved_for` from `merchant` to `customer`.
    ///
    /// Once updated, this payment method can no longer be used for merchant-initiated transactions (MIT). It can only be used when the customer is present on the checkout page.
    ///
    /// | Value | Description |
    /// | ----- | ----------- |
    /// | `customer` | Restrict this payment method to customer-initiated transactions only. |
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub saved_for: ::std::option::Option<PaymentMethodUpdateSavedFor>,
}
impl ::std::default::Default for PaymentMethodUpdate {
    fn default() -> Self {
        Self {
            saved_for: Default::default(),
        }
    }
}
/// Update the value of `saved_for` from `merchant` to `customer`.
///
/// Once updated, this payment method can no longer be used for merchant-initiated transactions (MIT). It can only be used when the customer is present on the checkout page.
///
/// | Value | Description |
/// | ----- | ----------- |
/// | `customer` | Restrict this payment method to customer-initiated transactions only. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Update the value of `saved_for` from `merchant` to `customer`.\n\nOnce updated, this payment method can no longer be used for merchant-initiated transactions (MIT). It can only be used when the customer is present on the checkout page.\n\n| Value | Description |\n| ----- | ----------- |\n| `customer` | Restrict this payment method to customer-initiated transactions only. |",
///  "type": "string",
///  "enum": [
///    "customer"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentMethodUpdateSavedFor {
    #[serde(rename = "customer")]
    Customer,
}
impl ::std::fmt::Display for PaymentMethodUpdateSavedFor {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Customer => f.write_str("customer"),
        }
    }
}
impl ::std::str::FromStr for PaymentMethodUpdateSavedFor {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "customer" => Ok(Self::Customer),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentMethodUpdateSavedFor {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentMethodUpdateSavedFor {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentMethodUpdateSavedFor {
    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 payment method used to make the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The details of the payment method used to make the payment.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Apple-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Card"
///    },
///    {
///      "$ref": "#/components/schemas/Google-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Revolut-Pay-Card"
///    },
///    {
///      "$ref": "#/components/schemas/Revolut-Pay-Account"
///    },
///    {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PaymentMethodV2 {
    ApplePay(ApplePay),
    Card(Card),
    GooglePay(GooglePay),
    RevolutPayCard(RevolutPayCard),
    RevolutPayAccount(RevolutPayAccount),
    SepaDirectDebit(SepaDirectDebit),
}
impl ::std::convert::From<ApplePay> for PaymentMethodV2 {
    fn from(value: ApplePay) -> Self {
        Self::ApplePay(value)
    }
}
impl ::std::convert::From<Card> for PaymentMethodV2 {
    fn from(value: Card) -> Self {
        Self::Card(value)
    }
}
impl ::std::convert::From<GooglePay> for PaymentMethodV2 {
    fn from(value: GooglePay) -> Self {
        Self::GooglePay(value)
    }
}
impl ::std::convert::From<RevolutPayCard> for PaymentMethodV2 {
    fn from(value: RevolutPayCard) -> Self {
        Self::RevolutPayCard(value)
    }
}
impl ::std::convert::From<RevolutPayAccount> for PaymentMethodV2 {
    fn from(value: RevolutPayAccount) -> Self {
        Self::RevolutPayAccount(value)
    }
}
impl ::std::convert::From<SepaDirectDebit> for PaymentMethodV2 {
    fn from(value: SepaDirectDebit) -> Self {
        Self::SepaDirectDebit(value)
    }
}
/// A saved payment method on a customer profile.
///
/// Use the `type` field to determine the specific payment method variant.
///
/// :::note
/// This schema represents a stored credential available for future charges and supports three types: `card`, `revolut_pay`, and `sepa_direct_debit`.
///
/// It differs from the `payment_method` object on a Payment, which is a transactional snapshot of how a specific charge was executed and includes additional detail such as wallet wrappers (`apple_pay`, `google_pay`) and Revolut Pay funding source (`revolut_pay_card` vs `revolut_pay_account`).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payment method",
///  "description": "A saved payment method on a customer profile.\n\nUse the `type` field to determine the specific payment method variant.\n\n:::note\nThis schema represents a stored credential available for future charges and supports three types: `card`, `revolut_pay`, and `sepa_direct_debit`.\n\nIt differs from the `payment_method` object on a Payment, which is a transactional snapshot of how a specific charge was executed and includes additional detail such as wallet wrappers (`apple_pay`, `google_pay`) and Revolut Pay funding source (`revolut_pay_card` vs `revolut_pay_account`).\n:::",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Card-v2"
///    },
///    {
///      "$ref": "#/components/schemas/Revolut-Pay-v2"
///    },
///    {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-v2"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PaymentMethodV4 {
    CardV2(CardV2),
    RevolutPayV2(RevolutPayV2),
    SepaDirectDebitV2(SepaDirectDebitV2),
}
impl ::std::convert::From<CardV2> for PaymentMethodV4 {
    fn from(value: CardV2) -> Self {
        Self::CardV2(value)
    }
}
impl ::std::convert::From<RevolutPayV2> for PaymentMethodV4 {
    fn from(value: RevolutPayV2) -> Self {
        Self::RevolutPayV2(value)
    }
}
impl ::std::convert::From<SepaDirectDebitV2> for PaymentMethodV4 {
    fn from(value: SepaDirectDebitV2) -> Self {
        Self::SepaDirectDebitV2(value)
    }
}
///`PaymentRetrieval`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id",
///    "order_id",
///    "payment_method"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payment-Amount"
///    },
///    "authentication_challenge": {
///      "$ref": "#/components/schemas/Authentication-Challenge"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "decline_reason": {
///      "$ref": "#/components/schemas/Decline-Reason-v2"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Id"
///    },
///    "order_id": {
///      "$ref": "#/components/schemas/Order-Id"
///    },
///    "payment_method": {
///      "description": "The payment method used to pay for the order.",
///      "type": "object",
///      "oneOf": [
///        {
///          "$ref": "#/components/schemas/Revolut-Pay"
///        },
///        {
///          "$ref": "#/components/schemas/Card-For-Payment-Details"
///        },
///        {
///          "$ref": "#/components/schemas/Sepa-Direct-Debit"
///        }
///      ]
///    },
///    "state": {
///      "$ref": "#/components/schemas/Payment-State-v2"
///    },
///    "token": {
///      "$ref": "#/components/schemas/Payment-Token"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentRetrieval {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<PaymentAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authentication_challenge: ::std::option::Option<AuthenticationChallenge>,
    #[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 decline_reason: ::std::option::Option<DeclineReasonV2>,
    pub id: PaymentId,
    pub order_id: OrderId,
    ///The payment method used to pay for the order.
    pub payment_method: PaymentRetrievalPaymentMethod,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub state: ::std::option::Option<PaymentStateV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token: ::std::option::Option<PaymentToken>,
}
///The payment method used to pay for the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The payment method used to pay for the order.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Revolut-Pay"
///    },
///    {
///      "$ref": "#/components/schemas/Card-For-Payment-Details"
///    },
///    {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PaymentRetrievalPaymentMethod {
    RevolutPay(RevolutPay),
    CardForPaymentDetails(CardForPaymentDetails),
    SepaDirectDebit(SepaDirectDebit),
}
impl ::std::convert::From<RevolutPay> for PaymentRetrievalPaymentMethod {
    fn from(value: RevolutPay) -> Self {
        Self::RevolutPay(value)
    }
}
impl ::std::convert::From<CardForPaymentDetails> for PaymentRetrievalPaymentMethod {
    fn from(value: CardForPaymentDetails) -> Self {
        Self::CardForPaymentDetails(value)
    }
}
impl ::std::convert::From<SepaDirectDebit> for PaymentRetrievalPaymentMethod {
    fn from(value: SepaDirectDebit) -> Self {
        Self::SepaDirectDebit(value)
    }
}
/// Represents a payment for an order.
///
/// For pre-authorised payments, the `authorised_amount` field tracks the currently authorised amount, which may differ from `amount` during incremental authorisation processing.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Represents a payment for an order.\n\nFor pre-authorised payments, the `authorised_amount` field tracks the currently authorised amount, which may differ from `amount` during incremental authorisation processing.",
///  "type": "object",
///  "required": [
///    "amount",
///    "created_at",
///    "id",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payment-Amount"
///    },
///    "authentication_challenge": {
///      "$ref": "#/components/schemas/Authentication-Challenge-v2"
///    },
///    "authorised_amount": {
///      "$ref": "#/components/schemas/Payment-Authorised-Amount"
///    },
///    "bank_message": {
///      "$ref": "#/components/schemas/Bank-Message"
///    },
///    "billing_address": {
///      "$ref": "#/components/schemas/Address-v2"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/Payment-Created"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "decline_reason": {
///      "$ref": "#/components/schemas/Decline-Reason-v2"
///    },
///    "fees": {
///      "$ref": "#/components/schemas/Fees"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Id"
///    },
///    "order_id": {
///      "description": "The ID of the associated order.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "payer": {
///      "$ref": "#/components/schemas/Payer"
///    },
///    "payment_method": {
///      "$ref": "#/components/schemas/Payment-Method-v2"
///    },
///    "risk_level": {
///      "$ref": "#/components/schemas/Payment-Risk-Level"
///    },
///    "settled_amount": {
///      "$ref": "#/components/schemas/Payment-Settled-Amount"
///    },
///    "settled_currency": {
///      "$ref": "#/components/schemas/Payment-Settled-Currency"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Payment-State-v2"
///    },
///    "token": {
///      "$ref": "#/components/schemas/Payment-Token"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/Payment-Updated"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentRetrievalV3 {
    pub amount: PaymentAmount,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authentication_challenge: ::std::option::Option<AuthenticationChallengeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorised_amount: ::std::option::Option<PaymentAuthorisedAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bank_message: ::std::option::Option<BankMessage>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub billing_address: ::std::option::Option<AddressV2>,
    pub created_at: PaymentCreated,
    #[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 decline_reason: ::std::option::Option<DeclineReasonV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fees: ::std::option::Option<Fees>,
    pub id: PaymentId,
    ///The ID of the associated order.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub order_id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payer: ::std::option::Option<Payer>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_method: ::std::option::Option<PaymentMethodV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub risk_level: ::std::option::Option<PaymentRiskLevel>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settled_amount: ::std::option::Option<PaymentSettledAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settled_currency: ::std::option::Option<PaymentSettledCurrency>,
    pub state: PaymentStateV2,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token: ::std::option::Option<PaymentToken>,
    pub updated_at: PaymentUpdated,
}
/// The risk level of the card.
///
/// If the risk level is `high`, the payment might be declined.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The risk level of the card.\n\nIf the risk level is `high`, the payment might be declined.",
///  "type": "string",
///  "enum": [
///    "low",
///    "high"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentRiskLevel {
    #[serde(rename = "low")]
    Low,
    #[serde(rename = "high")]
    High,
}
impl ::std::fmt::Display for PaymentRiskLevel {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Low => f.write_str("low"),
            Self::High => f.write_str("high"),
        }
    }
}
impl ::std::str::FromStr for PaymentRiskLevel {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "low" => Ok(Self::Low),
            "high" => Ok(Self::High),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentRiskLevel {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentRiskLevel {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentRiskLevel {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The amount of the settled payment (minor currency unit). For example, `7034` stands for €70.34.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount of the settled payment (minor currency unit). For example, `7034` stands for €70.34.",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentSettledAmount(pub i64);
impl ::std::ops::Deref for PaymentSettledAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<PaymentSettledAmount> for i64 {
    fn from(value: PaymentSettledAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for PaymentSettledAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentSettledAmount {
    type Err = <i64 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 PaymentSettledAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PaymentSettledAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PaymentSettledAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The currency of the settled payment. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// :::info
/// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The currency of the settled payment. [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct PaymentSettledCurrency(pub ::std::string::String);
impl ::std::ops::Deref for PaymentSettledCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PaymentSettledCurrency> for ::std::string::String {
    fn from(value: PaymentSettledCurrency) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for PaymentSettledCurrency {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentSettledCurrency {
    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 PaymentSettledCurrency {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The status of the payment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The status of the payment.",
///  "type": "string",
///  "enum": [
///    "pending",
///    "authentication_challenge",
///    "authentication_verified",
///    "authorisation_started",
///    "authorisation_passed",
///    "authorised",
///    "capture_started",
///    "captured",
///    "refund_validated",
///    "refund_started",
///    "cancellation_started",
///    "declining",
///    "completing",
///    "cancelling",
///    "failing",
///    "completed",
///    "declined",
///    "soft_declined",
///    "cancelled",
///    "failed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PaymentStateV2 {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "authentication_challenge")]
    AuthenticationChallenge,
    #[serde(rename = "authentication_verified")]
    AuthenticationVerified,
    #[serde(rename = "authorisation_started")]
    AuthorisationStarted,
    #[serde(rename = "authorisation_passed")]
    AuthorisationPassed,
    #[serde(rename = "authorised")]
    Authorised,
    #[serde(rename = "capture_started")]
    CaptureStarted,
    #[serde(rename = "captured")]
    Captured,
    #[serde(rename = "refund_validated")]
    RefundValidated,
    #[serde(rename = "refund_started")]
    RefundStarted,
    #[serde(rename = "cancellation_started")]
    CancellationStarted,
    #[serde(rename = "declining")]
    Declining,
    #[serde(rename = "completing")]
    Completing,
    #[serde(rename = "cancelling")]
    Cancelling,
    #[serde(rename = "failing")]
    Failing,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "declined")]
    Declined,
    #[serde(rename = "soft_declined")]
    SoftDeclined,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "failed")]
    Failed,
}
impl ::std::fmt::Display for PaymentStateV2 {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::AuthenticationChallenge => f.write_str("authentication_challenge"),
            Self::AuthenticationVerified => f.write_str("authentication_verified"),
            Self::AuthorisationStarted => f.write_str("authorisation_started"),
            Self::AuthorisationPassed => f.write_str("authorisation_passed"),
            Self::Authorised => f.write_str("authorised"),
            Self::CaptureStarted => f.write_str("capture_started"),
            Self::Captured => f.write_str("captured"),
            Self::RefundValidated => f.write_str("refund_validated"),
            Self::RefundStarted => f.write_str("refund_started"),
            Self::CancellationStarted => f.write_str("cancellation_started"),
            Self::Declining => f.write_str("declining"),
            Self::Completing => f.write_str("completing"),
            Self::Cancelling => f.write_str("cancelling"),
            Self::Failing => f.write_str("failing"),
            Self::Completed => f.write_str("completed"),
            Self::Declined => f.write_str("declined"),
            Self::SoftDeclined => f.write_str("soft_declined"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Failed => f.write_str("failed"),
        }
    }
}
impl ::std::str::FromStr for PaymentStateV2 {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "authentication_challenge" => Ok(Self::AuthenticationChallenge),
            "authentication_verified" => Ok(Self::AuthenticationVerified),
            "authorisation_started" => Ok(Self::AuthorisationStarted),
            "authorisation_passed" => Ok(Self::AuthorisationPassed),
            "authorised" => Ok(Self::Authorised),
            "capture_started" => Ok(Self::CaptureStarted),
            "captured" => Ok(Self::Captured),
            "refund_validated" => Ok(Self::RefundValidated),
            "refund_started" => Ok(Self::RefundStarted),
            "cancellation_started" => Ok(Self::CancellationStarted),
            "declining" => Ok(Self::Declining),
            "completing" => Ok(Self::Completing),
            "cancelling" => Ok(Self::Cancelling),
            "failing" => Ok(Self::Failing),
            "completed" => Ok(Self::Completed),
            "declined" => Ok(Self::Declined),
            "soft_declined" => Ok(Self::SoftDeclined),
            "cancelled" => Ok(Self::Cancelled),
            "failed" => Ok(Self::Failed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PaymentStateV2 {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PaymentStateV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PaymentStateV2 {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Temporary token of the payment used to fetch the reward offer during checkout and link user registrations to the given offers.
///
/// The token is only valid for a limited time.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Temporary token of the payment used to fetch the reward offer during checkout and link user registrations to the given offers. \n\nThe token is only valid for a limited time.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentToken(pub ::uuid::Uuid);
impl ::std::ops::Deref for PaymentToken {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PaymentToken> for ::uuid::Uuid {
    fn from(value: PaymentToken) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PaymentToken {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentToken {
    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 PaymentToken {
    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 PaymentToken {
    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 PaymentToken {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time the payment was last updated.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the payment was last updated.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PaymentUpdated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for PaymentUpdated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<PaymentUpdated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: PaymentUpdated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for PaymentUpdated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PaymentUpdated {
    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 PaymentUpdated {
    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 PaymentUpdated {
    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 PaymentUpdated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Represents a payment for an order.
///
/// For pre-authorised payments, the `authorised_amount` field tracks the currently authorised amount, which may differ from `amount` during incremental authorisation processing.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Represents a payment for an order.\n\nFor pre-authorised payments, the `authorised_amount` field tracks the currently authorised amount, which may differ from `amount` during incremental authorisation processing.",
///  "type": "object",
///  "required": [
///    "amount",
///    "created_at",
///    "id",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payment-Amount"
///    },
///    "authentication_challenge": {
///      "$ref": "#/components/schemas/Authentication-Challenge-v2"
///    },
///    "authorised_amount": {
///      "$ref": "#/components/schemas/Payment-Authorised-Amount"
///    },
///    "bank_message": {
///      "$ref": "#/components/schemas/Bank-Message"
///    },
///    "billing_address": {
///      "$ref": "#/components/schemas/Address-v2"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/Payment-Created"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "decline_reason": {
///      "$ref": "#/components/schemas/Decline-Reason-v2"
///    },
///    "fees": {
///      "$ref": "#/components/schemas/Fees"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Id"
///    },
///    "payer": {
///      "$ref": "#/components/schemas/Payer"
///    },
///    "payment_method": {
///      "$ref": "#/components/schemas/Payment-Method-v2"
///    },
///    "risk_level": {
///      "$ref": "#/components/schemas/Payment-Risk-Level"
///    },
///    "settled_amount": {
///      "$ref": "#/components/schemas/Payment-Settled-Amount"
///    },
///    "settled_currency": {
///      "$ref": "#/components/schemas/Payment-Settled-Currency"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Payment-State-v2"
///    },
///    "token": {
///      "$ref": "#/components/schemas/Payment-Token"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/Payment-Updated"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaymentV3 {
    pub amount: PaymentAmount,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authentication_challenge: ::std::option::Option<AuthenticationChallengeV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorised_amount: ::std::option::Option<PaymentAuthorisedAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub bank_message: ::std::option::Option<BankMessage>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub billing_address: ::std::option::Option<AddressV2>,
    pub created_at: PaymentCreated,
    #[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 decline_reason: ::std::option::Option<DeclineReasonV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fees: ::std::option::Option<Fees>,
    pub id: PaymentId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payer: ::std::option::Option<Payer>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_method: ::std::option::Option<PaymentMethodV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub risk_level: ::std::option::Option<PaymentRiskLevel>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settled_amount: ::std::option::Option<PaymentSettledAmount>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub settled_currency: ::std::option::Option<PaymentSettledCurrency>,
    pub state: PaymentStateV2,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub token: ::std::option::Option<PaymentToken>,
    pub updated_at: PaymentUpdated,
}
///`Payout`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "destination_type",
///    "id",
///    "state"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Payout-Amount"
///    },
///    "created_at": {
///      "description": "The date and time the payout was created.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "destination_type": {
///      "$ref": "#/components/schemas/Payout-Destination-Type"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payout-Id"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Payout-State"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Payout {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<PayoutAmount>,
    ///The date and time the payout was created.
    pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<Currency>,
    pub destination_type: PayoutDestinationType,
    pub id: PayoutId,
    pub state: PayoutState,
}
///The total amount of the payout in minor currency units. For example, `7034` represents €70.34.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The total amount of the payout in minor currency units. For example, `7034` represents €70.34.",
///  "type": "integer",
///  "minimum": 1.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutAmount(pub ::std::num::NonZeroU64);
impl ::std::ops::Deref for PayoutAmount {
    type Target = ::std::num::NonZeroU64;
    fn deref(&self) -> &::std::num::NonZeroU64 {
        &self.0
    }
}
impl ::std::convert::From<PayoutAmount> for ::std::num::NonZeroU64 {
    fn from(value: PayoutAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::num::NonZeroU64> for PayoutAmount {
    fn from(value: ::std::num::NonZeroU64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutAmount {
    type Err = <::std::num::NonZeroU64 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 PayoutAmount {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for PayoutAmount {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for PayoutAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The destination of the payout funds when a merchant initiates a withdrawal from their merchant account.
///
/// | Destination type | Description |
/// | ---------------- | ----------- |
/// | `current_pocket` | The funds were moved from the merchant account to the business account within the platform. This indicates an **internal transfer**, allowing the merchant to access the funds within their own business account. |
/// | `external_beneficiary` | The funds were transferred to an external bank account or beneficiary outside the platform. This indicates a **transfer to an external account**, enabling the merchant to withdraw funds to external financial institutions. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The destination of the payout funds when a merchant initiates a withdrawal from their merchant account.\n\n| Destination type | Description |\n| ---------------- | ----------- |\n| `current_pocket` | The funds were moved from the merchant account to the business account within the platform. This indicates an **internal transfer**, allowing the merchant to access the funds within their own business account. |\n| `external_beneficiary` | The funds were transferred to an external bank account or beneficiary outside the platform. This indicates a **transfer to an external account**, enabling the merchant to withdraw funds to external financial institutions. |",
///  "type": "string",
///  "enum": [
///    "current_pocket",
///    "external_beneficiary"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutDestinationType {
    #[serde(rename = "current_pocket")]
    CurrentPocket,
    #[serde(rename = "external_beneficiary")]
    ExternalBeneficiary,
}
impl ::std::fmt::Display for PayoutDestinationType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::CurrentPocket => f.write_str("current_pocket"),
            Self::ExternalBeneficiary => f.write_str("external_beneficiary"),
        }
    }
}
impl ::std::str::FromStr for PayoutDestinationType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "current_pocket" => Ok(Self::CurrentPocket),
            "external_beneficiary" => Ok(Self::ExternalBeneficiary),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutDestinationType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PayoutDestinationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PayoutDestinationType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Permanent payout ID used for payouts operations.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Permanent payout ID used for payouts operations.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PayoutId(pub ::uuid::Uuid);
impl ::std::ops::Deref for PayoutId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<PayoutId> for ::uuid::Uuid {
    fn from(value: PayoutId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for PayoutId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for PayoutId {
    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 PayoutId {
    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 PayoutId {
    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 PayoutId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The state of the payout.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of the payout.",
///  "type": "string",
///  "enum": [
///    "processing",
///    "completed",
///    "failed"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum PayoutState {
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "failed")]
    Failed,
}
impl ::std::fmt::Display for PayoutState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Processing => f.write_str("processing"),
            Self::Completed => f.write_str("completed"),
            Self::Failed => f.write_str("failed"),
        }
    }
}
impl ::std::str::FromStr for PayoutState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "processing" => Ok(Self::Processing),
            "completed" => Ok(Self::Completed),
            "failed" => Ok(Self::Failed),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for PayoutState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PayoutState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PayoutState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The phone number of the customer in [E.164 format](https://en.wikipedia.org/wiki/E.164).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The phone number of the customer in [E.164 format](https://en.wikipedia.org/wiki/E.164).",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Phone(pub ::std::string::String);
impl ::std::ops::Deref for Phone {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<Phone> for ::std::string::String {
    fn from(value: Phone) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for Phone {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for Phone {
    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 Phone {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The unique identifier of the previous billing cycle.
///
/// This field is `null` for the first cycle in a subscription.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique identifier of the previous billing cycle.\n\nThis field is `null` for the first cycle in a subscription.",
///  "type": [
///    "string",
///    "null"
///  ],
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PreviousCycleId(pub ::std::option::Option<::uuid::Uuid>);
impl ::std::ops::Deref for PreviousCycleId {
    type Target = ::std::option::Option<::uuid::Uuid>;
    fn deref(&self) -> &::std::option::Option<::uuid::Uuid> {
        &self.0
    }
}
impl ::std::convert::From<PreviousCycleId> for ::std::option::Option<::uuid::Uuid> {
    fn from(value: PreviousCycleId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::option::Option<::uuid::Uuid>> for PreviousCycleId {
    fn from(value: ::std::option::Option<::uuid::Uuid>) -> Self {
        Self(value)
    }
}
///Object representing the quantity details of a line item, including the amount and its associated unit of measurement.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object representing the quantity details of a line item, including the amount and its associated unit of measurement.",
///  "type": "object",
///  "required": [
///    "value"
///  ],
///  "properties": {
///    "unit": {
///      "description": "The measurement unit for the quantity, such as `cm`, or `kg`.",
///      "type": "string",
///      "maxLength": 100
///    },
///    "value": {
///      "description": "The number of units of the line item.",
///      "type": "number",
///      "format": "double",
///      "minimum": 0.0
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Quantity {
    ///The measurement unit for the quantity, such as `cm`, or `kg`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub unit: ::std::option::Option<QuantityUnit>,
    ///The number of units of the line item.
    pub value: f64,
}
///The measurement unit for the quantity, such as `cm`, or `kg`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The measurement unit for the quantity, such as `cm`, or `kg`.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct QuantityUnit(::std::string::String);
impl ::std::ops::Deref for QuantityUnit {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<QuantityUnit> for ::std::string::String {
    fn from(value: QuantityUnit) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for QuantityUnit {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for QuantityUnit {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for QuantityUnit {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for QuantityUnit {
    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 QuantityUnit {
    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())
            })
    }
}
///`RPayAccount`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "required": [
///    "subtype",
///    "type"
///  ],
///  "properties": {
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned if the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "subtype": {
///      "description": "Indicates whether the customer used their card or Revolut account via Revolut Pay.",
///      "type": "string",
///      "enum": [
///        "revolut_account",
///        "card"
///      ]
///    },
///    "type": {
///      "description": "The type of payment method used to pay for the order.",
///      "type": "string",
///      "enum": [
///        "card",
///        "revolut_pay"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RPayAccount {
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned if the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    ///Indicates whether the customer used their card or Revolut account via Revolut Pay.
    pub subtype: RPayAccountSubtype,
    ///The type of payment method used to pay for the order.
    #[serde(rename = "type")]
    pub type_: RPayAccountType,
}
///Indicates whether the customer used their card or Revolut account via Revolut Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the customer used their card or Revolut account via Revolut Pay.",
///  "type": "string",
///  "enum": [
///    "revolut_account",
///    "card"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RPayAccountSubtype {
    #[serde(rename = "revolut_account")]
    RevolutAccount,
    #[serde(rename = "card")]
    Card,
}
impl ::std::fmt::Display for RPayAccountSubtype {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::RevolutAccount => f.write_str("revolut_account"),
            Self::Card => f.write_str("card"),
        }
    }
}
impl ::std::str::FromStr for RPayAccountSubtype {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "revolut_account" => Ok(Self::RevolutAccount),
            "card" => Ok(Self::Card),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RPayAccountSubtype {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RPayAccountSubtype {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RPayAccountSubtype {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The type of payment method used to pay for the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of payment method used to pay for the order.",
///  "type": "string",
///  "enum": [
///    "card",
///    "revolut_pay"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RPayAccountType {
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "revolut_pay")]
    RevolutPay,
}
impl ::std::fmt::Display for RPayAccountType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Card => f.write_str("card"),
            Self::RevolutPay => f.write_str("revolut_pay"),
        }
    }
}
impl ::std::str::FromStr for RPayAccountType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "card" => Ok(Self::Card),
            "revolut_pay" => Ok(Self::RevolutPay),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RPayAccountType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RPayAccountType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RPayAccountType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`RPayCard`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "required": [
///    "subtype",
///    "type"
///  ],
///  "properties": {
///    "brand": {
///      "description": "The type of the card.",
///      "type": "string"
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned if the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string"
///    },
///    "subtype": {
///      "description": "Indicates whether the customer used their card or Revolut account via Revolut Pay.",
///      "type": "string",
///      "enum": [
///        "revolut_account",
///        "card"
///      ]
///    },
///    "type": {
///      "description": "The type of payment method used to pay for the order.",
///      "type": "string",
///      "enum": [
///        "card",
///        "revolut_pay"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RPayCard {
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub brand: ::std::option::Option<::std::string::String>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned if the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub last_four: ::std::option::Option<::std::string::String>,
    ///Indicates whether the customer used their card or Revolut account via Revolut Pay.
    pub subtype: RPayCardSubtype,
    ///The type of payment method used to pay for the order.
    #[serde(rename = "type")]
    pub type_: RPayCardType,
}
///Indicates whether the customer used their card or Revolut account via Revolut Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether the customer used their card or Revolut account via Revolut Pay.",
///  "type": "string",
///  "enum": [
///    "revolut_account",
///    "card"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RPayCardSubtype {
    #[serde(rename = "revolut_account")]
    RevolutAccount,
    #[serde(rename = "card")]
    Card,
}
impl ::std::fmt::Display for RPayCardSubtype {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::RevolutAccount => f.write_str("revolut_account"),
            Self::Card => f.write_str("card"),
        }
    }
}
impl ::std::str::FromStr for RPayCardSubtype {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "revolut_account" => Ok(Self::RevolutAccount),
            "card" => Ok(Self::Card),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RPayCardSubtype {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RPayCardSubtype {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RPayCardSubtype {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The type of payment method used to pay for the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of payment method used to pay for the order.",
///  "type": "string",
///  "enum": [
///    "card",
///    "revolut_pay"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RPayCardType {
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "revolut_pay")]
    RevolutPay,
}
impl ::std::fmt::Display for RPayCardType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Card => f.write_str("card"),
            Self::RevolutPay => f.write_str("revolut_pay"),
        }
    }
}
impl ::std::str::FromStr for RPayCardType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "card" => Ok(Self::Card),
            "revolut_pay" => Ok(Self::RevolutPay),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RPayCardType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RPayCardType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RPayCardType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The URL your customer will be redirected to after a successful payment on the hosted checkout page (`checkout_url` parameter's value of the order).
///
/// :::caution
/// Restrictions:
/// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
/// - URI scheme is required and must be either `http` or `https`
/// - URI host is required and cannot be `localhost` or an IP address
/// - Max length: `2000`
/// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
/// :::
///
/// :::info
/// For more information on how to use the `redirect_url`, see: [Custom redirection via the API](https://developer.revolut.com/docs/guides/merchant/accept-payments/online-payments/hosted-checkout-page/api#custom-post-payment-redirection-optional)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The URL your customer will be redirected to after a successful payment on the hosted checkout page (`checkout_url` parameter's value of the order).\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::\n\n:::info\nFor more information on how to use the `redirect_url`, see: [Custom redirection via the API](https://developer.revolut.com/docs/guides/merchant/accept-payments/online-payments/hosted-checkout-page/api#custom-post-payment-redirection-optional)\n:::",
///  "type": "string",
///  "format": "uri",
///  "maxLength": 2000,
///  "pattern": "^https?:\\/{2}.+/gi"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct RedirectUrl(pub ::std::string::String);
impl ::std::ops::Deref for RedirectUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<RedirectUrl> for ::std::string::String {
    fn from(value: RedirectUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for RedirectUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for RedirectUrl {
    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 RedirectUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The amount to be refunded, specified in the smallest currency unit (e.g., cents for USD, pence for GBP).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount to be refunded, specified in the smallest currency unit (e.g., cents for USD, pence for GBP).",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct RefundAmount(pub i64);
impl ::std::ops::Deref for RefundAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<RefundAmount> for i64 {
    fn from(value: RefundAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for RefundAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for RefundAmount {
    type Err = <i64 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 RefundAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for RefundAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for RefundAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// **Must match the `currency` of the original order to be refunded.**
///
/// :::info
/// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.\n\n**Must match the `currency` of the original order to be refunded.**\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///  "type": "string",
///  "format": "ISO 4217",
///  "maxLength": 3,
///  "minLength": 3
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct RefundCurrency(pub ::std::string::String);
impl ::std::ops::Deref for RefundCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<RefundCurrency> for ::std::string::String {
    fn from(value: RefundCurrency) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for RefundCurrency {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for RefundCurrency {
    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 RefundCurrency {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Parameter indicating whether the booking is refundable, partially refundable, or not refundable.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Parameter indicating whether the booking is refundable, partially refundable, or not refundable.",
///  "type": "string",
///  "enum": [
///    "refundable",
///    "non_refundable",
///    "partially_refundable"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum Refundability {
    #[serde(rename = "refundable")]
    Refundable,
    #[serde(rename = "non_refundable")]
    NonRefundable,
    #[serde(rename = "partially_refundable")]
    PartiallyRefundable,
}
impl ::std::fmt::Display for Refundability {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Refundable => f.write_str("refundable"),
            Self::NonRefundable => f.write_str("non_refundable"),
            Self::PartiallyRefundable => f.write_str("partially_refundable"),
        }
    }
}
impl ::std::str::FromStr for Refundability {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "refundable" => Ok(Self::Refundable),
            "non_refundable" => Ok(Self::NonRefundable),
            "partially_refundable" => Ok(Self::PartiallyRefundable),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for Refundability {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for Refundability {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for Refundability {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The amount that was refunded from the order (in minor currency units). For example, `7034` represents €70.34.
///
/// This applies to orders that have been refunded (i.e., orders of type `payment` that have a related `refund` order).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The amount that was refunded from the order (in minor currency units). For example, `7034` represents €70.34. \n\nThis applies to orders that have been refunded (i.e., orders of type `payment` that have a related `refund` order).",
///  "type": "integer"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct RefundedAmount(pub i64);
impl ::std::ops::Deref for RefundedAmount {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<RefundedAmount> for i64 {
    fn from(value: RefundedAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for RefundedAmount {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for RefundedAmount {
    type Err = <i64 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 RefundedAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for RefundedAmount {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for RefundedAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The unique ID of the original order that was refunded and this refund is associated with. You can use this ID to get more information about the related order using the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) operation.
///
/// :::note
/// This field is only returned for orders with `type: refund`.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique ID of the original order that was refunded and this refund is associated with. You can use this ID to get more information about the related order using the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) operation.\n\n:::note\nThis field is only returned for orders with `type: refund`.\n:::",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct RelatedOrderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for RelatedOrderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<RelatedOrderId> for ::uuid::Uuid {
    fn from(value: RelatedOrderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for RelatedOrderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for RelatedOrderId {
    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 RelatedOrderId {
    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 RelatedOrderId {
    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 RelatedOrderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Select transactions with specific currencies to include in the report. Provide [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// :::info
/// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Select transactions with specific currencies to include in the report. Provide [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///  "type": "string",
///  "maxLength": 3,
///  "minLength": 3
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ReportRunCurrency(::std::string::String);
impl ::std::ops::Deref for ReportRunCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ReportRunCurrency> for ::std::string::String {
    fn from(value: ReportRunCurrency) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ReportRunCurrency {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 3usize {
            return Err("longer than 3 characters".into());
        }
        if value.chars().count() < 3usize {
            return Err("shorter than 3 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunCurrency {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunCurrency {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunCurrency {
    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 ReportRunCurrency {
    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 custom report contains all the query information for generating reports of selected transactions associated with a Merchant account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Custom report",
///  "description": "A custom report contains all the query information for generating reports of selected transactions associated with a Merchant account.",
///  "type": "object",
///  "required": [
///    "filter",
///    "format",
///    "type"
///  ],
///  "properties": {
///    "filter": {
///      "$ref": "#/components/schemas/Report-Run-Filter"
///    },
///    "format": {
///      "$ref": "#/components/schemas/Report-Run-Format"
///    },
///    "options": {
///      "$ref": "#/components/schemas/Report-Run-Options"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Report-Run-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunCustomReport {
    pub filter: ReportRunFilter,
    pub format: ReportRunFormat,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub options: ::std::option::Option<ReportRunOptions>,
    #[serde(rename = "type")]
    pub type_: ReportRunType,
}
///The `ReportRunDetails` object contains all information associated with a specific report run, identified by the `report_run_id`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "ReportRunDetails",
///  "description": "The `ReportRunDetails` object contains all information associated with a specific report run, identified by the `report_run_id`.",
///  "type": "object",
///  "required": [
///    "report_run_id",
///    "status"
///  ],
///  "properties": {
///    "file_url": {
///      "description": "Use this link to download report file. Not available, until `status` is `completed`.",
///      "type": "string"
///    },
///    "report_run_id": {
///      "description": "Unique ID used for accessing report details. Use this to check report generation status.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "status": {
///      "description": "Current status of the report run.",
///      "type": "string",
///      "enum": [
///        "processing",
///        "completed",
///        "failed",
///        "expired"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunDetails {
    ///Use this link to download report file. Not available, until `status` is `completed`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub file_url: ::std::option::Option<::std::string::String>,
    ///Unique ID used for accessing report details. Use this to check report generation status.
    pub report_run_id: ::uuid::Uuid,
    ///Current status of the report run.
    pub status: ReportRunDetailsStatus,
}
///Current status of the report run.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Current status of the report run.",
///  "type": "string",
///  "enum": [
///    "processing",
///    "completed",
///    "failed",
///    "expired"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunDetailsStatus {
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "expired")]
    Expired,
}
impl ::std::fmt::Display for ReportRunDetailsStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Processing => f.write_str("processing"),
            Self::Completed => f.write_str("completed"),
            Self::Failed => f.write_str("failed"),
            Self::Expired => f.write_str("expired"),
        }
    }
}
impl ::std::str::FromStr for ReportRunDetailsStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "processing" => Ok(Self::Processing),
            "completed" => Ok(Self::Completed),
            "failed" => Ok(Self::Failed),
            "expired" => Ok(Self::Expired),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunDetailsStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunDetailsStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunDetailsStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Select transactions by state to be included in the report.
///
/// If not provided, only `completed` transactions will be included in the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Select transactions by state to be included in the report.\n\nIf not provided, only `completed` transactions will be included in the report.",
///  "type": "array",
///  "items": {
///    "type": "string",
///    "enum": [
///      "completed",
///      "processing",
///      "cancelled",
///      "reverted"
///    ]
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunEntityStates(pub ::std::vec::Vec<ReportRunEntityStatesItem>);
impl ::std::ops::Deref for ReportRunEntityStates {
    type Target = ::std::vec::Vec<ReportRunEntityStatesItem>;
    fn deref(&self) -> &::std::vec::Vec<ReportRunEntityStatesItem> {
        &self.0
    }
}
impl ::std::convert::From<ReportRunEntityStates> for ::std::vec::Vec<ReportRunEntityStatesItem> {
    fn from(value: ReportRunEntityStates) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<ReportRunEntityStatesItem>> for ReportRunEntityStates {
    fn from(value: ::std::vec::Vec<ReportRunEntityStatesItem>) -> Self {
        Self(value)
    }
}
///`ReportRunEntityStatesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "enum": [
///    "completed",
///    "processing",
///    "cancelled",
///    "reverted"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunEntityStatesItem {
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "reverted")]
    Reverted,
}
impl ::std::fmt::Display for ReportRunEntityStatesItem {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Completed => f.write_str("completed"),
            Self::Processing => f.write_str("processing"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Reverted => f.write_str("reverted"),
        }
    }
}
impl ::std::str::FromStr for ReportRunEntityStatesItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "completed" => Ok(Self::Completed),
            "processing" => Ok(Self::Processing),
            "cancelled" => Ok(Self::Cancelled),
            "reverted" => Ok(Self::Reverted),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Select transactions by type to be included in the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Select transactions by type to be included in the report.",
///  "type": "array",
///  "items": {
///    "type": "string",
///    "enum": [
///      "payment",
///      "refund",
///      "dispute"
///    ]
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunEntityTypes(pub ::std::vec::Vec<ReportRunEntityTypesItem>);
impl ::std::ops::Deref for ReportRunEntityTypes {
    type Target = ::std::vec::Vec<ReportRunEntityTypesItem>;
    fn deref(&self) -> &::std::vec::Vec<ReportRunEntityTypesItem> {
        &self.0
    }
}
impl ::std::convert::From<ReportRunEntityTypes> for ::std::vec::Vec<ReportRunEntityTypesItem> {
    fn from(value: ReportRunEntityTypes) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<ReportRunEntityTypesItem>> for ReportRunEntityTypes {
    fn from(value: ::std::vec::Vec<ReportRunEntityTypesItem>) -> Self {
        Self(value)
    }
}
///`ReportRunEntityTypesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "enum": [
///    "payment",
///    "refund",
///    "dispute"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunEntityTypesItem {
    #[serde(rename = "payment")]
    Payment,
    #[serde(rename = "refund")]
    Refund,
    #[serde(rename = "dispute")]
    Dispute,
}
impl ::std::fmt::Display for ReportRunEntityTypesItem {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Payment => f.write_str("payment"),
            Self::Refund => f.write_str("refund"),
            Self::Dispute => f.write_str("dispute"),
        }
    }
}
impl ::std::str::FromStr for ReportRunEntityTypesItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "payment" => Ok(Self::Payment),
            "refund" => Ok(Self::Refund),
            "dispute" => Ok(Self::Dispute),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunEntityTypesItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunEntityTypesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunEntityTypesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`ReportRunError`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Report run error",
///  "type": "object",
///  "required": [
///    "code",
///    "message",
///    "timestamp"
///  ],
///  "properties": {
///    "code": {
///      "description": "An identifier that can be used to determine what went wrong.\n\nError codes are not globally unique, but uniqueness is guaranteed within\nendpoints.",
///      "type": "string"
///    },
///    "message": {
///      "description": "Some human readable text describing what went wrong.",
///      "type": "string"
///    },
///    "timestamp": {
///      "description": "The date and time the error happened.",
///      "type": "integer"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunError {
    /// An identifier that can be used to determine what went wrong.
    ///
    /// Error codes are not globally unique, but uniqueness is guaranteed within
    /// endpoints.
    pub code: ::std::string::String,
    ///Some human readable text describing what went wrong.
    pub message: ::std::string::String,
    ///The date and time the error happened.
    pub timestamp: i64,
}
///Filtering parameters to be applied to the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Filtering parameters to be applied to the report.",
///  "type": "object",
///  "required": [
///    "from",
///    "to"
///  ],
///  "properties": {
///    "currency": {
///      "$ref": "#/components/schemas/Report-Run-Currency"
///    },
///    "entity_states": {
///      "$ref": "#/components/schemas/Report-Run-Entity-States"
///    },
///    "entity_types": {
///      "$ref": "#/components/schemas/Report-Run-Entity-Types"
///    },
///    "from": {
///      "$ref": "#/components/schemas/Report-Run-From"
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Report-Run-Location-Id"
///    },
///    "to": {
///      "$ref": "#/components/schemas/Report-Run-To"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunFilter {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub currency: ::std::option::Option<ReportRunCurrency>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub entity_states: ::std::option::Option<ReportRunEntityStates>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub entity_types: ::std::option::Option<ReportRunEntityTypes>,
    pub from: ReportRunFrom,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<ReportRunLocationId>,
    pub to: ReportRunTo,
}
///Format of the generated report file.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Format of the generated report file.",
///  "type": "string",
///  "enum": [
///    "csv"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunFormat {
    #[serde(rename = "csv")]
    Csv,
}
impl ::std::fmt::Display for ReportRunFormat {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Csv => f.write_str("csv"),
        }
    }
}
impl ::std::str::FromStr for ReportRunFormat {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "csv" => Ok(Self::Csv),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunFormat {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunFormat {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunFormat {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// This parameter specifies the start boundary for filtering transaction data in the report based on an order's `payments.created_at` parameter. It accepts ETC/UTC date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) and includes all transactions created on or after this timestamp.
///
/// Combined with the `to` parameter, this determines the report's timeframe, including all transactions between the two values.
///
/// For example, by setting the `from` parameter to `2021-01-01T00:00:00Z`, the report will include transactions created from the first second of January 1, 2021, UTC, and onwards.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "This parameter specifies the start boundary for filtering transaction data in the report based on an order's `payments.created_at` parameter. It accepts ETC/UTC date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) and includes all transactions created on or after this timestamp.\n\nCombined with the `to` parameter, this determines the report's timeframe, including all transactions between the two values. \n\nFor example, by setting the `from` parameter to `2021-01-01T00:00:00Z`, the report will include transactions created from the first second of January 1, 2021, UTC, and onwards.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunFrom(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for ReportRunFrom {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<ReportRunFrom> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: ReportRunFrom) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for ReportRunFrom {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ReportRunFrom {
    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 ReportRunFrom {
    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 ReportRunFrom {
    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 ReportRunFrom {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Filtering parameters to be applied to the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Filtering parameters to be applied to the report.",
///  "type": "object",
///  "required": [
///    "icpp_charge_id"
///  ],
///  "properties": {
///    "icpp_charge_id": {
///      "$ref": "#/components/schemas/Icpp-Charge-Id"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunIcppFilter {
    pub icpp_charge_id: IcppChargeId,
}
///A IC++ fee breakdown report contains all the query information for generating reports of fees for each IC++ transaction related to a payout.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "IC++ fee breakdown report",
///  "description": "A IC++ fee breakdown report contains all the query information for generating reports of fees for each IC++ transaction related to a payout.",
///  "type": "object",
///  "required": [
///    "filter",
///    "format",
///    "type"
///  ],
///  "properties": {
///    "filter": {
///      "$ref": "#/components/schemas/Report-Run-Icpp-Filter"
///    },
///    "format": {
///      "$ref": "#/components/schemas/Report-Run-Format"
///    },
///    "options": {
///      "$ref": "#/components/schemas/Report-Run-Options"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Report-Run-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunIcppReport {
    pub filter: ReportRunIcppFilter,
    pub format: ReportRunFormat,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub options: ::std::option::Option<ReportRunOptions>,
    #[serde(rename = "type")]
    pub type_: ReportRunType,
}
/// Select transactions by location ID to be included in the report.
///
/// :::info
/// For more information, see: [Locations](https://developer.revolut.com/docs/merchant/locations).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Select transactions by location ID to be included in the report.\n\n:::info\nFor more information, see: [Locations](https://developer.revolut.com/docs/merchant/locations).\n:::        ",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunLocationId(pub ::uuid::Uuid);
impl ::std::ops::Deref for ReportRunLocationId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<ReportRunLocationId> for ::uuid::Uuid {
    fn from(value: ReportRunLocationId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for ReportRunLocationId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ReportRunLocationId {
    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 ReportRunLocationId {
    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 ReportRunLocationId {
    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 ReportRunLocationId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Further options to customize the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Further options to customize the report.",
///  "type": "object",
///  "properties": {
///    "columns": {
///      "description": "Names of the columns to be included in the report.\n\nIf the `columns` parameter is not defined in the request, all available columns will be included in the report. An empty array will return an error.\n\nIf you created orders using the `metadata` object, you can include them in the report by adding them with `metadata.` prefix. For example: `metadata.custom_attribute`.\n\nAvailable columns:\n\n  | Column name | Description |\n  | ----------- | ----------- |\n  | `transaction_id` | Unique identifier of the transaction related to an order. |\n  | `order_id` | Unique identifier of the order. |\n  | `started_date` | Date and time the transaction was created. |\n  | `updated_date` | Date and time the transaction was last updated. |\n  | `completed_date` | Date and time the transaction was completed. |\n  | `type` | Type of the order. |\n  | `state` | State of the order. |\n  | `description` | Description of the order. |\n  | `merchant_order_ext_ref` | Merchant's order identifier for external reference. |\n  | `customer_id` | Unique identifier of the customer related to an order. |\n  | `amount` | Total amount of the order. |\n  | `currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of the order. |\n  | `settlement_amount` | Total amount settled on the merchant's account. |\n  | `settlement_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of the settled amount. |\n  | `fee_amount` | Total amount of extra fees applied to the order. |\n  | `fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of extra fees. |\n  | `processing_fee_amount` | Total amount of processing fees applied to the order. |\n  | `processing_fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of processing fees. |\n  | `payment_method` | Type of the payment method the customer used to pay for the order. |\n  | `browser_url` | The URL where the customer initiated the payment. |\n  | `related_icpp_charge_id` | Unique identifier of the IC++ charge related to the transaction. **This column is only available in the `payout_statement_report`.** |\n  | `location_id` | Unique identifier of the location related to the transaction. **This column is only available in `settlement_report` and `custom_report`.** |",
///      "type": "array",
///      "items": {
///        "type": "string"
///      }
///    },
///    "timezone": {
///      "description": "Defaults to `ETC/UTC`. Defines the output timezone for all timestamps displayed in the report. \n\nHas no effect on `from` or `to` parameters.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunOptions {
    /// Names of the columns to be included in the report.
    ///
    /// If the `columns` parameter is not defined in the request, all available columns will be included in the report. An empty array will return an error.
    ///
    /// If you created orders using the `metadata` object, you can include them in the report by adding them with `metadata.` prefix. For example: `metadata.custom_attribute`.
    ///
    /// Available columns:
    ///
    ///   | Column name | Description |
    ///   | ----------- | ----------- |
    ///   | `transaction_id` | Unique identifier of the transaction related to an order. |
    ///   | `order_id` | Unique identifier of the order. |
    ///   | `started_date` | Date and time the transaction was created. |
    ///   | `updated_date` | Date and time the transaction was last updated. |
    ///   | `completed_date` | Date and time the transaction was completed. |
    ///   | `type` | Type of the order. |
    ///   | `state` | State of the order. |
    ///   | `description` | Description of the order. |
    ///   | `merchant_order_ext_ref` | Merchant's order identifier for external reference. |
    ///   | `customer_id` | Unique identifier of the customer related to an order. |
    ///   | `amount` | Total amount of the order. |
    ///   | `currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of the order. |
    ///   | `settlement_amount` | Total amount settled on the merchant's account. |
    ///   | `settlement_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of the settled amount. |
    ///   | `fee_amount` | Total amount of extra fees applied to the order. |
    ///   | `fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of extra fees. |
    ///   | `processing_fee_amount` | Total amount of processing fees applied to the order. |
    ///   | `processing_fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code that represents the currency of processing fees. |
    ///   | `payment_method` | Type of the payment method the customer used to pay for the order. |
    ///   | `browser_url` | The URL where the customer initiated the payment. |
    ///   | `related_icpp_charge_id` | Unique identifier of the IC++ charge related to the transaction. **This column is only available in the `payout_statement_report`.** |
    ///   | `location_id` | Unique identifier of the location related to the transaction. **This column is only available in `settlement_report` and `custom_report`.** |
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub columns: ::std::vec::Vec<::std::string::String>,
    /// Defaults to `ETC/UTC`. Defines the output timezone for all timestamps displayed in the report.
    ///
    /// Has no effect on `from` or `to` parameters.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub timezone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ReportRunOptions {
    fn default() -> Self {
        Self {
            columns: Default::default(),
            timezone: Default::default(),
        }
    }
}
/// Select payments by state to be included in the report.
///
/// If not provided, payments in all states will be included in the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Select payments by state to be included in the report.\n\nIf not provided, payments in all states will be included in the report.",
///  "type": "array",
///  "items": {
///    "type": "string",
///    "enum": [
///      "completed",
///      "failed",
///      "declined",
///      "cancelled"
///    ]
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunPaymentsEntityStates(pub ::std::vec::Vec<ReportRunPaymentsEntityStatesItem>);
impl ::std::ops::Deref for ReportRunPaymentsEntityStates {
    type Target = ::std::vec::Vec<ReportRunPaymentsEntityStatesItem>;
    fn deref(&self) -> &::std::vec::Vec<ReportRunPaymentsEntityStatesItem> {
        &self.0
    }
}
impl ::std::convert::From<ReportRunPaymentsEntityStates>
    for ::std::vec::Vec<ReportRunPaymentsEntityStatesItem>
{
    fn from(value: ReportRunPaymentsEntityStates) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<ReportRunPaymentsEntityStatesItem>>
    for ReportRunPaymentsEntityStates
{
    fn from(value: ::std::vec::Vec<ReportRunPaymentsEntityStatesItem>) -> Self {
        Self(value)
    }
}
///`ReportRunPaymentsEntityStatesItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "enum": [
///    "completed",
///    "failed",
///    "declined",
///    "cancelled"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunPaymentsEntityStatesItem {
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "declined")]
    Declined,
    #[serde(rename = "cancelled")]
    Cancelled,
}
impl ::std::fmt::Display for ReportRunPaymentsEntityStatesItem {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Completed => f.write_str("completed"),
            Self::Failed => f.write_str("failed"),
            Self::Declined => f.write_str("declined"),
            Self::Cancelled => f.write_str("cancelled"),
        }
    }
}
impl ::std::str::FromStr for ReportRunPaymentsEntityStatesItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "completed" => Ok(Self::Completed),
            "failed" => Ok(Self::Failed),
            "declined" => Ok(Self::Declined),
            "cancelled" => Ok(Self::Cancelled),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunPaymentsEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunPaymentsEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunPaymentsEntityStatesItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Filtering parameters to be applied to the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Filtering parameters to be applied to the report.",
///  "type": "object",
///  "required": [
///    "from",
///    "to"
///  ],
///  "properties": {
///    "entity_states": {
///      "$ref": "#/components/schemas/Report-Run-Payments-Entity-States"
///    },
///    "from": {
///      "$ref": "#/components/schemas/Report-Run-From"
///    },
///    "to": {
///      "$ref": "#/components/schemas/Report-Run-To"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunPaymentsFilter {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub entity_states: ::std::option::Option<ReportRunPaymentsEntityStates>,
    pub from: ReportRunFrom,
    pub to: ReportRunTo,
}
///Further options to customize the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Further options to customize the report.",
///  "type": "object",
///  "properties": {
///    "columns": {
///      "description": "Names of the columns to be included in the report.\n\nIf the `columns` parameter is not defined in the request, all available columns will be included in the report. An empty array will return an error.\n\nAvailable columns:\n\n  | Column name | Description |\n  | ----------- | ----------- |\n  | `payment_id` | Unique identifier of the payment. |\n  | `type` | Type of the payment, for example: `PAYMENT` or `REFUND`. |\n  | `description` | Description of the payment. |\n  | `original_payment_id` | For refunds, the unique identifier of the original payment. |\n  | `order_id` | Unique identifier of the order associated with the payment. |\n  | `state` | State of the payment, for example: `COMPLETED`, `FAILED`, or `DECLINED`. |\n  | `reason` | Reason for a failed or declined payment, for example: `Insufficient Funds`. |\n  | `amount` | Total amount of the payment. |\n  | `currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the payment. |\n  | `surcharge_amount` | Surcharge amount applied to the payment, if any. |\n  | `tip_amount` | Tip amount included in the payment, if any. |\n  | `refunded_amount` | Amount refunded for the payment. |\n  | `created_date` | Date and time the payment was created. |\n  | `merchant_order_ext_ref` | Merchant's order identifier for external reference. |\n  | `payment_method` | Payment method used, for example: `CARD` or `PAY_WITH_REVOLUT`. |\n  | `location_id` | Unique identifier of the location where the payment was made. |\n  | `customer_id` | Unique identifier of the customer. |\n  | `customer_card_number` | Masked card number used for the payment. |\n  | `customer_card_country` | Country of the card used for the payment, as an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. |\n  | `customer_card_brand` | Card brand used for the payment, for example: `VISA` or `MASTERCARD_DEBIT`. |\n  | `customer_card_type` | Card funding type, for example: `DEBIT` or `PREPAID`. |\n  | `customer_card_category` | Card category, for example: `consumer` or `business`. |\n  | `customer_email` | Email address of the customer. |\n  | `fee_amount` | Total fee amount charged for the payment. |\n  | `fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the fee. |",
///      "type": "array",
///      "items": {
///        "type": "string"
///      }
///    },
///    "timezone": {
///      "description": "Defaults to `ETC/UTC`. Defines the output timezone for all timestamps displayed in the report.\n\nHas no effect on `from` or `to` parameters.",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunPaymentsOptions {
    /// Names of the columns to be included in the report.
    ///
    /// If the `columns` parameter is not defined in the request, all available columns will be included in the report. An empty array will return an error.
    ///
    /// Available columns:
    ///
    ///   | Column name | Description |
    ///   | ----------- | ----------- |
    ///   | `payment_id` | Unique identifier of the payment. |
    ///   | `type` | Type of the payment, for example: `PAYMENT` or `REFUND`. |
    ///   | `description` | Description of the payment. |
    ///   | `original_payment_id` | For refunds, the unique identifier of the original payment. |
    ///   | `order_id` | Unique identifier of the order associated with the payment. |
    ///   | `state` | State of the payment, for example: `COMPLETED`, `FAILED`, or `DECLINED`. |
    ///   | `reason` | Reason for a failed or declined payment, for example: `Insufficient Funds`. |
    ///   | `amount` | Total amount of the payment. |
    ///   | `currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the payment. |
    ///   | `surcharge_amount` | Surcharge amount applied to the payment, if any. |
    ///   | `tip_amount` | Tip amount included in the payment, if any. |
    ///   | `refunded_amount` | Amount refunded for the payment. |
    ///   | `created_date` | Date and time the payment was created. |
    ///   | `merchant_order_ext_ref` | Merchant's order identifier for external reference. |
    ///   | `payment_method` | Payment method used, for example: `CARD` or `PAY_WITH_REVOLUT`. |
    ///   | `location_id` | Unique identifier of the location where the payment was made. |
    ///   | `customer_id` | Unique identifier of the customer. |
    ///   | `customer_card_number` | Masked card number used for the payment. |
    ///   | `customer_card_country` | Country of the card used for the payment, as an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. |
    ///   | `customer_card_brand` | Card brand used for the payment, for example: `VISA` or `MASTERCARD_DEBIT`. |
    ///   | `customer_card_type` | Card funding type, for example: `DEBIT` or `PREPAID`. |
    ///   | `customer_card_category` | Card category, for example: `consumer` or `business`. |
    ///   | `customer_email` | Email address of the customer. |
    ///   | `fee_amount` | Total fee amount charged for the payment. |
    ///   | `fee_currency` | The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the fee. |
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub columns: ::std::vec::Vec<::std::string::String>,
    /// Defaults to `ETC/UTC`. Defines the output timezone for all timestamps displayed in the report.
    ///
    /// Has no effect on `from` or `to` parameters.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub timezone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ReportRunPaymentsOptions {
    fn default() -> Self {
        Self {
            columns: Default::default(),
            timezone: Default::default(),
        }
    }
}
///A payments report contains all the query information for generating reports of payments associated with a Merchant account, including failed and declined payments.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payments report",
///  "description": "A payments report contains all the query information for generating reports of payments associated with a Merchant account, including failed and declined payments.",
///  "type": "object",
///  "required": [
///    "filter",
///    "format",
///    "type"
///  ],
///  "properties": {
///    "filter": {
///      "$ref": "#/components/schemas/Report-Run-Payments-Filter"
///    },
///    "format": {
///      "$ref": "#/components/schemas/Report-Run-Format"
///    },
///    "options": {
///      "$ref": "#/components/schemas/Report-Run-Payments-Options"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Report-Run-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunPaymentsReport {
    pub filter: ReportRunPaymentsFilter,
    pub format: ReportRunFormat,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub options: ::std::option::Option<ReportRunPaymentsOptions>,
    #[serde(rename = "type")]
    pub type_: ReportRunType,
}
///Filtering parameters to be applied to the report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Filtering parameters to be applied to the report.",
///  "type": "object",
///  "required": [
///    "payout_id"
///  ],
///  "properties": {
///    "payout_id": {
///      "$ref": "#/components/schemas/Payout-Id"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunPayoutFilter {
    pub payout_id: PayoutId,
}
///A payout settlement report contains all the query information for generating reports of a selected payout associated with a Merchant account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Payout settlement report",
///  "description": "A payout settlement report contains all the query information for generating reports of a selected payout associated with a Merchant account.",
///  "type": "object",
///  "required": [
///    "filter",
///    "format",
///    "type"
///  ],
///  "properties": {
///    "filter": {
///      "$ref": "#/components/schemas/Report-Run-Payout-Filter"
///    },
///    "format": {
///      "$ref": "#/components/schemas/Report-Run-Format"
///    },
///    "options": {
///      "$ref": "#/components/schemas/Report-Run-Options"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Report-Run-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunPayoutReport {
    pub filter: ReportRunPayoutFilter,
    pub format: ReportRunFormat,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub options: ::std::option::Option<ReportRunOptions>,
    #[serde(rename = "type")]
    pub type_: ReportRunType,
}
///A settlement report contains all the query information for generating reports of settled transactions associated with a Merchant account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Settlement report",
///  "description": "A settlement report contains all the query information for generating reports of settled transactions associated with a Merchant account.",
///  "type": "object",
///  "required": [
///    "filter",
///    "format",
///    "type"
///  ],
///  "properties": {
///    "filter": {
///      "$ref": "#/components/schemas/Report-Run-Filter"
///    },
///    "format": {
///      "$ref": "#/components/schemas/Report-Run-Format"
///    },
///    "options": {
///      "$ref": "#/components/schemas/Report-Run-Options"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Report-Run-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReportRunSettlementReport {
    pub filter: ReportRunFilter,
    pub format: ReportRunFormat,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub options: ::std::option::Option<ReportRunOptions>,
    #[serde(rename = "type")]
    pub type_: ReportRunType,
}
/// This parameter specifies the end boundary for filtering transaction data in the report based on an order's `payments.created_at` parameter. It accepts ETC/UTC date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) and includes all transactions created before this timestamp (exclusive).
///
/// Combined with the `from` parameter, this determines the timeframe for the report, including all transactions between the two values.
///
/// For example, setting the `to` parameter to `2021-12-31T23:59:59Z` will include all transactions in the report created up to, but not including, the last second of December 31, 2021, UTC.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "This parameter specifies the end boundary for filtering transaction data in the report based on an order's `payments.created_at` parameter. It accepts ETC/UTC date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) and includes all transactions created before this timestamp (exclusive). \n\nCombined with the `from` parameter, this determines the timeframe for the report, including all transactions between the two values. \n\nFor example, setting the `to` parameter to `2021-12-31T23:59:59Z` will include all transactions in the report created up to, but not including, the last second of December 31, 2021, UTC.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ReportRunTo(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for ReportRunTo {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<ReportRunTo> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: ReportRunTo) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for ReportRunTo {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for ReportRunTo {
    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 ReportRunTo {
    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 ReportRunTo {
    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 ReportRunTo {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Type of the report.
///
/// Possible values:
///
///   | Type of report | Description |
///   | -------------- | ----------- |
///   | `settlement_report` | Settlement report is a report including transactions settled to the user account. This parameter sets the predefined `options` and list of represented columns. |
///   | `custom_report` | Custom reports require users to define `options`. |
///   | `payout_statement_report`    | Payout statement Reports provide a detailed breakdown of all transactions contributing to a specific payout amount. It requires the additional parameter `filter.payout_id`, which should be obtained from the payout ID retrieved via the [payout list endpoint](https://developer.revolut.com/docs/merchant/retrieve-payout-list) or from [webhook events](https://developer.revolut.com/docs/merchant/create-webhook#callbacks). |
///   | `icpp_fee_breakdown_report`  | IC++ fee breakdown reports provide a detailed breakdown of fees for each IC++ transaction related to a payout. It requires the additional parameter `filter.icpp_charge_id`, which should be obtained from the `related_icpp_charge_id` column in the Payout statement report. A separate report should be generated for each IC++ transaction. |
///   | `payments_report` | Payments report provides details of all payments associated with a Merchant account, including failed and declined payments. Supports filtering by `from` and `to` creation timestamps, and optionally by `entity_states`. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of the report.\n\nPossible values:\n\n  | Type of report | Description |\n  | -------------- | ----------- |\n  | `settlement_report` | Settlement report is a report including transactions settled to the user account. This parameter sets the predefined `options` and list of represented columns. |\n  | `custom_report` | Custom reports require users to define `options`. |\n  | `payout_statement_report`    | Payout statement Reports provide a detailed breakdown of all transactions contributing to a specific payout amount. It requires the additional parameter `filter.payout_id`, which should be obtained from the payout ID retrieved via the [payout list endpoint](https://developer.revolut.com/docs/merchant/retrieve-payout-list) or from [webhook events](https://developer.revolut.com/docs/merchant/create-webhook#callbacks). |\n  | `icpp_fee_breakdown_report`  | IC++ fee breakdown reports provide a detailed breakdown of fees for each IC++ transaction related to a payout. It requires the additional parameter `filter.icpp_charge_id`, which should be obtained from the `related_icpp_charge_id` column in the Payout statement report. A separate report should be generated for each IC++ transaction. |\n  | `payments_report` | Payments report provides details of all payments associated with a Merchant account, including failed and declined payments. Supports filtering by `from` and `to` creation timestamps, and optionally by `entity_states`. |",
///  "type": "string",
///  "enum": [
///    "settlement_report",
///    "custom_report",
///    "payout_statement_report",
///    "icpp_fee_breakdown_report",
///    "payments_report"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum ReportRunType {
    #[serde(rename = "settlement_report")]
    SettlementReport,
    #[serde(rename = "custom_report")]
    CustomReport,
    #[serde(rename = "payout_statement_report")]
    PayoutStatementReport,
    #[serde(rename = "icpp_fee_breakdown_report")]
    IcppFeeBreakdownReport,
    #[serde(rename = "payments_report")]
    PaymentsReport,
}
impl ::std::fmt::Display for ReportRunType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::SettlementReport => f.write_str("settlement_report"),
            Self::CustomReport => f.write_str("custom_report"),
            Self::PayoutStatementReport => f.write_str("payout_statement_report"),
            Self::IcppFeeBreakdownReport => f.write_str("icpp_fee_breakdown_report"),
            Self::PaymentsReport => f.write_str("payments_report"),
        }
    }
}
impl ::std::str::FromStr for ReportRunType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "settlement_report" => Ok(Self::SettlementReport),
            "custom_report" => Ok(Self::CustomReport),
            "payout_statement_report" => Ok(Self::PayoutStatementReport),
            "icpp_fee_breakdown_report" => Ok(Self::IcppFeeBreakdownReport),
            "payments_report" => Ok(Self::PaymentsReport),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for ReportRunType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ReportRunType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ReportRunType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`RevolutPay`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/RPay-Account"
///    },
///    {
///      "$ref": "#/components/schemas/RPay-Card"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum RevolutPay {
    Account(RPayAccount),
    Card(RPayCard),
}
impl ::std::convert::From<RPayAccount> for RevolutPay {
    fn from(value: RPayAccount) -> Self {
        Self::Account(value)
    }
}
impl ::std::convert::From<RPayCard> for RevolutPay {
    fn from(value: RPayCard) -> Self {
        Self::Card(value)
    }
}
///`RevolutPayAccount`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "fingerprint": {
///      "$ref": "#/components/schemas/Fingerprint"
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RevolutPayAccount {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<Fingerprint>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///Object containing details of a card used via Revolut Pay.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a card used via Revolut Pay.",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "arn": {
///      "$ref": "#/components/schemas/Arn"
///    },
///    "authorisation_code": {
///      "$ref": "#/components/schemas/Authorisation-Code"
///    },
///    "capture_deadline": {
///      "$ref": "#/components/schemas/Capture-Deadline"
///    },
///    "card_bin": {
///      "description": "The BIN of the card.",
///      "type": "string",
///      "maxLength": 6,
///      "minLength": 6
///    },
///    "card_brand": {
///      "description": "The type of the card.",
///      "type": "string",
///      "enum": [
///        "visa",
///        "mastercard",
///        "american_express"
///      ]
///    },
///    "card_country_code": {
///      "description": "The 2-letter country code of the country where the card was issued.",
///      "type": "string"
///    },
///    "card_expiry": {
///      "description": "The expiry date of the card in the format of MM/YY.",
///      "type": "string",
///      "format": "MM/YY"
///    },
///    "card_last_four": {
///      "description": "The last four digits of the card number.",
///      "type": "string",
///      "maxLength": 4,
///      "minLength": 4
///    },
///    "cardholder_name": {
///      "description": "The name of the cardholder.",
///      "type": "string"
///    },
///    "checks": {
///      "$ref": "#/components/schemas/Card-Checks-v2"
///    },
///    "fingerprint": {
///      "$ref": "#/components/schemas/Fingerprint"
///    },
///    "funding": {
///      "description": "The type of card funding.",
///      "type": "string",
///      "enum": [
///        "credit",
///        "debit",
///        "prepaid"
///      ]
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "network_transaction_id": {
///      "$ref": "#/components/schemas/Network-Transaction-Id"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RevolutPayCard {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub arn: ::std::option::Option<Arn>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub authorisation_code: ::std::option::Option<AuthorisationCode>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub capture_deadline: ::std::option::Option<CaptureDeadline>,
    ///The BIN of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_bin: ::std::option::Option<RevolutPayCardCardBin>,
    ///The type of the card.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_brand: ::std::option::Option<RevolutPayCardCardBrand>,
    ///The 2-letter country code of the country where the card was issued.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_country_code: ::std::option::Option<::std::string::String>,
    ///The expiry date of the card in the format of MM/YY.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_expiry: ::std::option::Option<::std::string::String>,
    ///The last four digits of the card number.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub card_last_four: ::std::option::Option<RevolutPayCardCardLastFour>,
    ///The name of the cardholder.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cardholder_name: ::std::option::Option<::std::string::String>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub checks: ::std::option::Option<CardChecksV2>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<Fingerprint>,
    ///The type of card funding.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub funding: ::std::option::Option<RevolutPayCardFunding>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub network_transaction_id: ::std::option::Option<NetworkTransactionId>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///The BIN of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The BIN of the card.",
///  "type": "string",
///  "maxLength": 6,
///  "minLength": 6
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RevolutPayCardCardBin(::std::string::String);
impl ::std::ops::Deref for RevolutPayCardCardBin {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<RevolutPayCardCardBin> for ::std::string::String {
    fn from(value: RevolutPayCardCardBin) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for RevolutPayCardCardBin {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 6usize {
            return Err("longer than 6 characters".into());
        }
        if value.chars().count() < 6usize {
            return Err("shorter than 6 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for RevolutPayCardCardBin {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RevolutPayCardCardBin {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RevolutPayCardCardBin {
    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 RevolutPayCardCardBin {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of the card.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of the card.",
///  "type": "string",
///  "enum": [
///    "visa",
///    "mastercard",
///    "american_express"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RevolutPayCardCardBrand {
    #[serde(rename = "visa")]
    Visa,
    #[serde(rename = "mastercard")]
    Mastercard,
    #[serde(rename = "american_express")]
    AmericanExpress,
}
impl ::std::fmt::Display for RevolutPayCardCardBrand {
    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"),
            Self::AmericanExpress => f.write_str("american_express"),
        }
    }
}
impl ::std::str::FromStr for RevolutPayCardCardBrand {
    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),
            "american_express" => Ok(Self::AmericanExpress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RevolutPayCardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RevolutPayCardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RevolutPayCardCardBrand {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The last four digits of the card number.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the card number.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RevolutPayCardCardLastFour(::std::string::String);
impl ::std::ops::Deref for RevolutPayCardCardLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<RevolutPayCardCardLastFour> for ::std::string::String {
    fn from(value: RevolutPayCardCardLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for RevolutPayCardCardLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for RevolutPayCardCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RevolutPayCardCardLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RevolutPayCardCardLastFour {
    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 RevolutPayCardCardLastFour {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The type of card funding.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of card funding.",
///  "type": "string",
///  "enum": [
///    "credit",
///    "debit",
///    "prepaid"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum RevolutPayCardFunding {
    #[serde(rename = "credit")]
    Credit,
    #[serde(rename = "debit")]
    Debit,
    #[serde(rename = "prepaid")]
    Prepaid,
}
impl ::std::fmt::Display for RevolutPayCardFunding {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Credit => f.write_str("credit"),
            Self::Debit => f.write_str("debit"),
            Self::Prepaid => f.write_str("prepaid"),
        }
    }
}
impl ::std::str::FromStr for RevolutPayCardFunding {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "credit" => Ok(Self::Credit),
            "debit" => Ok(Self::Debit),
            "prepaid" => Ok(Self::Prepaid),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for RevolutPayCardFunding {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for RevolutPayCardFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for RevolutPayCardFunding {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// A saved Revolut Pay payment method on a customer profile.
///
/// Both Revolut Pay card-backed and account-to-account (A2A) variants are
/// represented by this single type at the saved payment method level.
/// No underlying card details are exposed here; use the order-level
/// `payments[].payment_method` object (types `revolut_pay_card` /
/// `revolut_pay_account`) for per-transaction details.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Revolut Pay payment method",
///  "description": "A saved Revolut Pay payment method on a customer profile.\n\nBoth Revolut Pay card-backed and account-to-account (A2A) variants are\nrepresented by this single type at the saved payment method level.\nNo underlying card details are exposed here; use the order-level\n`payments[].payment_method` object (types `revolut_pay_card` /\n`revolut_pay_account`) for per-transaction details.",
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "type"
///  ],
///  "properties": {
///    "created_at": {
///      "$ref": "#/components/schemas/Payment-Method-Created-At"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Method-Id"
///    },
///    "saved_for": {
///      "$ref": "#/components/schemas/Saved-For"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type-v2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RevolutPayV2 {
    pub created_at: PaymentMethodCreatedAt,
    pub id: PaymentMethodId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub saved_for: ::std::option::Option<SavedFor>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodTypeV2,
}
/// Indicates in which case this saved payment method can be used for payments.
///
/// | Value | Description |
/// | ----- | ----------- |
/// | `customer` | This payment method can be used only when the customer is on the checkout page. |
/// | `merchant` | This payment method can be used without the customer being on the checkout page, and the merchant can initiate transactions, for example, to take payments for recurring transactions. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates in which case this saved payment method can be used for payments.\n\n| Value | Description |\n| ----- | ----------- |\n| `customer` | This payment method can be used only when the customer is on the checkout page. |\n| `merchant` | This payment method can be used without the customer being on the checkout page, and the merchant can initiate transactions, for example, to take payments for recurring transactions. |",
///  "type": "string",
///  "enum": [
///    "customer",
///    "merchant"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SavedFor {
    #[serde(rename = "customer")]
    Customer,
    #[serde(rename = "merchant")]
    Merchant,
}
impl ::std::fmt::Display for SavedFor {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Customer => f.write_str("customer"),
            Self::Merchant => f.write_str("merchant"),
        }
    }
}
impl ::std::str::FromStr for SavedFor {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "customer" => Ok(Self::Customer),
            "merchant" => Ok(Self::Merchant),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SavedFor {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SavedFor {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SavedFor {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`SavedPaymentMethod`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "saved_payment_method"
///  ],
///  "properties": {
///    "saved_payment_method": {
///      "description": "Object containing information about the saved payment method used to pay for the order.",
///      "type": "object",
///      "required": [
///        "environment",
///        "id",
///        "initiator",
///        "type"
///      ],
///      "properties": {
///        "environment": {
///          "$ref": "#/components/schemas/Environment"
///        },
///        "id": {
///          "description": "Saved payment method ID.",
///          "type": "string"
///        },
///        "initiator": {
///          "description": "Indicates who is allowed to initiate the payment. \n\n:::note\nUsing this endpoint, only merchant initiated payments are supported with Revolut Pay.\n:::",
///          "type": "string",
///          "enum": [
///            "customer",
///            "merchant"
///          ]
///        },
///        "type": {
///          "description": "Type of saved payment method.",
///          "type": "string",
///          "enum": [
///            "card",
///            "revolut_pay"
///          ]
///        }
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SavedPaymentMethod {
    pub saved_payment_method: SavedPaymentMethodSavedPaymentMethod,
}
///Object containing information about the saved payment method used to pay for the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing information about the saved payment method used to pay for the order.",
///  "type": "object",
///  "required": [
///    "environment",
///    "id",
///    "initiator",
///    "type"
///  ],
///  "properties": {
///    "environment": {
///      "$ref": "#/components/schemas/Environment"
///    },
///    "id": {
///      "description": "Saved payment method ID.",
///      "type": "string"
///    },
///    "initiator": {
///      "description": "Indicates who is allowed to initiate the payment. \n\n:::note\nUsing this endpoint, only merchant initiated payments are supported with Revolut Pay.\n:::",
///      "type": "string",
///      "enum": [
///        "customer",
///        "merchant"
///      ]
///    },
///    "type": {
///      "description": "Type of saved payment method.",
///      "type": "string",
///      "enum": [
///        "card",
///        "revolut_pay"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SavedPaymentMethodSavedPaymentMethod {
    pub environment: Environment,
    ///Saved payment method ID.
    pub id: ::std::string::String,
    /// Indicates who is allowed to initiate the payment.
    ///
    /// :::note
    /// Using this endpoint, only merchant initiated payments are supported with Revolut Pay.
    /// :::
    pub initiator: SavedPaymentMethodSavedPaymentMethodInitiator,
    ///Type of saved payment method.
    #[serde(rename = "type")]
    pub type_: SavedPaymentMethodSavedPaymentMethodType,
}
/// Indicates who is allowed to initiate the payment.
///
/// :::note
/// Using this endpoint, only merchant initiated payments are supported with Revolut Pay.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates who is allowed to initiate the payment. \n\n:::note\nUsing this endpoint, only merchant initiated payments are supported with Revolut Pay.\n:::",
///  "type": "string",
///  "enum": [
///    "customer",
///    "merchant"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SavedPaymentMethodSavedPaymentMethodInitiator {
    #[serde(rename = "customer")]
    Customer,
    #[serde(rename = "merchant")]
    Merchant,
}
impl ::std::fmt::Display for SavedPaymentMethodSavedPaymentMethodInitiator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Customer => f.write_str("customer"),
            Self::Merchant => f.write_str("merchant"),
        }
    }
}
impl ::std::str::FromStr for SavedPaymentMethodSavedPaymentMethodInitiator {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "customer" => Ok(Self::Customer),
            "merchant" => Ok(Self::Merchant),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SavedPaymentMethodSavedPaymentMethodInitiator {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for SavedPaymentMethodSavedPaymentMethodInitiator
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for SavedPaymentMethodSavedPaymentMethodInitiator
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///Type of saved payment method.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of saved payment method.",
///  "type": "string",
///  "enum": [
///    "card",
///    "revolut_pay"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SavedPaymentMethodSavedPaymentMethodType {
    #[serde(rename = "card")]
    Card,
    #[serde(rename = "revolut_pay")]
    RevolutPay,
}
impl ::std::fmt::Display for SavedPaymentMethodSavedPaymentMethodType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Card => f.write_str("card"),
            Self::RevolutPay => f.write_str("revolut_pay"),
        }
    }
}
impl ::std::str::FromStr for SavedPaymentMethodSavedPaymentMethodType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "card" => Ok(Self::Card),
            "revolut_pay" => Ok(Self::RevolutPay),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SavedPaymentMethodSavedPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SavedPaymentMethodSavedPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SavedPaymentMethodSavedPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Object containing details of a SEPA Direct Debit payment.
///
/// :::info
/// For more information, see: [SEPA Direct Debit server-to-server integration](https://developer.revolut.com/docs/guides/merchant/accept-payments/payment-methods/sepa-direct-debit/server-to-server)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing details of a SEPA Direct Debit payment.\n\n:::info\nFor more information, see: [SEPA Direct Debit server-to-server integration](https://developer.revolut.com/docs/guides/merchant/accept-payments/payment-methods/sepa-direct-debit/server-to-server)\n:::",
///  "type": "object",
///  "required": [
///    "type"
///  ],
///  "properties": {
///    "debtor_iban_last_four": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Iban-Last-Four"
///    },
///    "debtor_name": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Name"
///    },
///    "id": {
///      "description": "ID of the saved payment method.\n\n:::note\nThe `id` parameter is only returned when the payment method is saved for the merchant.\n:::",
///      "type": "string",
///      "format": "uuid"
///    },
///    "mandate_reference": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Mandate-Reference"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SepaDirectDebit {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_iban_last_four: ::std::option::Option<SepaDirectDebitDebtorIbanLastFour>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_name: ::std::option::Option<SepaDirectDebitDebtorName>,
    /// ID of the saved payment method.
    ///
    /// :::note
    /// The `id` parameter is only returned when the payment method is saved for the merchant.
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub id: ::std::option::Option<::uuid::Uuid>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub mandate_reference: ::std::option::Option<SepaDirectDebitMandateReference>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodType,
}
///The last four digits of the debtor's IBAN.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The last four digits of the debtor's IBAN.",
///  "type": "string",
///  "maxLength": 4,
///  "minLength": 4
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SepaDirectDebitDebtorIbanLastFour(::std::string::String);
impl ::std::ops::Deref for SepaDirectDebitDebtorIbanLastFour {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SepaDirectDebitDebtorIbanLastFour> for ::std::string::String {
    fn from(value: SepaDirectDebitDebtorIbanLastFour) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SepaDirectDebitDebtorIbanLastFour {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 4usize {
            return Err("longer than 4 characters".into());
        }
        if value.chars().count() < 4usize {
            return Err("shorter than 4 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SepaDirectDebitDebtorIbanLastFour {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SepaDirectDebitDebtorIbanLastFour {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SepaDirectDebitDebtorIbanLastFour {
    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 SepaDirectDebitDebtorIbanLastFour {
    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 of the debtor as provided in the mandate.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The full name of the debtor as provided in the mandate.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SepaDirectDebitDebtorName(pub ::std::string::String);
impl ::std::ops::Deref for SepaDirectDebitDebtorName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SepaDirectDebitDebtorName> for ::std::string::String {
    fn from(value: SepaDirectDebitDebtorName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SepaDirectDebitDebtorName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SepaDirectDebitDebtorName {
    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 SepaDirectDebitDebtorName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The unique mandate reference generated by Revolut. Include this in pre-debit notifications sent to your customers.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique mandate reference generated by Revolut. Include this in pre-debit notifications sent to your customers.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SepaDirectDebitMandateReference(pub ::std::string::String);
impl ::std::ops::Deref for SepaDirectDebitMandateReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SepaDirectDebitMandateReference> for ::std::string::String {
    fn from(value: SepaDirectDebitMandateReference) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SepaDirectDebitMandateReference {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SepaDirectDebitMandateReference {
    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 SepaDirectDebitMandateReference {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// A saved SEPA Direct Debit payment method on a customer profile.
///
/// :::info
/// For more information, see: [SEPA Direct Debit server-to-server integration](https://developer.revolut.com/docs/guides/merchant/accept-payments/payment-methods/sepa-direct-debit/server-to-server)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "SEPA Direct Debit payment method",
///  "description": "A saved SEPA Direct Debit payment method on a customer profile.\n\n:::info\nFor more information, see: [SEPA Direct Debit server-to-server integration](https://developer.revolut.com/docs/guides/merchant/accept-payments/payment-methods/sepa-direct-debit/server-to-server)\n:::",
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "type"
///  ],
///  "properties": {
///    "billing_address": {
///      "$ref": "#/components/schemas/Billing-Address"
///    },
///    "created_at": {
///      "$ref": "#/components/schemas/Payment-Method-Created-At"
///    },
///    "debtor_iban_last_four": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Iban-Last-Four"
///    },
///    "debtor_name": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Debtor-Name"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Payment-Method-Id"
///    },
///    "mandate_reference": {
///      "$ref": "#/components/schemas/Sepa-Direct-Debit-Mandate-Reference"
///    },
///    "saved_for": {
///      "$ref": "#/components/schemas/Saved-For"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Payment-Method-Type-v2"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SepaDirectDebitV2 {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub billing_address: ::std::option::Option<BillingAddress>,
    pub created_at: PaymentMethodCreatedAt,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_iban_last_four: ::std::option::Option<SepaDirectDebitDebtorIbanLastFour>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub debtor_name: ::std::option::Option<SepaDirectDebitDebtorName>,
    pub id: PaymentMethodId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub mandate_reference: ::std::option::Option<SepaDirectDebitMandateReference>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub saved_for: ::std::option::Option<SavedFor>,
    #[serde(rename = "type")]
    pub type_: PaymentMethodTypeV2,
}
/// [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case.
///
/// If `settlement_currency` is different from the value of `currency`, the money will be exchanged when the amount is settled to your merchant account. In case of a refund or chargeback, the money will be exchanged to the order's initial `currency`.
///
/// If `settlement_currency` is not specified, this value is taken from `currency`.
///
/// :::info
/// For more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code in upper case. \n\nIf `settlement_currency` is different from the value of `currency`, the money will be exchanged when the amount is settled to your merchant account. In case of a refund or chargeback, the money will be exchanged to the order's initial `currency`.\n\nIf `settlement_currency` is not specified, this value is taken from `currency`.\n\n:::info\nFor more information about the supported currencies, see: [Help Center](https://help.revolut.com/business/help/merchant-accounts/payments/in-which-currencies-can-i-accept-payments/).\n:::",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SettlementCurrency(pub ::std::string::String);
impl ::std::ops::Deref for SettlementCurrency {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SettlementCurrency> for ::std::string::String {
    fn from(value: SettlementCurrency) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SettlementCurrency {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SettlementCurrency {
    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 SettlementCurrency {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The ID of the order created for handling the setup payment for the subscription.
///
/// Use the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint with this ID to get order details, including the `checkout_url` for redirecting customers to the Hosted Payment Page or the `token` for widget integration.
///
/// :::note
/// The order is created in parallel to the subscription and is used to collect the initial payment and save the customer's payment method for future billing cycles.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the order created for handling the setup payment for the subscription.\n\nUse the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint with this ID to get order details, including the `checkout_url` for redirecting customers to the Hosted Payment Page or the `token` for widget integration.\n\n:::note\nThe order is created in parallel to the subscription and is used to collect the initial payment and save the customer's payment method for future billing cycles.\n:::",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SetupOrderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SetupOrderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SetupOrderId> for ::uuid::Uuid {
    fn from(value: SetupOrderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SetupOrderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SetupOrderId {
    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 SetupOrderId {
    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 SetupOrderId {
    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 SetupOrderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The URL to which the customer is redirected after completing the setup order on the Revolut Hosted Payment Page.
///
/// When provided, the response will include a `setup_order_id`. Use the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint with this `setup_order_id` to get the `checkout_url` for redirecting the customer to the Hosted Payment Page.
///
/// :::caution
/// Restrictions:
/// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
/// - URI scheme is required and must be either `http` or `https`
/// - URI host is required and cannot be `localhost` or an IP address
/// - Max length: `2000`
/// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The URL to which the customer is redirected after completing the setup order on the Revolut Hosted Payment Page.\n\nWhen provided, the response will include a `setup_order_id`. Use the [Retrieve an order](https://developer.revolut.com/docs/merchant/retrieve-order) endpoint with this `setup_order_id` to get the `checkout_url` for redirecting the customer to the Hosted Payment Page.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///  "type": "string",
///  "format": "uri",
///  "maxLength": 2000,
///  "pattern": "^https?:\\/{2}.+/gi"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SetupOrderRedirectUrl(pub ::std::string::String);
impl ::std::ops::Deref for SetupOrderRedirectUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SetupOrderRedirectUrl> for ::std::string::String {
    fn from(value: SetupOrderRedirectUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SetupOrderRedirectUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SetupOrderRedirectUrl {
    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 SetupOrderRedirectUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Details of an individual shipment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details of an individual shipment.",
///  "type": "object",
///  "required": [
///    "shipping_company_name",
///    "tracking_number"
///  ],
///  "properties": {
///    "estimated_delivery_date": {
///      "description": "Estimated delivery date and time for the shipment. \nThe time should also include the customer's timezone.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "shipping_company_name": {
///      "description": "Name of the company handling the shipment.",
///      "type": "string",
///      "maxLength": 250
///    },
///    "tracking_number": {
///      "description": "Unique tracking number for the shipment.",
///      "type": "string",
///      "maxLength": 500
///    },
///    "tracking_url": {
///      "description": "An HTTP/HTTPS URL where the shipment can be tracked.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 2000,
///      "pattern": "^https?:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Shipment {
    /// Estimated delivery date and time for the shipment.
    /// The time should also include the customer's timezone.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub estimated_delivery_date: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    ///Name of the company handling the shipment.
    pub shipping_company_name: ShipmentShippingCompanyName,
    ///Unique tracking number for the shipment.
    pub tracking_number: ShipmentTrackingNumber,
    /// An HTTP/HTTPS URL where the shipment can be tracked.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be either `http` or `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `2000`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub tracking_url: ::std::option::Option<::std::string::String>,
}
///Name of the company handling the shipment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Name of the company handling the shipment.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ShipmentShippingCompanyName(::std::string::String);
impl ::std::ops::Deref for ShipmentShippingCompanyName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ShipmentShippingCompanyName> for ::std::string::String {
    fn from(value: ShipmentShippingCompanyName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ShipmentShippingCompanyName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ShipmentShippingCompanyName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ShipmentShippingCompanyName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ShipmentShippingCompanyName {
    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 ShipmentShippingCompanyName {
    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())
            })
    }
}
///Unique tracking number for the shipment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique tracking number for the shipment.",
///  "type": "string",
///  "maxLength": 500
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ShipmentTrackingNumber(::std::string::String);
impl ::std::ops::Deref for ShipmentTrackingNumber {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ShipmentTrackingNumber> for ::std::string::String {
    fn from(value: ShipmentTrackingNumber) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ShipmentTrackingNumber {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ShipmentTrackingNumber {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ShipmentTrackingNumber {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ShipmentTrackingNumber {
    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 ShipmentTrackingNumber {
    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())
            })
    }
}
///List of individual shipment details.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "List of individual shipment details.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Shipment"
///  },
///  "maxItems": 50
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Shipments(pub ::std::vec::Vec<Shipment>);
impl ::std::ops::Deref for Shipments {
    type Target = ::std::vec::Vec<Shipment>;
    fn deref(&self) -> &::std::vec::Vec<Shipment> {
        &self.0
    }
}
impl ::std::convert::From<Shipments> for ::std::vec::Vec<Shipment> {
    fn from(value: Shipments) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Shipment>> for Shipments {
    fn from(value: ::std::vec::Vec<Shipment>) -> Self {
        Self(value)
    }
}
/// Details about the shipping related to the order, including address, contact information, and individual shipments.
///
/// :::info
/// Required for merchants shipping physical goods. Omitting this information may trigger additional scrutiny and risk mitigation actions by Revolut.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details about the shipping related to the order, including address, contact information, and individual shipments.\n\n:::info\nRequired for merchants shipping physical goods. Omitting this information may trigger additional scrutiny and risk mitigation actions by Revolut.\n:::",
///  "type": "object",
///  "properties": {
///    "address": {
///      "$ref": "#/components/schemas/Address-v3"
///    },
///    "contact": {
///      "$ref": "#/components/schemas/Contact"
///    },
///    "shipments": {
///      "$ref": "#/components/schemas/Shipments"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Shipping {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub address: ::std::option::Option<AddressV3>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub contact: ::std::option::Option<Contact>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub shipments: ::std::option::Option<Shipments>,
}
impl ::std::default::Default for Shipping {
    fn default() -> Self {
        Self {
            address: Default::default(),
            contact: Default::default(),
            shipments: Default::default(),
        }
    }
}
/// You can set a dynamic statement descriptor for your orders by providing a custom suffix.
///
/// A statement descriptor is the text shown on cardholders' bank or card statements, helping them recognise a transaction or merchant. This field can be used to send extra information with the statement descriptor for card transactions.
///
/// The complete descriptor is built using the following format: `{base}*{suffix}`, where:
///
///   - **`{base}`** is the existing descriptor configured in the Revolut Business dashboard (**Settings > Business account > Merchant profile > Statement descriptor**).
///   - **`{suffix}`** is defined by the `statement_descriptor_suffix` field.
///
/// :::note
/// - If the combined descriptor's length (base + suffix) exceeds the character limits of card scheme providers, the final value will be truncated. For example if the limit is 22 characters, the base descriptor is `"base"` and the suffix is `"testdescriptorsuffix"`, the final descriptor becomes `"base*testdescriptorsuf"`.
/// - The final statement descriptor shown on a cardholder's statement may vary by issuing bank, as some banks apply their own custom formatting or truncation rules.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "You can set a dynamic statement descriptor for your orders by providing a custom suffix. \n\nA statement descriptor is the text shown on cardholders' bank or card statements, helping them recognise a transaction or merchant. This field can be used to send extra information with the statement descriptor for card transactions.\n\nThe complete descriptor is built using the following format: `{base}*{suffix}`, where:\n  \n  - **`{base}`** is the existing descriptor configured in the Revolut Business dashboard (**Settings > Business account > Merchant profile > Statement descriptor**).  \n  - **`{suffix}`** is defined by the `statement_descriptor_suffix` field.\n\n:::note\n- If the combined descriptor's length (base + suffix) exceeds the character limits of card scheme providers, the final value will be truncated. For example if the limit is 22 characters, the base descriptor is `\"base\"` and the suffix is `\"testdescriptorsuffix\"`, the final descriptor becomes `\"base*testdescriptorsuf\"`.\n- The final statement descriptor shown on a cardholder's statement may vary by issuing bank, as some banks apply their own custom formatting or truncation rules.\n:::",
///  "type": "string",
///  "maxLength": 19,
///  "minLength": 1,
///  "pattern": "^[^*\\n\\r\\\\]+$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementDescriptorSuffix(::std::string::String);
impl ::std::ops::Deref for StatementDescriptorSuffix {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<StatementDescriptorSuffix> for ::std::string::String {
    fn from(value: StatementDescriptorSuffix) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for StatementDescriptorSuffix {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 19usize {
            return Err("longer than 19 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[^*\\n\\r\\\\]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[^*\\n\\r\\\\]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for StatementDescriptorSuffix {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for StatementDescriptorSuffix {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for StatementDescriptorSuffix {
    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 StatementDescriptorSuffix {
    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())
            })
    }
}
///`Subscription`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "current_cycle_id",
///    "customer_id",
///    "id",
///    "payment_method_type",
///    "plan_id",
///    "plan_variation_id",
///    "state",
///    "updated_at"
///  ],
///  "properties": {
///    "created_at": {
///      "$ref": "#/components/schemas/Subscription-Created"
///    },
///    "current_cycle_id": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Id"
///    },
///    "customer_id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "external_reference": {
///      "$ref": "#/components/schemas/Subscription-External-Reference"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Id"
///    },
///    "payment_method_id": {
///      "$ref": "#/components/schemas/Payment-Method-Id"
///    },
///    "payment_method_type": {
///      "$ref": "#/components/schemas/Subscription-Payment-Method-Type"
///    },
///    "plan_id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Id"
///    },
///    "plan_variation_id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Variation-Id"
///    },
///    "setup_order_id": {
///      "$ref": "#/components/schemas/Setup-Order-Id"
///    },
///    "start_date": {
///      "$ref": "#/components/schemas/Subscription-Start-Date"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Subscription-State"
///    },
///    "trial_duration": {
///      "$ref": "#/components/schemas/Subscription-Trial-Duration"
///    },
///    "trial_end_date": {
///      "$ref": "#/components/schemas/Subscription-Trial-End-Date"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/Subscription-Updated"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Subscription {
    pub created_at: SubscriptionCreated,
    pub current_cycle_id: SubscriptionCycleId,
    pub customer_id: CustomerId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub external_reference: ::std::option::Option<SubscriptionExternalReference>,
    pub id: SubscriptionId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_method_id: ::std::option::Option<PaymentMethodId>,
    pub payment_method_type: SubscriptionPaymentMethodType,
    pub plan_id: SubscriptionPlanId,
    pub plan_variation_id: SubscriptionPlanVariationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub setup_order_id: ::std::option::Option<SetupOrderId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub start_date: ::std::option::Option<SubscriptionStartDate>,
    pub state: SubscriptionState,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial_duration: ::std::option::Option<SubscriptionTrialDuration>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial_end_date: ::std::option::Option<SubscriptionTrialEndDate>,
    pub updated_at: SubscriptionUpdated,
}
/// Subscription amount in minor currency units (e.g., cents for USD, pence for GBP).
///
/// For example, `9900` in `GBP` represents £99.00.
///
/// :::info
/// Conversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Subscription amount in minor currency units (e.g., cents for USD, pence for GBP).\n\nFor example, `9900` in `GBP` represents £99.00.\n\n:::info\nConversion between major and minor units varies by currency. For instance, `100` minor units equal £1.00 in `GBP`, whereas in `ISK` they represent 100 units. For more details, see the [ISO 4217 standard](https://en.wikipedia.org/wiki/ISO_4217).\n:::",
///  "type": "integer",
///  "minimum": 0.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionAmount(pub u64);
impl ::std::ops::Deref for SubscriptionAmount {
    type Target = u64;
    fn deref(&self) -> &u64 {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionAmount> for u64 {
    fn from(value: SubscriptionAmount) -> Self {
        value.0
    }
}
impl ::std::convert::From<u64> for SubscriptionAmount {
    fn from(value: u64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionAmount {
    type Err = <u64 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 SubscriptionAmount {
    type Error = <u64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for SubscriptionAmount {
    type Error = <u64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for SubscriptionAmount {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time the subscription 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 subscription 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 SubscriptionCreated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionCreated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCreated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionCreated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionCreated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCreated {
    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 SubscriptionCreated {
    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 SubscriptionCreated {
    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 SubscriptionCreated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "customer_id",
///    "plan_variation_id"
///  ],
///  "properties": {
///    "customer_id": {
///      "$ref": "#/components/schemas/Customer-Id"
///    },
///    "external_reference": {
///      "$ref": "#/components/schemas/Subscription-External-Reference"
///    },
///    "payment_method_id": {
///      "$ref": "#/components/schemas/Payment-Method-Id"
///    },
///    "plan_variation_id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Variation-Id"
///    },
///    "setup_order_redirect_url": {
///      "$ref": "#/components/schemas/Setup-Order-Redirect-URL"
///    },
///    "trial_duration": {
///      "$ref": "#/components/schemas/Subscription-Trial-Duration"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionCreation {
    pub customer_id: CustomerId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub external_reference: ::std::option::Option<SubscriptionExternalReference>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub payment_method_id: ::std::option::Option<PaymentMethodId>,
    pub plan_variation_id: SubscriptionPlanVariationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub setup_order_redirect_url: ::std::option::Option<SetupOrderRedirectUrl>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial_duration: ::std::option::Option<SubscriptionTrialDuration>,
}
///`SubscriptionCycle`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id",
///    "number",
///    "plan_variation_id",
///    "state",
///    "subscription_id"
///  ],
///  "properties": {
///    "end_date": {
///      "$ref": "#/components/schemas/Subscription-Cycle-End-Date"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Id"
///    },
///    "number": {
///      "$ref": "#/components/schemas/Cycle-Number"
///    },
///    "order_id": {
///      "$ref": "#/components/schemas/Order-Id"
///    },
///    "plan_variation_id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Variation-Id"
///    },
///    "plan_variation_phase_id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Phase-Id"
///    },
///    "post_billing_order_id": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Post-Billing-Order-Id"
///    },
///    "previous_cycle_id": {
///      "$ref": "#/components/schemas/Previous-Cycle-Id"
///    },
///    "start_date": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Start-Date"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Subscription-Cycle-State"
///    },
///    "subscription_id": {
///      "$ref": "#/components/schemas/Subscription-Id"
///    },
///    "trial": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Trial"
///    },
///    "usage_cutoff_date": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Usage-Cutoff-Date"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionCycle {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub end_date: ::std::option::Option<SubscriptionCycleEndDate>,
    pub id: SubscriptionCycleId,
    pub number: CycleNumber,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub order_id: ::std::option::Option<OrderId>,
    pub plan_variation_id: SubscriptionPlanVariationId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub plan_variation_phase_id: ::std::option::Option<SubscriptionPlanPhaseId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub post_billing_order_id: ::std::option::Option<SubscriptionCyclePostBillingOrderId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub previous_cycle_id: ::std::option::Option<PreviousCycleId>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub start_date: ::std::option::Option<SubscriptionCycleStartDate>,
    pub state: SubscriptionCycleState,
    pub subscription_id: SubscriptionId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial: ::std::option::Option<SubscriptionCycleTrial>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub usage_cutoff_date: ::std::option::Option<SubscriptionCycleUsageCutoffDate>,
}
///The date and time the subscription cycle ends in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the subscription cycle ends 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 SubscriptionCycleEndDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionCycleEndDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCycleEndDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionCycleEndDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionCycleEndDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCycleEndDate {
    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 SubscriptionCycleEndDate {
    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 SubscriptionCycleEndDate {
    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 SubscriptionCycleEndDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///Unique identifier for the subscription cycle.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the subscription cycle.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionCycleId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionCycleId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCycleId> for ::uuid::Uuid {
    fn from(value: SubscriptionCycleId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionCycleId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCycleId {
    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 SubscriptionCycleId {
    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 SubscriptionCycleId {
    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 SubscriptionCycleId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The ID of the order created after the cycle's `usage_cutoff_date` to charge usage-based items accumulated during the cycle.
///
/// | Scenario | Detail |
/// | -------- | ------ |
/// | Ongoing subscription | This order also acts as the next cycle's `order_id`, combining usage post-billing for the current cycle with pre-billing for the next. |
/// | Last cycle | A standalone finishing order is created to charge all usage from this cycle. |
/// | Subscription ended with unpaid cycles | The finishing order consolidates all outstanding usage charges, including any from previous cycles where payment failed. |
///
/// :::note
/// Only present for cycles that include usage-based subscription items.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the order created after the cycle's `usage_cutoff_date` to charge usage-based items accumulated during the cycle.\n\n| Scenario | Detail |\n| -------- | ------ |\n| Ongoing subscription | This order also acts as the next cycle's `order_id`, combining usage post-billing for the current cycle with pre-billing for the next. |\n| Last cycle | A standalone finishing order is created to charge all usage from this cycle. |\n| Subscription ended with unpaid cycles | The finishing order consolidates all outstanding usage charges, including any from previous cycles where payment failed. |\n\n:::note\nOnly present for cycles that include usage-based subscription items.\n:::",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionCyclePostBillingOrderId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionCyclePostBillingOrderId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCyclePostBillingOrderId> for ::uuid::Uuid {
    fn from(value: SubscriptionCyclePostBillingOrderId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionCyclePostBillingOrderId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCyclePostBillingOrderId {
    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 SubscriptionCyclePostBillingOrderId {
    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 SubscriptionCyclePostBillingOrderId {
    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 SubscriptionCyclePostBillingOrderId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time the subscription cycle starts in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the subscription cycle starts 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 SubscriptionCycleStartDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionCycleStartDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCycleStartDate>
    for ::chrono::DateTime<::chrono::offset::Utc>
{
    fn from(value: SubscriptionCycleStartDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>>
    for SubscriptionCycleStartDate
{
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCycleStartDate {
    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 SubscriptionCycleStartDate {
    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 SubscriptionCycleStartDate {
    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 SubscriptionCycleStartDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The state of the subscription cycle.
///
/// | State | Description |
/// | ----- | ----------- |
/// | `pending` | The cycle has been created but has not yet started. A cycle can enter this state automatically when usage is reported for a future cycle via `POST /api/subscription-usages`. |
/// | `active` | The cycle is currently active and in progress. |
/// | `finished` | The cycle has completed. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of the subscription cycle.\n\n| State | Description |\n| ----- | ----------- |\n| `pending` | The cycle has been created but has not yet started. A cycle can enter this state automatically when usage is reported for a future cycle via `POST /api/subscription-usages`. |\n| `active` | The cycle is currently active and in progress. |\n| `finished` | The cycle has completed. |",
///  "type": "string",
///  "enum": [
///    "pending",
///    "active",
///    "finished"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SubscriptionCycleState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "finished")]
    Finished,
}
impl ::std::fmt::Display for SubscriptionCycleState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Active => f.write_str("active"),
            Self::Finished => f.write_str("finished"),
        }
    }
}
impl ::std::str::FromStr for SubscriptionCycleState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "active" => Ok(Self::Active),
            "finished" => Ok(Self::Finished),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionCycleState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionCycleState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionCycleState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Indicates whether this billing cycle occurs during the subscription's trial period.
///
/// This value is automatically calculated by the system based on the cycle's timing relative to the subscription's trial period. Returns `true` if the cycle is within the trial period (before `trial_end_date`), otherwise `false`.
///
/// Trial cycles typically have different billing behavior, such as reduced or zero charges.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Indicates whether this billing cycle occurs during the subscription's trial period.\n\nThis value is automatically calculated by the system based on the cycle's timing relative to the subscription's trial period. Returns `true` if the cycle is within the trial period (before `trial_end_date`), otherwise `false`. \n\nTrial cycles typically have different billing behavior, such as reduced or zero charges.",
///  "type": "boolean"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionCycleTrial(pub bool);
impl ::std::ops::Deref for SubscriptionCycleTrial {
    type Target = bool;
    fn deref(&self) -> &bool {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCycleTrial> for bool {
    fn from(value: SubscriptionCycleTrial) -> Self {
        value.0
    }
}
impl ::std::convert::From<bool> for SubscriptionCycleTrial {
    fn from(value: bool) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCycleTrial {
    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 SubscriptionCycleTrial {
    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 SubscriptionCycleTrial {
    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 SubscriptionCycleTrial {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The deadline for submitting or correcting usage records for this cycle, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// Set to 12 hours after the cycle's `end_date` by default. After this time, Revolut aggregates all reported usage records and creates the `post_billing_order_id` to initiate the charge.
///
/// :::note
/// Only present for cycles that include usage-based subscription items.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The deadline for submitting or correcting usage records for this cycle, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nSet to 12 hours after the cycle's `end_date` by default. After this time, Revolut aggregates all reported usage records and creates the `post_billing_order_id` to initiate the charge.\n\n:::note\nOnly present for cycles that include usage-based subscription items.\n:::",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionCycleUsageCutoffDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionCycleUsageCutoffDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionCycleUsageCutoffDate>
    for ::chrono::DateTime<::chrono::offset::Utc>
{
    fn from(value: SubscriptionCycleUsageCutoffDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>>
    for SubscriptionCycleUsageCutoffDate
{
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionCycleUsageCutoffDate {
    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 SubscriptionCycleUsageCutoffDate {
    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 SubscriptionCycleUsageCutoffDate {
    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 SubscriptionCycleUsageCutoffDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionCycles`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "cycles"
///  ],
///  "properties": {
///    "cycles": {
///      "description": "List of subscription cycles.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Cycle"
///      }
///    },
///    "next_page_token": {
///      "description": "Token for retrieving the next page of results.\n\nIf not present, there are no more results to retrieve.",
///      "type": [
///        "string",
///        "null"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionCycles {
    ///List of subscription cycles.
    pub cycles: ::std::vec::Vec<SubscriptionCycle>,
    /// Token for retrieving the next page of results.
    ///
    /// If not present, there are no more results to retrieve.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub next_page_token: ::std::option::Option<::std::string::String>,
}
/// Optional external reference for the subscription.
///
/// Use this field to store your own system's identifier for easy tracking and correlation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Optional external reference for the subscription.\n\nUse this field to store your own system's identifier for easy tracking and correlation.",
///  "type": "string",
///  "maxLength": 1024
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SubscriptionExternalReference(::std::string::String);
impl ::std::ops::Deref for SubscriptionExternalReference {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionExternalReference> for ::std::string::String {
    fn from(value: SubscriptionExternalReference) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SubscriptionExternalReference {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 1024usize {
            return Err("longer than 1024 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionExternalReference {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionExternalReference {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionExternalReference {
    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 SubscriptionExternalReference {
    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())
            })
    }
}
///Unique identifier for the subscription.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the subscription.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionId> for ::uuid::Uuid {
    fn from(value: SubscriptionId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionId {
    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 SubscriptionId {
    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 SubscriptionId {
    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 SubscriptionId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///A subscription item that defines a billing line within a plan phase. Can be either a fixed-fee (flat) item or a metered (usage) item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Subscription item",
///  "description": "A subscription item that defines a billing line within a plan phase. Can be either a fixed-fee (flat) item or a metered (usage) item.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Subscription-Item-Flat"
///    },
///    {
///      "$ref": "#/components/schemas/Subscription-Item-Usage"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SubscriptionItem {
    Flat(SubscriptionItemFlat),
    Usage(SubscriptionItemUsage),
}
impl ::std::convert::From<SubscriptionItemFlat> for SubscriptionItem {
    fn from(value: SubscriptionItemFlat) -> Self {
        Self::Flat(value)
    }
}
impl ::std::convert::From<SubscriptionItemUsage> for SubscriptionItem {
    fn from(value: SubscriptionItemUsage) -> Self {
        Self::Usage(value)
    }
}
/// A merchant-defined identifier for a usage-based subscription item. You set this code on each usage item when creating a subscription plan, and supply it when reporting consumption on [Create a subscription usage endpoint](https://developer.revolut.com/docs/merchant/create-subscription-usage) to target the correct metered item.
///
/// This allows a subscription with multiple usage items (e.g., `api_calls` and `storage_gb`) to receive consumption reports against the right item without relying on internal IDs.
///
/// The code must be unique within a plan phase.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A merchant-defined identifier for a usage-based subscription item. You set this code on each usage item when creating a subscription plan, and supply it when reporting consumption on [Create a subscription usage endpoint](https://developer.revolut.com/docs/merchant/create-subscription-usage) to target the correct metered item.\n\nThis allows a subscription with multiple usage items (e.g., `api_calls` and `storage_gb`) to receive consumption reports against the right item without relying on internal IDs.\n\nThe code must be unique within a plan phase.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SubscriptionItemCode(::std::string::String);
impl ::std::ops::Deref for SubscriptionItemCode {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemCode> for ::std::string::String {
    fn from(value: SubscriptionItemCode) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SubscriptionItemCode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionItemCode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionItemCode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionItemCode {
    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 SubscriptionItemCode {
    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 subscription item for a plan phase. Can be either a fixed-fee (flat) item or a metered (usage) item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Subscription item",
///  "description": "A subscription item for a plan phase. Can be either a fixed-fee (flat) item or a metered (usage) item.",
///  "type": "object",
///  "oneOf": [
///    {
///      "$ref": "#/components/schemas/Subscription-Item-Flat-Creation"
///    },
///    {
///      "$ref": "#/components/schemas/Subscription-Item-Usage-Creation"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SubscriptionItemCreation {
    FlatCreation(SubscriptionItemFlatCreation),
    UsageCreation(SubscriptionItemUsageCreation),
}
impl ::std::convert::From<SubscriptionItemFlatCreation> for SubscriptionItemCreation {
    fn from(value: SubscriptionItemFlatCreation) -> Self {
        Self::FlatCreation(value)
    }
}
impl ::std::convert::From<SubscriptionItemUsageCreation> for SubscriptionItemCreation {
    fn from(value: SubscriptionItemUsageCreation) -> Self {
        Self::UsageCreation(value)
    }
}
///Object structure of flat subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object structure of flat subscription item.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency",
///    "id",
///    "name",
///    "quantity",
///    "type",
///    "unit"
///  ],
///  "properties": {
///    "amount": {
///      "description": "Amount in minor currency units (e.g., cents for USD).",
///      "type": "integer"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Item-Id"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Item-Name"
///    },
///    "package_size": {
///      "$ref": "#/components/schemas/Subscription-Item-Package-Size"
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Subscription-Item-Quantity"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Subscription-Item-Type"
///    },
///    "unit": {
///      "$ref": "#/components/schemas/Subscription-Item-Unit"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionItemFlat {
    ///Amount in minor currency units (e.g., cents for USD).
    pub amount: i64,
    pub currency: Currency,
    pub id: SubscriptionItemId,
    pub name: SubscriptionItemName,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub package_size: ::std::option::Option<SubscriptionItemPackageSize>,
    pub quantity: SubscriptionItemQuantity,
    #[serde(rename = "type")]
    pub type_: SubscriptionItemType,
    pub unit: SubscriptionItemUnit,
}
///Object structure of flat subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object structure of flat subscription item.",
///  "type": "object",
///  "required": [
///    "amount",
///    "currency",
///    "name",
///    "quantity",
///    "type",
///    "unit"
///  ],
///  "properties": {
///    "amount": {
///      "description": "Amount in minor currency units (e.g., cents for USD).",
///      "type": "integer"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Item-Name"
///    },
///    "package_size": {
///      "$ref": "#/components/schemas/Subscription-Item-Package-Size"
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Subscription-Item-Quantity"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Subscription-Item-Type"
///    },
///    "unit": {
///      "$ref": "#/components/schemas/Subscription-Item-Unit"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionItemFlatCreation {
    ///Amount in minor currency units (e.g., cents for USD).
    pub amount: i64,
    pub currency: Currency,
    pub name: SubscriptionItemName,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub package_size: ::std::option::Option<SubscriptionItemPackageSize>,
    pub quantity: SubscriptionItemQuantity,
    #[serde(rename = "type")]
    pub type_: SubscriptionItemType,
    pub unit: SubscriptionItemUnit,
}
///The unique identifier of the subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique identifier of the subscription item.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionItemId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionItemId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemId> for ::uuid::Uuid {
    fn from(value: SubscriptionItemId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionItemId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionItemId {
    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 SubscriptionItemId {
    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 SubscriptionItemId {
    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 SubscriptionItemId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The name of the subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the subscription item.",
///  "type": "string",
///  "maxLength": 250
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SubscriptionItemName(::std::string::String);
impl ::std::ops::Deref for SubscriptionItemName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemName> for ::std::string::String {
    fn from(value: SubscriptionItemName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SubscriptionItemName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 250usize {
            return Err("longer than 250 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionItemName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionItemName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionItemName {
    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 SubscriptionItemName {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// The number of units grouped together as a single billable package. Used to enable pricing of items that are too inexpensive to charge individually.
///
/// For example, a `package_size` of `1000` with a unit price of 10 minor units (£0.10 in GBP) lets you sell 1000 tokens for £0.10 — effectively pricing each token at £0.0001, below the minimum chargeable amount.
///
/// Set to `1` to price each unit individually.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The number of units grouped together as a single billable package. Used to enable pricing of items that are too inexpensive to charge individually.\n\nFor example, a `package_size` of `1000` with a unit price of 10 minor units (£0.10 in GBP) lets you sell 1000 tokens for £0.10 — effectively pricing each token at £0.0001, below the minimum chargeable amount.\n\nSet to `1` to price each unit individually.",
///  "type": "number"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionItemPackageSize(pub f64);
impl ::std::ops::Deref for SubscriptionItemPackageSize {
    type Target = f64;
    fn deref(&self) -> &f64 {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemPackageSize> for f64 {
    fn from(value: SubscriptionItemPackageSize) -> Self {
        value.0
    }
}
impl ::std::convert::From<f64> for SubscriptionItemPackageSize {
    fn from(value: f64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionItemPackageSize {
    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 SubscriptionItemPackageSize {
    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 SubscriptionItemPackageSize {
    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 SubscriptionItemPackageSize {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The quantity of the item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The quantity of the item.",
///  "type": "number"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionItemQuantity(pub f64);
impl ::std::ops::Deref for SubscriptionItemQuantity {
    type Target = f64;
    fn deref(&self) -> &f64 {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemQuantity> for f64 {
    fn from(value: SubscriptionItemQuantity) -> Self {
        value.0
    }
}
impl ::std::convert::From<f64> for SubscriptionItemQuantity {
    fn from(value: f64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionItemQuantity {
    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 SubscriptionItemQuantity {
    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 SubscriptionItemQuantity {
    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 SubscriptionItemQuantity {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionItemTier`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "amount"
///  ],
///  "properties": {
///    "amount": {
///      "description": "Per-unit amount in minor currency units (e.g., cents for USD) charged for usage within this tier's threshold range.",
///      "type": "integer"
///    },
///    "upper_quantity_threshold": {
///      "description": "The upper bound of the tier (exclusive). Null means unlimited.",
///      "type": [
///        "number",
///        "null"
///      ]
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionItemTier {
    ///Per-unit amount in minor currency units (e.g., cents for USD) charged for usage within this tier's threshold range.
    pub amount: i64,
    ///The upper bound of the tier (exclusive). Null means unlimited.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub upper_quantity_threshold: ::std::option::Option<f64>,
}
///The type of subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of subscription item.",
///  "type": "string",
///  "enum": [
///    "flat",
///    "usage"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SubscriptionItemType {
    #[serde(rename = "flat")]
    Flat,
    #[serde(rename = "usage")]
    Usage,
}
impl ::std::fmt::Display for SubscriptionItemType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Flat => f.write_str("flat"),
            Self::Usage => f.write_str("usage"),
        }
    }
}
impl ::std::str::FromStr for SubscriptionItemType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "flat" => Ok(Self::Flat),
            "usage" => Ok(Self::Usage),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionItemType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionItemType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionItemType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The unit of measurement for the item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unit of measurement for the item.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SubscriptionItemUnit(::std::string::String);
impl ::std::ops::Deref for SubscriptionItemUnit {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemUnit> for ::std::string::String {
    fn from(value: SubscriptionItemUnit) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SubscriptionItemUnit {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionItemUnit {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionItemUnit {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionItemUnit {
    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 SubscriptionItemUnit {
    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())
            })
    }
}
///Object structure of usage subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object structure of usage subscription item.",
///  "type": "object",
///  "required": [
///    "code",
///    "currency",
///    "id",
///    "name",
///    "type",
///    "unit",
///    "usage_aggregation_method"
///  ],
///  "properties": {
///    "amount": {
///      "description": "Flat amount per unit in minor currency units. Mutually exclusive with `tiers`.",
///      "type": "integer"
///    },
///    "code": {
///      "$ref": "#/components/schemas/Subscription-Item-Code"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Item-Id"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Item-Name"
///    },
///    "package_size": {
///      "$ref": "#/components/schemas/Subscription-Item-Package-Size"
///    },
///    "tiers": {
///      "description": "Graduated pricing tiers. Mutually exclusive with `amount`.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Item-Tier"
///      }
///    },
///    "type": {
///      "$ref": "#/components/schemas/Subscription-Item-Type"
///    },
///    "unit": {
///      "$ref": "#/components/schemas/Subscription-Item-Unit"
///    },
///    "usage_aggregation_method": {
///      "$ref": "#/components/schemas/Usage-Aggregation-Method"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionItemUsage {
    ///Flat amount per unit in minor currency units. Mutually exclusive with `tiers`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<i64>,
    pub code: SubscriptionItemCode,
    pub currency: Currency,
    pub id: SubscriptionItemId,
    pub name: SubscriptionItemName,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub package_size: ::std::option::Option<SubscriptionItemPackageSize>,
    ///Graduated pricing tiers. Mutually exclusive with `amount`.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub tiers: ::std::vec::Vec<SubscriptionItemTier>,
    #[serde(rename = "type")]
    pub type_: SubscriptionItemType,
    pub unit: SubscriptionItemUnit,
    pub usage_aggregation_method: UsageAggregationMethod,
}
///Object structure for usage subscription item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object structure for usage subscription item.",
///  "type": "object",
///  "required": [
///    "code",
///    "currency",
///    "name",
///    "type",
///    "unit",
///    "usage_aggregation_method"
///  ],
///  "properties": {
///    "amount": {
///      "description": "Flat amount per unit in minor currency units. Mutually exclusive with `tiers`.",
///      "type": "integer"
///    },
///    "code": {
///      "$ref": "#/components/schemas/Subscription-Item-Code"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Item-Name"
///    },
///    "package_size": {
///      "$ref": "#/components/schemas/Subscription-Item-Package-Size"
///    },
///    "tiers": {
///      "description": "Graduated pricing tiers. Mutually exclusive with `amount`.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Item-Tier"
///      }
///    },
///    "type": {
///      "$ref": "#/components/schemas/Subscription-Item-Type"
///    },
///    "unit": {
///      "$ref": "#/components/schemas/Subscription-Item-Unit"
///    },
///    "usage_aggregation_method": {
///      "$ref": "#/components/schemas/Usage-Aggregation-Method"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionItemUsageCreation {
    ///Flat amount per unit in minor currency units. Mutually exclusive with `tiers`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<i64>,
    pub code: SubscriptionItemCode,
    pub currency: Currency,
    pub name: SubscriptionItemName,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub package_size: ::std::option::Option<SubscriptionItemPackageSize>,
    ///Graduated pricing tiers. Mutually exclusive with `amount`.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub tiers: ::std::vec::Vec<SubscriptionItemTier>,
    #[serde(rename = "type")]
    pub type_: SubscriptionItemType,
    pub unit: SubscriptionItemUnit,
    pub usage_aggregation_method: UsageAggregationMethod,
}
///A list of subscription items for this phase.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of subscription items for this phase.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Subscription-Item"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionItems(pub ::std::vec::Vec<SubscriptionItem>);
impl ::std::ops::Deref for SubscriptionItems {
    type Target = ::std::vec::Vec<SubscriptionItem>;
    fn deref(&self) -> &::std::vec::Vec<SubscriptionItem> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItems> for ::std::vec::Vec<SubscriptionItem> {
    fn from(value: SubscriptionItems) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<SubscriptionItem>> for SubscriptionItems {
    fn from(value: ::std::vec::Vec<SubscriptionItem>) -> Self {
        Self(value)
    }
}
///A list of subscription items for this phase.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A list of subscription items for this phase.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Subscription-Item-Creation"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionItemsCreation(pub ::std::vec::Vec<SubscriptionItemCreation>);
impl ::std::ops::Deref for SubscriptionItemsCreation {
    type Target = ::std::vec::Vec<SubscriptionItemCreation>;
    fn deref(&self) -> &::std::vec::Vec<SubscriptionItemCreation> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionItemsCreation> for ::std::vec::Vec<SubscriptionItemCreation> {
    fn from(value: SubscriptionItemsCreation) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<SubscriptionItemCreation>> for SubscriptionItemsCreation {
    fn from(value: ::std::vec::Vec<SubscriptionItemCreation>) -> Self {
        Self(value)
    }
}
/// The type of payment method used for the subscription.
///
/// | Type | Description |
/// | ---- | ----------- |
/// | `automatic` | Payments are automatically charged to the customer's saved payment method. |
/// | `manual` | Payments require manual processing by the customer. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The type of payment method used for the subscription.\n\n| Type | Description |\n| ---- | ----------- |\n| `automatic` | Payments are automatically charged to the customer's saved payment method. |\n| `manual` | Payments require manual processing by the customer. |",
///  "type": "string",
///  "enum": [
///    "automatic",
///    "manual"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SubscriptionPaymentMethodType {
    #[serde(rename = "automatic")]
    Automatic,
    #[serde(rename = "manual")]
    Manual,
}
impl ::std::fmt::Display for SubscriptionPaymentMethodType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Automatic => f.write_str("automatic"),
            Self::Manual => f.write_str("manual"),
        }
    }
}
impl ::std::str::FromStr for SubscriptionPaymentMethodType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "automatic" => Ok(Self::Automatic),
            "manual" => Ok(Self::Manual),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionPaymentMethodType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`SubscriptionPlan`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "name",
///    "state",
///    "updated_at",
///    "variations"
///  ],
///  "properties": {
///    "created_at": {
///      "$ref": "#/components/schemas/Subscription-Plan-Created"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Id"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Plan-Name"
///    },
///    "state": {
///      "$ref": "#/components/schemas/Subscription-Plan-State"
///    },
///    "trial_duration": {
///      "$ref": "#/components/schemas/Subscription-Plan-Trial-Duration"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/Subscription-Plan-Updated"
///    },
///    "variations": {
///      "description": "List of subscription plan variations.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Plan-Variation"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlan {
    pub created_at: SubscriptionPlanCreated,
    pub id: SubscriptionPlanId,
    pub name: SubscriptionPlanName,
    pub state: SubscriptionPlanState,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial_duration: ::std::option::Option<SubscriptionPlanTrialDuration>,
    pub updated_at: SubscriptionPlanUpdated,
    ///List of subscription plan variations.
    pub variations: ::std::vec::Vec<SubscriptionPlanVariation>,
}
///The date and time the subscription plan 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 subscription plan 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 SubscriptionPlanCreated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionPlanCreated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanCreated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionPlanCreated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionPlanCreated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanCreated {
    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 SubscriptionPlanCreated {
    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 SubscriptionPlanCreated {
    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 SubscriptionPlanCreated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionPlanCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "name",
///    "variations"
///  ],
///  "properties": {
///    "name": {
///      "$ref": "#/components/schemas/Subscription-Plan-Name"
///    },
///    "trial_duration": {
///      "$ref": "#/components/schemas/Subscription-Plan-Trial-Duration"
///    },
///    "variations": {
///      "description": "List of subscription plan variations (e.g., monthly, yearly pricing options).",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Plan-Variation-Creation"
///      },
///      "minItems": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlanCreation {
    pub name: SubscriptionPlanName,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub trial_duration: ::std::option::Option<SubscriptionPlanTrialDuration>,
    ///List of subscription plan variations (e.g., monthly, yearly pricing options).
    pub variations: ::std::vec::Vec<SubscriptionPlanVariationCreation>,
}
///Unique identifier for the subscription plan.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the subscription plan.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionPlanId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionPlanId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanId> for ::uuid::Uuid {
    fn from(value: SubscriptionPlanId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionPlanId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanId {
    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 SubscriptionPlanId {
    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 SubscriptionPlanId {
    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 SubscriptionPlanId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The name of the subscription plan.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The name of the subscription plan.",
///  "type": "string",
///  "maxLength": 1024,
///  "minLength": 1
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SubscriptionPlanName(::std::string::String);
impl ::std::ops::Deref for SubscriptionPlanName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanName> for ::std::string::String {
    fn from(value: SubscriptionPlanName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SubscriptionPlanName {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 1024usize {
            return Err("longer than 1024 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 SubscriptionPlanName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionPlanName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionPlanName {
    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 SubscriptionPlanName {
    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 sequential order of this phase in the subscription billing lifecycle.
///
/// Phases execute in ascending order based on this value:
/// - Phase with `ordinal=1` executes first
/// - Phase with `ordinal=2` executes second, and so on
///
/// When a phase completes its `cycle_count`, the subscription automatically progresses to the phase with the next `ordinal` value.
///
/// **Example**: A subscription with phases ordered as `ordinal=1` (trial), `ordinal=2` (regular), `ordinal=3` (discounted) will progress through them in that sequence.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Subscription-Plan-Ordinal",
///  "description": "The sequential order of this phase in the subscription billing lifecycle.\n\nPhases execute in ascending order based on this value:\n- Phase with `ordinal=1` executes first\n- Phase with `ordinal=2` executes second, and so on\n\nWhen a phase completes its `cycle_count`, the subscription automatically progresses to the phase with the next `ordinal` value.\n\n**Example**: A subscription with phases ordered as `ordinal=1` (trial), `ordinal=2` (regular), `ordinal=3` (discounted) will progress through them in that sequence.",
///  "type": "integer",
///  "minimum": 1.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionPlanOrdinal(pub ::std::num::NonZeroU64);
impl ::std::ops::Deref for SubscriptionPlanOrdinal {
    type Target = ::std::num::NonZeroU64;
    fn deref(&self) -> &::std::num::NonZeroU64 {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanOrdinal> for ::std::num::NonZeroU64 {
    fn from(value: SubscriptionPlanOrdinal) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::num::NonZeroU64> for SubscriptionPlanOrdinal {
    fn from(value: ::std::num::NonZeroU64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanOrdinal {
    type Err = <::std::num::NonZeroU64 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 SubscriptionPlanOrdinal {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for SubscriptionPlanOrdinal {
    type Error = <::std::num::NonZeroU64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for SubscriptionPlanOrdinal {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionPlanPhase`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "cycle_duration",
///    "id",
///    "ordinal"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Subscription-Amount"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "cycle_count": {
///      "$ref": "#/components/schemas/Cycle-Count"
///    },
///    "cycle_duration": {
///      "$ref": "#/components/schemas/Cycle-Duration"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Phase-Id"
///    },
///    "ordinal": {
///      "$ref": "#/components/schemas/Subscription-Plan-Ordinal"
///    },
///    "subscription_items": {
///      "$ref": "#/components/schemas/Subscription-Items"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlanPhase {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub amount: ::std::option::Option<SubscriptionAmount>,
    #[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 cycle_count: ::std::option::Option<CycleCount>,
    pub cycle_duration: CycleDuration,
    pub id: SubscriptionPlanPhaseId,
    pub ordinal: SubscriptionPlanOrdinal,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub subscription_items: ::std::option::Option<SubscriptionItems>,
}
///`SubscriptionPlanPhaseCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "amount",
///    "currency",
///    "cycle_duration",
///    "ordinal"
///  ],
///  "properties": {
///    "amount": {
///      "$ref": "#/components/schemas/Subscription-Amount"
///    },
///    "currency": {
///      "$ref": "#/components/schemas/Currency"
///    },
///    "cycle_count": {
///      "$ref": "#/components/schemas/Cycle-Count"
///    },
///    "cycle_duration": {
///      "$ref": "#/components/schemas/Cycle-Duration"
///    },
///    "ordinal": {
///      "$ref": "#/components/schemas/Subscription-Plan-Ordinal"
///    },
///    "subscription_items": {
///      "$ref": "#/components/schemas/Subscription-Items-Creation"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlanPhaseCreation {
    pub amount: SubscriptionAmount,
    pub currency: Currency,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub cycle_count: ::std::option::Option<CycleCount>,
    pub cycle_duration: CycleDuration,
    pub ordinal: SubscriptionPlanOrdinal,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub subscription_items: ::std::option::Option<SubscriptionItemsCreation>,
}
///Unique identifier for the subscription plan phase.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the subscription plan phase.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionPlanPhaseId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionPlanPhaseId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanPhaseId> for ::uuid::Uuid {
    fn from(value: SubscriptionPlanPhaseId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionPlanPhaseId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanPhaseId {
    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 SubscriptionPlanPhaseId {
    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 SubscriptionPlanPhaseId {
    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 SubscriptionPlanPhaseId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The state of the subscription plan.
///
/// | State | Description |
/// | ----- | ----------- |
/// | `active` | The plan is active and can be used to create new subscriptions. |
/// | `deactivated` | The plan has been deactivated and cannot be used for new subscriptions. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of the subscription plan.\n\n| State | Description |\n| ----- | ----------- |\n| `active` | The plan is active and can be used to create new subscriptions. |\n| `deactivated` | The plan has been deactivated and cannot be used for new subscriptions. |",
///  "type": "string",
///  "enum": [
///    "active",
///    "deactivated"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SubscriptionPlanState {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "deactivated")]
    Deactivated,
}
impl ::std::fmt::Display for SubscriptionPlanState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Active => f.write_str("active"),
            Self::Deactivated => f.write_str("deactivated"),
        }
    }
}
impl ::std::str::FromStr for SubscriptionPlanState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "active" => Ok(Self::Active),
            "deactivated" => Ok(Self::Deactivated),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionPlanState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionPlanState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionPlanState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The default trial period duration for this subscription plan in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) (e.g., "P14D" for 14 days).
///
/// This value serves as the default trial duration for all subscriptions created from this plan. Individual subscriptions can override this value at creation time.
///
/// :::note
/// Only days (`D`) are allowed. Time components such as hours, minutes, or seconds are not permitted.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The default trial period duration for this subscription plan in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) (e.g., \"P14D\" for 14 days).\n\nThis value serves as the default trial duration for all subscriptions created from this plan. Individual subscriptions can override this value at creation time.\n\n:::note\nOnly days (`D`) are allowed. Time components such as hours, minutes, or seconds are not permitted.\n:::",
///  "type": "string",
///  "format": "duration",
///  "pattern": "^P[0-9]+D$"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SubscriptionPlanTrialDuration(pub ::std::string::String);
impl ::std::ops::Deref for SubscriptionPlanTrialDuration {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanTrialDuration> for ::std::string::String {
    fn from(value: SubscriptionPlanTrialDuration) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SubscriptionPlanTrialDuration {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanTrialDuration {
    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 SubscriptionPlanTrialDuration {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time the subscription plan 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 subscription plan 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 SubscriptionPlanUpdated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionPlanUpdated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanUpdated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionPlanUpdated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionPlanUpdated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanUpdated {
    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 SubscriptionPlanUpdated {
    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 SubscriptionPlanUpdated {
    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 SubscriptionPlanUpdated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionPlanVariation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "id",
///    "phases"
///  ],
///  "properties": {
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Plan-Variation-Id"
///    },
///    "phases": {
///      "description": "List of billing phases for this variation.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Plan-Phase"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlanVariation {
    pub id: SubscriptionPlanVariationId,
    ///List of billing phases for this variation.
    pub phases: ::std::vec::Vec<SubscriptionPlanPhase>,
}
///`SubscriptionPlanVariationCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "phases"
///  ],
///  "properties": {
///    "phases": {
///      "description": "List of billing phases for this variation.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Plan-Phase-Creation"
///      },
///      "minItems": 1
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlanVariationCreation {
    ///List of billing phases for this variation.
    pub phases: ::std::vec::Vec<SubscriptionPlanPhaseCreation>,
}
///Unique identifier for the subscription plan variation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Unique identifier for the subscription plan variation.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionPlanVariationId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionPlanVariationId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionPlanVariationId> for ::uuid::Uuid {
    fn from(value: SubscriptionPlanVariationId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionPlanVariationId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionPlanVariationId {
    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 SubscriptionPlanVariationId {
    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 SubscriptionPlanVariationId {
    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 SubscriptionPlanVariationId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionPlans`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "subscription_plans"
///  ],
///  "properties": {
///    "next_page_token": {
///      "description": "Token for retrieving the next page of results.\n\nIf not present, there are no more results to retrieve.",
///      "type": [
///        "string",
///        "null"
///      ]
///    },
///    "subscription_plans": {
///      "description": "List of subscription plans.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Plan"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionPlans {
    /// Token for retrieving the next page of results.
    ///
    /// If not present, there are no more results to retrieve.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub next_page_token: ::std::option::Option<::std::string::String>,
    ///List of subscription plans.
    pub subscription_plans: ::std::vec::Vec<SubscriptionPlan>,
}
/// The date and time the subscription started in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// This field is `null` until the subscription becomes active.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time the subscription started in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nThis field is `null` until the subscription becomes active.",
///  "type": [
///    "string",
///    "null"
///  ],
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionStartDate(
    pub ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
);
impl ::std::ops::Deref for SubscriptionStartDate {
    type Target = ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>;
    fn deref(&self) -> &::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionStartDate>
    for ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>
{
    fn from(value: SubscriptionStartDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>>
    for SubscriptionStartDate
{
    fn from(value: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>) -> Self {
        Self(value)
    }
}
/// The state of the subscription.
///
/// | State | Description |
/// | ----- | ----------- |
/// | `pending` | The subscription has been created but is not yet active. This typically occurs when awaiting the first payment or setup completion. |
/// | `active` | The subscription is currently active and billing cycles are processing normally. |
/// | `overdue` | The subscription has a failed payment and is awaiting resolution. |
/// | `paused` | The subscription has been temporarily paused and no billing will occur. |
/// | `cancelled` | The subscription has been cancelled and will not renew. |
/// | `finished` | The subscription has completed all billing cycles (for limited-duration subscriptions). |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The state of the subscription.\n\n| State | Description |\n| ----- | ----------- |\n| `pending` | The subscription has been created but is not yet active. This typically occurs when awaiting the first payment or setup completion. |\n| `active` | The subscription is currently active and billing cycles are processing normally. |\n| `overdue` | The subscription has a failed payment and is awaiting resolution. |\n| `paused` | The subscription has been temporarily paused and no billing will occur. |\n| `cancelled` | The subscription has been cancelled and will not renew. |\n| `finished` | The subscription has completed all billing cycles (for limited-duration subscriptions). |",
///  "type": "string",
///  "enum": [
///    "pending",
///    "active",
///    "overdue",
///    "paused",
///    "cancelled",
///    "finished"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SubscriptionState {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "overdue")]
    Overdue,
    #[serde(rename = "paused")]
    Paused,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "finished")]
    Finished,
}
impl ::std::fmt::Display for SubscriptionState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pending => f.write_str("pending"),
            Self::Active => f.write_str("active"),
            Self::Overdue => f.write_str("overdue"),
            Self::Paused => f.write_str("paused"),
            Self::Cancelled => f.write_str("cancelled"),
            Self::Finished => f.write_str("finished"),
        }
    }
}
impl ::std::str::FromStr for SubscriptionState {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pending" => Ok(Self::Pending),
            "active" => Ok(Self::Active),
            "overdue" => Ok(Self::Overdue),
            "paused" => Ok(Self::Paused),
            "cancelled" => Ok(Self::Cancelled),
            "finished" => Ok(Self::Finished),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SubscriptionState {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SubscriptionState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SubscriptionState {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The trial period duration for this subscription in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) (e.g., "P14D" for 14 days).
///
/// ### Override plan defaults
///
/// Subscription plans can define a default trial duration. When creating a subscription, you can use this field to override the plan's default trial period:
///
/// | Field value | Behaviour | Example |
/// | ----------- | -------- | ------- |
/// | **Not provided** | Uses the trial duration defined in the plan (if any) | Plan has `"P7D"` → subscription gets 7-day trial |
/// | **Different value** | Overrides the plan's default trial duration | Plan has `"P7D"` → set to `"P30D"` for promotional offer, or `"P3D"` to reduce |
/// | **`"P0D"`** | Explicitly skips the trial period | Plan has `"P7D"` → set to `"P0D"` to skip trial entirely |
///
/// :::note
/// Only days (`D`) are allowed. Time components such as hours, minutes, or seconds are not permitted.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The trial period duration for this subscription in [ISO 8601 duration format](https://en.wikipedia.org/wiki/ISO_8601#Durations) (e.g., \"P14D\" for 14 days).\n\n### Override plan defaults\n\nSubscription plans can define a default trial duration. When creating a subscription, you can use this field to override the plan's default trial period:\n\n| Field value | Behaviour | Example |\n| ----------- | -------- | ------- |\n| **Not provided** | Uses the trial duration defined in the plan (if any) | Plan has `\"P7D\"` → subscription gets 7-day trial |\n| **Different value** | Overrides the plan's default trial duration | Plan has `\"P7D\"` → set to `\"P30D\"` for promotional offer, or `\"P3D\"` to reduce |\n| **`\"P0D\"`** | Explicitly skips the trial period | Plan has `\"P7D\"` → set to `\"P0D\"` to skip trial entirely |\n\n:::note\nOnly days (`D`) are allowed. Time components such as hours, minutes, or seconds are not permitted.\n:::",
///  "type": "string",
///  "format": "duration",
///  "pattern": "^P[0-9]+D$"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct SubscriptionTrialDuration(pub ::std::string::String);
impl ::std::ops::Deref for SubscriptionTrialDuration {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionTrialDuration> for ::std::string::String {
    fn from(value: SubscriptionTrialDuration) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for SubscriptionTrialDuration {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionTrialDuration {
    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 SubscriptionTrialDuration {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The date and time when the subscription's trial period ends in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
///
/// This value is automatically calculated by the system as: `start_date` + `trial_duration`
///
/// The `trial_duration` used in the calculation comes from either:
/// - The subscription's custom `trial_duration` (if provided at creation time), or
/// - The plan's default `trial_duration` (if no override was specified)
///
/// This field is `null` when the subscription has no trial period (e.g., when `trial_duration` is not set or is `"P0D"`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The date and time when the subscription's trial period ends in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\nThis value is automatically calculated by the system as: `start_date` + `trial_duration`\n\nThe `trial_duration` used in the calculation comes from either:\n- The subscription's custom `trial_duration` (if provided at creation time), or\n- The plan's default `trial_duration` (if no override was specified)\n\nThis field is `null` when the subscription has no trial period (e.g., when `trial_duration` is not set or is `\"P0D\"`).",
///  "type": [
///    "string",
///    "null"
///  ],
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionTrialEndDate(
    pub ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
);
impl ::std::ops::Deref for SubscriptionTrialEndDate {
    type Target = ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>;
    fn deref(&self) -> &::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionTrialEndDate>
    for ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>
{
    fn from(value: SubscriptionTrialEndDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>>
    for SubscriptionTrialEndDate
{
    fn from(value: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>) -> Self {
        Self(value)
    }
}
///`SubscriptionUpdate`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "external_reference": {
///      "$ref": "#/components/schemas/Subscription-External-Reference"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUpdate {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub external_reference: ::std::option::Option<SubscriptionExternalReference>,
}
impl ::std::default::Default for SubscriptionUpdate {
    fn default() -> Self {
        Self {
            external_reference: Default::default(),
        }
    }
}
///`SubscriptionUpdateRenewalDate`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "renewal_date"
///  ],
///  "properties": {
///    "renewal_date": {
///      "description": "The new renewal date for the subscription, expressed as a UTC date-time value.\n\nMust be set to a date later than the current renewal date; earlier dates are rejected.",
///      "type": "string",
///      "format": "date-time"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUpdateRenewalDate {
    /// The new renewal date for the subscription, expressed as a UTC date-time value.
    ///
    /// Must be set to a date later than the current renewal date; earlier dates are rejected.
    pub renewal_date: ::chrono::DateTime<::chrono::offset::Utc>,
}
///The date and time the subscription 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 subscription 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 SubscriptionUpdated(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionUpdated {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUpdated> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionUpdated) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionUpdated {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUpdated {
    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 SubscriptionUpdated {
    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 SubscriptionUpdated {
    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 SubscriptionUpdated {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionUsage`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "created_at",
///    "id",
///    "quantity",
///    "subscription_cycle_id",
///    "subscription_id",
///    "subscription_item_code",
///    "updated_at",
///    "usage_date"
///  ],
///  "properties": {
///    "created_at": {
///      "$ref": "#/components/schemas/Subscription-Usage-Created-Date"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Subscription-Usage-Id"
///    },
///    "metadata": {
///      "$ref": "#/components/schemas/Subscription-Usage-Metadata"
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Subscription-Usage-Quantity"
///    },
///    "subscription_cycle_id": {
///      "$ref": "#/components/schemas/Subscription-Cycle-Id"
///    },
///    "subscription_id": {
///      "$ref": "#/components/schemas/Subscription-Id"
///    },
///    "subscription_item_code": {
///      "$ref": "#/components/schemas/Subscription-Item-Code"
///    },
///    "updated_at": {
///      "$ref": "#/components/schemas/Subscription-Usage-Updated-Date"
///    },
///    "usage_date": {
///      "$ref": "#/components/schemas/Subscription-Usage-Date"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUsage {
    pub created_at: SubscriptionUsageCreatedDate,
    pub id: SubscriptionUsageId,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<SubscriptionUsageMetadata>,
    pub quantity: SubscriptionUsageQuantity,
    pub subscription_cycle_id: SubscriptionCycleId,
    pub subscription_id: SubscriptionId,
    pub subscription_item_code: SubscriptionItemCode,
    pub updated_at: SubscriptionUsageUpdatedDate,
    pub usage_date: SubscriptionUsageDate,
}
///The date and time the usage record 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 usage record 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 SubscriptionUsageCreatedDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionUsageCreatedDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageCreatedDate>
    for ::chrono::DateTime<::chrono::offset::Utc>
{
    fn from(value: SubscriptionUsageCreatedDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>>
    for SubscriptionUsageCreatedDate
{
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUsageCreatedDate {
    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 SubscriptionUsageCreatedDate {
    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 SubscriptionUsageCreatedDate {
    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 SubscriptionUsageCreatedDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionUsageCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "quantity",
///    "subscription_id",
///    "subscription_item_code",
///    "usage_date"
///  ],
///  "properties": {
///    "metadata": {
///      "$ref": "#/components/schemas/Subscription-Usage-Metadata"
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Subscription-Usage-Quantity"
///    },
///    "subscription_id": {
///      "$ref": "#/components/schemas/Subscription-Id"
///    },
///    "subscription_item_code": {
///      "$ref": "#/components/schemas/Subscription-Item-Code"
///    },
///    "usage_date": {
///      "$ref": "#/components/schemas/Subscription-Usage-Date"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUsageCreation {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<SubscriptionUsageMetadata>,
    pub quantity: SubscriptionUsageQuantity,
    pub subscription_id: SubscriptionId,
    pub subscription_item_code: SubscriptionItemCode,
    pub usage_date: SubscriptionUsageDate,
}
/// The timestamp indicating when the consumption actually occurred.
///
/// | Constraint | Detail |
/// | ---------- | ------ |
/// | Format | ISO 8601 date-time string (e.g., `YYYY-MM-DDTHH:mm:ssZ`). |
/// | Timezone | Must be UTC. |
/// | Validation | Revolut uses this to identify the applicable billing cycle. Accepted for the active cycle (`start_date ≤ usage_date < end_date`), for a recently ended cycle before its `usage_cutoff_date`, and for the one next upcoming cycle. Other dates are rejected. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The timestamp indicating when the consumption actually occurred.\n\n| Constraint | Detail |\n| ---------- | ------ |\n| Format | ISO 8601 date-time string (e.g., `YYYY-MM-DDTHH:mm:ssZ`). |\n| Timezone | Must be UTC. |\n| Validation | Revolut uses this to identify the applicable billing cycle. Accepted for the active cycle (`start_date ≤ usage_date < end_date`), for a recently ended cycle before its `usage_cutoff_date`, and for the one next upcoming cycle. Other dates are rejected. |",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionUsageDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionUsageDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SubscriptionUsageDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SubscriptionUsageDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUsageDate {
    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 SubscriptionUsageDate {
    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 SubscriptionUsageDate {
    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 SubscriptionUsageDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The unique identifier of the usage record.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The unique identifier of the usage record.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionUsageId(pub ::uuid::Uuid);
impl ::std::ops::Deref for SubscriptionUsageId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageId> for ::uuid::Uuid {
    fn from(value: SubscriptionUsageId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for SubscriptionUsageId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUsageId {
    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 SubscriptionUsageId {
    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 SubscriptionUsageId {
    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 SubscriptionUsageId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Key-value pairs you can attach to a usage record for your own tracking and reporting purposes.
///
/// | Constraint | Detail |
/// | ---------- | ------ |
/// | Keys | Maximum 50 keys per record. |
/// | Value types | String, number, or boolean only. |
/// | Number precision | Up to 20 digits before and 20 digits after the decimal point. |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Key-value pairs you can attach to a usage record for your own tracking and reporting purposes.\n\n| Constraint | Detail |\n| ---------- | ------ |\n| Keys | Maximum 50 keys per record. |\n| Value types | String, number, or boolean only. |\n| Number precision | Up to 20 digits before and 20 digits after the decimal point. |",
///  "type": "object",
///  "maxProperties": 50,
///  "additionalProperties": {
///    "anyOf": [
///      {
///        "type": "string"
///      },
///      {
///        "type": "number"
///      },
///      {
///        "type": "boolean"
///      }
///    ]
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionUsageMetadata(
    pub ::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue>,
);
impl ::std::ops::Deref for SubscriptionUsageMetadata {
    type Target =
        ::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue>;
    fn deref(
        &self,
    ) -> &::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageMetadata>
    for ::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue>
{
    fn from(value: SubscriptionUsageMetadata) -> Self {
        value.0
    }
}
impl
    ::std::convert::From<
        ::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue>,
    > for SubscriptionUsageMetadata
{
    fn from(
        value: ::std::collections::HashMap<::std::string::String, SubscriptionUsageMetadataValue>,
    ) -> Self {
        Self(value)
    }
}
///`SubscriptionUsageMetadataValue`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "anyOf": [
///    {
///      "type": "string"
///    },
///    {
///      "type": "number"
///    },
///    {
///      "type": "boolean"
///    }
///  ]
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum SubscriptionUsageMetadataValue {
    String(::std::string::String),
    Number(f64),
    Boolean(bool),
}
impl ::std::fmt::Display for SubscriptionUsageMetadataValue {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match self {
            Self::String(x) => x.fmt(f),
            Self::Number(x) => x.fmt(f),
            Self::Boolean(x) => x.fmt(f),
        }
    }
}
impl ::std::convert::From<f64> for SubscriptionUsageMetadataValue {
    fn from(value: f64) -> Self {
        Self::Number(value)
    }
}
impl ::std::convert::From<bool> for SubscriptionUsageMetadataValue {
    fn from(value: bool) -> Self {
        Self::Boolean(value)
    }
}
/// The quantity of consumption to record for this usage report.
///
/// Supports up to 20 digits before and 20 digits after the decimal point.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The quantity of consumption to record for this usage report. \n\nSupports up to 20 digits before and 20 digits after the decimal point.",
///  "type": "number",
///  "minimum": 0.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SubscriptionUsageQuantity(pub f64);
impl ::std::ops::Deref for SubscriptionUsageQuantity {
    type Target = f64;
    fn deref(&self) -> &f64 {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageQuantity> for f64 {
    fn from(value: SubscriptionUsageQuantity) -> Self {
        value.0
    }
}
impl ::std::convert::From<f64> for SubscriptionUsageQuantity {
    fn from(value: f64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUsageQuantity {
    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 SubscriptionUsageQuantity {
    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 SubscriptionUsageQuantity {
    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 SubscriptionUsageQuantity {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionUsageUpdate`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "metadata": {
///      "$ref": "#/components/schemas/Subscription-Usage-Metadata"
///    },
///    "quantity": {
///      "$ref": "#/components/schemas/Subscription-Usage-Quantity"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUsageUpdate {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub metadata: ::std::option::Option<SubscriptionUsageMetadata>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub quantity: ::std::option::Option<SubscriptionUsageQuantity>,
}
impl ::std::default::Default for SubscriptionUsageUpdate {
    fn default() -> Self {
        Self {
            metadata: Default::default(),
            quantity: Default::default(),
        }
    }
}
///The date and time the usage record 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 usage record 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 SubscriptionUsageUpdatedDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SubscriptionUsageUpdatedDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SubscriptionUsageUpdatedDate>
    for ::chrono::DateTime<::chrono::offset::Utc>
{
    fn from(value: SubscriptionUsageUpdatedDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>>
    for SubscriptionUsageUpdatedDate
{
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SubscriptionUsageUpdatedDate {
    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 SubscriptionUsageUpdatedDate {
    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 SubscriptionUsageUpdatedDate {
    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 SubscriptionUsageUpdatedDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SubscriptionUsages`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "properties": {
///    "next_page_token": {
///      "$ref": "#/components/schemas/Next-Page-Token"
///    },
///    "subscription_usages": {
///      "description": "List of subscription usages.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription-Usage"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionUsages {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub next_page_token: ::std::option::Option<NextPageToken>,
    ///List of subscription usages.
    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
    pub subscription_usages: ::std::vec::Vec<SubscriptionUsage>,
}
impl ::std::default::Default for SubscriptionUsages {
    fn default() -> Self {
        Self {
            next_page_token: Default::default(),
            subscription_usages: Default::default(),
        }
    }
}
///`Subscriptions`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "subscriptions"
///  ],
///  "properties": {
///    "next_page_token": {
///      "$ref": "#/components/schemas/Next-Page-Token"
///    },
///    "subscriptions": {
///      "description": "List of subscriptions.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Subscription"
///      }
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Subscriptions {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub next_page_token: ::std::option::Option<NextPageToken>,
    ///List of subscriptions.
    pub subscriptions: ::std::vec::Vec<Subscription>,
}
///[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the funds are released to merchants.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time when the funds are released to merchants.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SupplierPaymentDate(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for SupplierPaymentDate {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<SupplierPaymentDate> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: SupplierPaymentDate) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for SupplierPaymentDate {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for SupplierPaymentDate {
    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 SupplierPaymentDate {
    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 SupplierPaymentDate {
    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 SupplierPaymentDate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`SynchronousWebhook`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "SynchronousWebhook",
///  "type": "object",
///  "required": [
///    "event_type",
///    "id",
///    "signing_key",
///    "url"
///  ],
///  "properties": {
///    "event_type": {
///      "description": "Type of event this synchronous webhook is configured for.\n\n:::note\nAt the moment, synchronous webhooks only support address validation events. \n:::",
///      "type": "string",
///      "enum": [
///        "fast_checkout.validate_address"
///      ]
///    },
///    "id": {
///      "description": "The ID of the synchronous webhook object.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "signing_key": {
///      "description": "A randomly generated signing key, which can be used by merchants to authenticate requests from Revolut by verifying the signature. For more information, see: [Payload Signature](https://developer.revolut.com/docs/merchant/merchant-api#authentication).",
///      "type": "string",
///      "pattern": "^swsk_[a-zA-Z0-9]{32}$"
///    },
///    "url": {
///      "description": "The valid URL of the endpoint, that uses HTTPS URL schema. Revolut sends the shipping address of the customer to this URL for validation.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 2000,
///      "pattern": "^https:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SynchronousWebhook {
    /// Type of event this synchronous webhook is configured for.
    ///
    /// :::note
    /// At the moment, synchronous webhooks only support address validation events.
    /// :::
    pub event_type: SynchronousWebhookEventType,
    ///The ID of the synchronous webhook object.
    pub id: ::uuid::Uuid,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<LocationId>,
    ///A randomly generated signing key, which can be used by merchants to authenticate requests from Revolut by verifying the signature. For more information, see: [Payload Signature](https://developer.revolut.com/docs/merchant/merchant-api#authentication).
    pub signing_key: SynchronousWebhookSigningKey,
    /// The valid URL of the endpoint, that uses HTTPS URL schema. Revolut sends the shipping address of the customer to this URL for validation.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `2000`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    pub url: ::std::string::String,
}
/// The `SynchronousWebhook` object allows merchants to register endpoints on their backend for receiving predefined event types. Currently, only address validation events are available.
///
/// In addition, merchants can specify locations representing their online stores, enabling them to set up different webhooks for different stores.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "SynchronousWebhookCreation",
///  "description": "The `SynchronousWebhook` object allows merchants to register endpoints on their backend for receiving predefined event types. Currently, only address validation events are available.\n\nIn addition, merchants can specify locations representing their online stores, enabling them to set up different webhooks for different stores.",
///  "type": "object",
///  "required": [
///    "event_type",
///    "url"
///  ],
///  "properties": {
///    "event_type": {
///      "description": "Type of event this synchronous webhook is configured for.\n\n:::note\nAt the moment, synchronous webhooks only support address validation events. \n:::",
///      "type": "string",
///      "enum": [
///        "fast_checkout.validate_address"
///      ]
///    },
///    "location_id": {
///      "$ref": "#/components/schemas/Location-Id"
///    },
///    "url": {
///      "description": "The valid URL of the endpoint, that uses HTTPS URL schema. Revolut sends the shipping address of the customer to this URL for validation.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///      "type": "string",
///      "format": "uri",
///      "maxLength": 2000,
///      "pattern": "^https:\\/{2}.+/gi"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SynchronousWebhookCreation {
    /// Type of event this synchronous webhook is configured for.
    ///
    /// :::note
    /// At the moment, synchronous webhooks only support address validation events.
    /// :::
    pub event_type: SynchronousWebhookCreationEventType,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub location_id: ::std::option::Option<LocationId>,
    /// The valid URL of the endpoint, that uses HTTPS URL schema. Revolut sends the shipping address of the customer to this URL for validation.
    ///
    /// :::caution
    /// Restrictions:
    /// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
    /// - URI scheme is required and must be `https`
    /// - URI host is required and cannot be `localhost` or an IP address
    /// - Max length: `2000`
    /// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
    /// :::
    pub url: ::std::string::String,
}
/// Type of event this synchronous webhook is configured for.
///
/// :::note
/// At the moment, synchronous webhooks only support address validation events.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of event this synchronous webhook is configured for.\n\n:::note\nAt the moment, synchronous webhooks only support address validation events. \n:::",
///  "type": "string",
///  "enum": [
///    "fast_checkout.validate_address"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SynchronousWebhookCreationEventType {
    #[serde(rename = "fast_checkout.validate_address")]
    FastCheckoutValidateAddress,
}
impl ::std::fmt::Display for SynchronousWebhookCreationEventType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::FastCheckoutValidateAddress => f.write_str("fast_checkout.validate_address"),
        }
    }
}
impl ::std::str::FromStr for SynchronousWebhookCreationEventType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "fast_checkout.validate_address" => Ok(Self::FastCheckoutValidateAddress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SynchronousWebhookCreationEventType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SynchronousWebhookCreationEventType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SynchronousWebhookCreationEventType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// Type of event this synchronous webhook is configured for.
///
/// :::note
/// At the moment, synchronous webhooks only support address validation events.
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Type of event this synchronous webhook is configured for.\n\n:::note\nAt the moment, synchronous webhooks only support address validation events. \n:::",
///  "type": "string",
///  "enum": [
///    "fast_checkout.validate_address"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum SynchronousWebhookEventType {
    #[serde(rename = "fast_checkout.validate_address")]
    FastCheckoutValidateAddress,
}
impl ::std::fmt::Display for SynchronousWebhookEventType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::FastCheckoutValidateAddress => f.write_str("fast_checkout.validate_address"),
        }
    }
}
impl ::std::str::FromStr for SynchronousWebhookEventType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "fast_checkout.validate_address" => Ok(Self::FastCheckoutValidateAddress),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for SynchronousWebhookEventType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SynchronousWebhookEventType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SynchronousWebhookEventType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///A randomly generated signing key, which can be used by merchants to authenticate requests from Revolut by verifying the signature. For more information, see: [Payload Signature](https://developer.revolut.com/docs/merchant/merchant-api#authentication).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "A randomly generated signing key, which can be used by merchants to authenticate requests from Revolut by verifying the signature. For more information, see: [Payload Signature](https://developer.revolut.com/docs/merchant/merchant-api#authentication).",
///  "type": "string",
///  "pattern": "^swsk_[a-zA-Z0-9]{32}$"
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SynchronousWebhookSigningKey(::std::string::String);
impl ::std::ops::Deref for SynchronousWebhookSigningKey {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SynchronousWebhookSigningKey> for ::std::string::String {
    fn from(value: SynchronousWebhookSigningKey) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SynchronousWebhookSigningKey {
    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("^swsk_[a-zA-Z0-9]{32}$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^swsk_[a-zA-Z0-9]{32}$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SynchronousWebhookSigningKey {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SynchronousWebhookSigningKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SynchronousWebhookSigningKey {
    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 SynchronousWebhookSigningKey {
    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 about a tax applied to the line item, including its name and the corresponding amount.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Details about a tax applied to the line item, including its name and the corresponding amount.",
///  "type": "object",
///  "required": [
///    "amount",
///    "name"
///  ],
///  "properties": {
///    "amount": {
///      "description": "The monetary value of the tax in minor currency units (e.g., cents for EUR).",
///      "type": "integer",
///      "format": "int64",
///      "minimum": 0.0
///    },
///    "name": {
///      "description": "The specific name or designation of the tax applied to the line item.",
///      "type": "string",
///      "maxLength": 100
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Tax {
    ///The monetary value of the tax in minor currency units (e.g., cents for EUR).
    pub amount: i64,
    ///The specific name or designation of the tax applied to the line item.
    pub name: TaxName,
}
///The specific name or designation of the tax applied to the line item.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The specific name or designation of the tax applied to the line item.",
///  "type": "string",
///  "maxLength": 100
///}
/// ```text
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TaxName(::std::string::String);
impl ::std::ops::Deref for TaxName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TaxName> for ::std::string::String {
    fn from(value: TaxName) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for TaxName {
    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());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for TaxName {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for TaxName {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for TaxName {
    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 TaxName {
    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())
            })
    }
}
///Represents a Revolut Terminal device.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal",
///  "description": "Represents a Revolut Terminal device.",
///  "type": "object",
///  "required": [
///    "battery_level",
///    "id",
///    "last_online_at",
///    "name",
///    "online",
///    "serial_number",
///    "type"
///  ],
///  "properties": {
///    "battery_level": {
///      "$ref": "#/components/schemas/Terminal-Battery-Level"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Terminal-Id"
///    },
///    "last_online_at": {
///      "$ref": "#/components/schemas/Terminal-Last-Online-At"
///    },
///    "name": {
///      "$ref": "#/components/schemas/Terminal-Name"
///    },
///    "online": {
///      "$ref": "#/components/schemas/Terminal-Online"
///    },
///    "serial_number": {
///      "$ref": "#/components/schemas/Terminal-Serial-Number"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Terminal-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Terminal {
    pub battery_level: TerminalBatteryLevel,
    pub id: TerminalId,
    pub last_online_at: TerminalLastOnlineAt,
    pub name: TerminalName,
    pub online: TerminalOnline,
    pub serial_number: TerminalSerialNumber,
    #[serde(rename = "type")]
    pub type_: TerminalType,
}
///The current battery level of the terminal as a percentage (0-100).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal battery level",
///  "description": "The current battery level of the terminal as a percentage (0-100).",
///  "type": "integer",
///  "maximum": 100.0,
///  "minimum": 0.0
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TerminalBatteryLevel(pub i64);
impl ::std::ops::Deref for TerminalBatteryLevel {
    type Target = i64;
    fn deref(&self) -> &i64 {
        &self.0
    }
}
impl ::std::convert::From<TerminalBatteryLevel> for i64 {
    fn from(value: TerminalBatteryLevel) -> Self {
        value.0
    }
}
impl ::std::convert::From<i64> for TerminalBatteryLevel {
    fn from(value: i64) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalBatteryLevel {
    type Err = <i64 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 TerminalBatteryLevel {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<String> for TerminalBatteryLevel {
    type Error = <i64 as ::std::str::FromStr>::Err;
    fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
        value.parse()
    }
}
impl ::std::fmt::Display for TerminalBatteryLevel {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The unique identifier of the terminal.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal ID",
///  "description": "The unique identifier of the terminal.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TerminalId(pub ::uuid::Uuid);
impl ::std::ops::Deref for TerminalId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<TerminalId> for ::uuid::Uuid {
    fn from(value: TerminalId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for TerminalId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalId {
    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 TerminalId {
    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 TerminalId {
    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 TerminalId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The date and time when the terminal was last seen online.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal last online timestamp",
///  "description": "The date and time when the terminal was last seen online.",
///  "type": "string",
///  "format": "date-time"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TerminalLastOnlineAt(pub ::chrono::DateTime<::chrono::offset::Utc>);
impl ::std::ops::Deref for TerminalLastOnlineAt {
    type Target = ::chrono::DateTime<::chrono::offset::Utc>;
    fn deref(&self) -> &::chrono::DateTime<::chrono::offset::Utc> {
        &self.0
    }
}
impl ::std::convert::From<TerminalLastOnlineAt> for ::chrono::DateTime<::chrono::offset::Utc> {
    fn from(value: TerminalLastOnlineAt) -> Self {
        value.0
    }
}
impl ::std::convert::From<::chrono::DateTime<::chrono::offset::Utc>> for TerminalLastOnlineAt {
    fn from(value: ::chrono::DateTime<::chrono::offset::Utc>) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalLastOnlineAt {
    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 TerminalLastOnlineAt {
    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 TerminalLastOnlineAt {
    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 TerminalLastOnlineAt {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The name of the terminal device.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal name",
///  "description": "The name of the terminal device.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct TerminalName(pub ::std::string::String);
impl ::std::ops::Deref for TerminalName {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TerminalName> for ::std::string::String {
    fn from(value: TerminalName) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for TerminalName {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalName {
    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 TerminalName {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// Indicates whether the terminal is currently online and connected.
///
/// | Value | Description |
/// |-------|-------------|
/// | `true` | Terminal is online and available |
/// | `false` | Terminal is offline |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal online status",
///  "description": "Indicates whether the terminal is currently online and connected.\n\n| Value | Description |\n|-------|-------------|\n| `true` | Terminal is online and available |\n| `false` | Terminal is offline |",
///  "type": "boolean"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct TerminalOnline(pub bool);
impl ::std::ops::Deref for TerminalOnline {
    type Target = bool;
    fn deref(&self) -> &bool {
        &self.0
    }
}
impl ::std::convert::From<TerminalOnline> for bool {
    fn from(value: TerminalOnline) -> Self {
        value.0
    }
}
impl ::std::convert::From<bool> for TerminalOnline {
    fn from(value: bool) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalOnline {
    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 TerminalOnline {
    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 TerminalOnline {
    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 TerminalOnline {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// The operation mode of the terminal.
///
///   | Value | Description |
/// |-------|-------------|
/// | `pos` | Returns only terminals in Pay at Counter mode |
/// | `payment_acceptance` | Returns only terminals in standard checkout mode |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal operation mode",
///  "description": "The operation mode of the terminal.\n\n  | Value | Description |\n|-------|-------------|\n| `pos` | Returns only terminals in Pay at Counter mode |\n| `payment_acceptance` | Returns only terminals in standard checkout mode |",
///  "type": "string",
///  "enum": [
///    "pos",
///    "payment_acceptance"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TerminalOperationMode {
    #[serde(rename = "pos")]
    Pos,
    #[serde(rename = "payment_acceptance")]
    PaymentAcceptance,
}
impl ::std::fmt::Display for TerminalOperationMode {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Pos => f.write_str("pos"),
            Self::PaymentAcceptance => f.write_str("payment_acceptance"),
        }
    }
}
impl ::std::str::FromStr for TerminalOperationMode {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "pos" => Ok(Self::Pos),
            "payment_acceptance" => Ok(Self::PaymentAcceptance),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TerminalOperationMode {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for TerminalOperationMode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for TerminalOperationMode {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The serial number of the terminal device.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal serial number",
///  "description": "The serial number of the terminal device.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct TerminalSerialNumber(pub ::std::string::String);
impl ::std::ops::Deref for TerminalSerialNumber {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<TerminalSerialNumber> for ::std::string::String {
    fn from(value: TerminalSerialNumber) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for TerminalSerialNumber {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for TerminalSerialNumber {
    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 TerminalSerialNumber {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///The hardware type/model of the terminal device.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminal type",
///  "description": "The hardware type/model of the terminal device.",
///  "type": "string",
///  "enum": [
///    "youtransactor_ucube_touch",
///    "newland_n950",
///    "newland_n750",
///    "newland_r25p"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum TerminalType {
    #[serde(rename = "youtransactor_ucube_touch")]
    YoutransactorUcubeTouch,
    #[serde(rename = "newland_n950")]
    NewlandN950,
    #[serde(rename = "newland_n750")]
    NewlandN750,
    #[serde(rename = "newland_r25p")]
    NewlandR25p,
}
impl ::std::fmt::Display for TerminalType {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::YoutransactorUcubeTouch => f.write_str("youtransactor_ucube_touch"),
            Self::NewlandN950 => f.write_str("newland_n950"),
            Self::NewlandN750 => f.write_str("newland_n750"),
            Self::NewlandR25p => f.write_str("newland_r25p"),
        }
    }
}
impl ::std::str::FromStr for TerminalType {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "youtransactor_ucube_touch" => Ok(Self::YoutransactorUcubeTouch),
            "newland_n950" => Ok(Self::NewlandN950),
            "newland_n750" => Ok(Self::NewlandN750),
            "newland_r25p" => Ok(Self::NewlandR25p),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for TerminalType {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for TerminalType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for TerminalType {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///List of terminal devices.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "List of terminal devices.",
///  "type": "array",
///  "items": {
///    "$ref": "#/components/schemas/Terminal"
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Terminals(pub ::std::vec::Vec<Terminal>);
impl ::std::ops::Deref for Terminals {
    type Target = ::std::vec::Vec<Terminal>;
    fn deref(&self) -> &::std::vec::Vec<Terminal> {
        &self.0
    }
}
impl ::std::convert::From<Terminals> for ::std::vec::Vec<Terminal> {
    fn from(value: Terminals) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<Terminal>> for Terminals {
    fn from(value: ::std::vec::Vec<Terminal>) -> Self {
        Self(value)
    }
}
///Response containing a list of terminals.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Terminals response",
///  "description": "Response containing a list of terminals.",
///  "type": "object",
///  "required": [
///    "terminals"
///  ],
///  "properties": {
///    "terminals": {
///      "$ref": "#/components/schemas/Terminals"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TerminalsResponse {
    pub terminals: Terminals,
}
///Information about the 3DS challenge.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "three_ds",
///  "description": "Information about the 3DS challenge.",
///  "type": "object",
///  "required": [
///    "acs_url",
///    "type"
///  ],
///  "properties": {
///    "acs_url": {
///      "description": "The URL of the authentication challenge.",
///      "type": "string",
///      "format": "url"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Authentication-Challenge-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ThreeDs {
    ///The URL of the authentication challenge.
    pub acs_url: ::std::string::String,
    #[serde(rename = "type")]
    pub type_: AuthenticationChallengeType,
}
///Information about the 3DS fingerprint challenge.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "three_ds_fingerprint",
///  "description": "Information about the 3DS fingerprint challenge.",
///  "type": "object",
///  "required": [
///    "fingerprint_data",
///    "fingerprint_url",
///    "type"
///  ],
///  "properties": {
///    "fingerprint_data": {
///      "description": "Data about the fingerprint used for authentication. (Used only internally\nby Revolut.)",
///      "type": "string",
///      "format": "JSON"
///    },
///    "fingerprint_url": {
///      "description": "The URL of the fingerprint. (Used only internally by Revolut.)",
///      "type": "string",
///      "format": "url"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Authentication-Challenge-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ThreeDsFingerprint {
    /// Data about the fingerprint used for authentication. (Used only internally
    /// by Revolut.)
    pub fingerprint_data: ::std::string::String,
    ///The URL of the fingerprint. (Used only internally by Revolut.)
    pub fingerprint_url: ::std::string::String,
    #[serde(rename = "type")]
    pub type_: AuthenticationChallengeType,
}
///Information about the 3DS fingerprint challenge.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "three_ds_fingerprint",
///  "description": "Information about the 3DS fingerprint challenge.",
///  "type": "object",
///  "required": [
///    "fingerprint_html",
///    "type"
///  ],
///  "properties": {
///    "fingerprint_html": {
///      "description": "Base64-encoded HTML string for the 3DS fingerprint challenge. This HTML is fully\nconstructed by Revolut — no modifications are needed.\n\nDecode this value using a `base64` decoder and render the resulting HTML in your\nfront-end application. Revolut automatically moves the payment to the full 3DS\nchallenge if the fingerprint is not handled within 15 seconds.",
///      "type": "string",
///      "format": "byte"
///    },
///    "type": {
///      "$ref": "#/components/schemas/Authentication-Challenge-Type"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ThreeDsFingerprintV2 {
    /// Base64-encoded HTML string for the 3DS fingerprint challenge. This HTML is fully
    /// constructed by Revolut — no modifications are needed.
    ///
    /// Decode this value using a `base64` decoder and render the resulting HTML in your
    /// front-end application. Revolut automatically moves the payment to the full 3DS
    /// challenge if the fingerprint is not handled within 15 seconds.
    pub fingerprint_html: ::std::string::String,
    #[serde(rename = "type")]
    pub type_: AuthenticationChallengeType,
}
///Object containing information about a ticket associated with the booking.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing information about a ticket associated with the booking.",
///  "type": "object",
///  "required": [
///    "id"
///  ],
///  "properties": {
///    "id": {
///      "description": "A unique identifier provided by the merchant associated with the ticket.",
///      "type": "string"
///    },
///    "refundability": {
///      "$ref": "#/components/schemas/Refundability"
///    },
///    "transferable": {
///      "description": "Indicates whether the ticket is transferable to another buyer.",
///      "type": "boolean"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Ticket {
    ///A unique identifier provided by the merchant associated with the ticket.
    pub id: ::std::string::String,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub refundability: ::std::option::Option<Refundability>,
    ///Indicates whether the ticket is transferable to another buyer.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub transferable: ::std::option::Option<bool>,
}
///Object containing information about upcoming payments associated with the order.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Object containing information about upcoming payments associated with the order.",
///  "type": "object",
///  "required": [
///    "date",
///    "payment_method_id"
///  ],
///  "properties": {
///    "date": {
///      "description": "The date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) when the upcoming payment is scheduled to be executed.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "payment_method_id": {
///      "description": "The unique ID of the customer's payment method used to complete the scheduled payment.\n\n:::info\nFor more information about operations related to customer's payment methods, see:\n  - [Retrieve payment method list of a customer](https://developer.revolut.com/docs/merchant/retrieve-payment-method-list)\n  - [Retrieve a customer's payment method](https://developer.revolut.com/docs/merchant/retrieve-payment-method)\n  - [Update a customer's payment method](https://developer.revolut.com/docs/merchant/update-payment-method)\n  - [Delete a customer's payment method](https://developer.revolut.com/docs/merchant/delete-payment-method)\n:::",
///      "type": "string"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpcomingPayment {
    ///The date and time in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) when the upcoming payment is scheduled to be executed.
    pub date: ::chrono::DateTime<::chrono::offset::Utc>,
    /// The unique ID of the customer's payment method used to complete the scheduled payment.
    ///
    /// :::info
    /// For more information about operations related to customer's payment methods, see:
    ///   - [Retrieve payment method list of a customer](https://developer.revolut.com/docs/merchant/retrieve-payment-method-list)
    ///   - [Retrieve a customer's payment method](https://developer.revolut.com/docs/merchant/retrieve-payment-method)
    ///   - [Update a customer's payment method](https://developer.revolut.com/docs/merchant/update-payment-method)
    ///   - [Delete a customer's payment method](https://developer.revolut.com/docs/merchant/delete-payment-method)
    /// :::
    pub payment_method_id: ::std::string::String,
}
/// The method used to aggregate usage events over a billing cycle to calculate the chargeable amount.
///
/// | Value | Behaviour |
/// | ----- | --------- |
/// | `sum` | Totals all reported usage events during the cycle. Use for cumulative metrics (e.g., API calls, data transferred). |
/// | `latest` | Uses the most recently reported value at the end of the cycle. If no usage is reported in a cycle, `0` is used — values do not carry over from previous cycles. Use for gauge-style metrics (e.g., active seats). |
/// | `max` | Uses the peak value reported during the cycle. Use for capacity-based billing (e.g., max concurrent connections). |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The method used to aggregate usage events over a billing cycle to calculate the chargeable amount.\n\n| Value | Behaviour |\n| ----- | --------- |\n| `sum` | Totals all reported usage events during the cycle. Use for cumulative metrics (e.g., API calls, data transferred). |\n| `latest` | Uses the most recently reported value at the end of the cycle. If no usage is reported in a cycle, `0` is used — values do not carry over from previous cycles. Use for gauge-style metrics (e.g., active seats). |\n| `max` | Uses the peak value reported during the cycle. Use for capacity-based billing (e.g., max concurrent connections). |",
///  "type": "string",
///  "enum": [
///    "sum",
///    "latest",
///    "max"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum UsageAggregationMethod {
    #[serde(rename = "sum")]
    Sum,
    #[serde(rename = "latest")]
    Latest,
    #[serde(rename = "max")]
    Max,
}
impl ::std::fmt::Display for UsageAggregationMethod {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::Sum => f.write_str("sum"),
            Self::Latest => f.write_str("latest"),
            Self::Max => f.write_str("max"),
        }
    }
}
impl ::std::str::FromStr for UsageAggregationMethod {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "sum" => Ok(Self::Sum),
            "latest" => Ok(Self::Latest),
            "max" => Ok(Self::Max),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for UsageAggregationMethod {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for UsageAggregationMethod {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for UsageAggregationMethod {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/// The event type of the webhook notification that's sent by Revolut to your webhook URL.
///
/// Each event is related to status changes of a specific object in the Merchant API:
///
///   | Object | Event types |
///   | --------- | ----------- |
///   | `Order`   | <ul> <li>`ORDER_COMPLETED`</li> <li>`ORDER_AUTHORISED`</li> <li>`ORDER_CANCELLED`</li> <li>`ORDER_FAILED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_DECLINED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_FAILED`</li> </ul> |
///   | `Payment` | <ul> <li>`ORDER_PAYMENT_AUTHENTICATION_CHALLENGED`</li> <li>`ORDER_PAYMENT_AUTHENTICATED`</li> <li>`ORDER_PAYMENT_DECLINED`</li> <li>`ORDER_PAYMENT_FAILED`</li> </ul> |
///   | `Subscription`  | <ul> <li>`SUBSCRIPTION_INITIATED`</li> <li>`SUBSCRIPTION_FINISHED`</li> <li>`SUBSCRIPTION_CANCELLED`</li> <li>`SUBSCRIPTION_OVERDUE`</li></ul> |
///   | `Payout`  | <ul> <li>`PAYOUT_INITIATED`</li> <li>`PAYOUT_COMPLETED`</li> <li>`PAYOUT_FAILED`</li> </ul> |
///   | `Dispute`  | <ul> <li>`DISPUTE_ACTION_REQUIRED`</li> <li>`DISPUTE_UNDER_REVIEW`</li> <li>`DISPUTE_WON`</li> <li>`DISPUTE_LOST`</li></ul> |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The event type of the webhook notification that's sent by Revolut to your webhook URL.\n\nEach event is related to status changes of a specific object in the Merchant API:\n\n  | Object | Event types |\n  | --------- | ----------- |\n  | `Order`   | <ul> <li>`ORDER_COMPLETED`</li> <li>`ORDER_AUTHORISED`</li> <li>`ORDER_CANCELLED`</li> <li>`ORDER_FAILED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_DECLINED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_FAILED`</li> </ul> |\n  | `Payment` | <ul> <li>`ORDER_PAYMENT_AUTHENTICATION_CHALLENGED`</li> <li>`ORDER_PAYMENT_AUTHENTICATED`</li> <li>`ORDER_PAYMENT_DECLINED`</li> <li>`ORDER_PAYMENT_FAILED`</li> </ul> |\n  | `Subscription`  | <ul> <li>`SUBSCRIPTION_INITIATED`</li> <li>`SUBSCRIPTION_FINISHED`</li> <li>`SUBSCRIPTION_CANCELLED`</li> <li>`SUBSCRIPTION_OVERDUE`</li></ul> |\n  | `Payout`  | <ul> <li>`PAYOUT_INITIATED`</li> <li>`PAYOUT_COMPLETED`</li> <li>`PAYOUT_FAILED`</li> </ul> |\n  | `Dispute`  | <ul> <li>`DISPUTE_ACTION_REQUIRED`</li> <li>`DISPUTE_UNDER_REVIEW`</li> <li>`DISPUTE_WON`</li> <li>`DISPUTE_LOST`</li></ul> |",
///  "type": "string",
///  "enum": [
///    "ORDER_COMPLETED",
///    "ORDER_AUTHORISED",
///    "ORDER_CANCELLED",
///    "ORDER_FAILED",
///    "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED",
///    "ORDER_INCREMENTAL_AUTHORISATION_DECLINED",
///    "ORDER_INCREMENTAL_AUTHORISATION_FAILED",
///    "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED",
///    "ORDER_PAYMENT_AUTHENTICATED",
///    "ORDER_PAYMENT_DECLINED",
///    "ORDER_PAYMENT_FAILED",
///    "SUBSCRIPTION_INITIATED",
///    "SUBSCRIPTION_FINISHED",
///    "SUBSCRIPTION_CANCELLED",
///    "SUBSCRIPTION_OVERDUE",
///    "PAYOUT_INITIATED",
///    "PAYOUT_COMPLETED",
///    "PAYOUT_FAILED",
///    "DISPUTE_ACTION_REQUIRED",
///    "DISPUTE_UNDER_REVIEW",
///    "DISPUTE_WON",
///    "DISPUTE_LOST"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum WebhookCallbackEvent {
    #[serde(rename = "ORDER_COMPLETED")]
    OrderCompleted,
    #[serde(rename = "ORDER_AUTHORISED")]
    OrderAuthorised,
    #[serde(rename = "ORDER_CANCELLED")]
    OrderCancelled,
    #[serde(rename = "ORDER_FAILED")]
    OrderFailed,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED")]
    OrderIncrementalAuthorisationAuthorised,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_DECLINED")]
    OrderIncrementalAuthorisationDeclined,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_FAILED")]
    OrderIncrementalAuthorisationFailed,
    #[serde(rename = "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED")]
    OrderPaymentAuthenticationChallenged,
    #[serde(rename = "ORDER_PAYMENT_AUTHENTICATED")]
    OrderPaymentAuthenticated,
    #[serde(rename = "ORDER_PAYMENT_DECLINED")]
    OrderPaymentDeclined,
    #[serde(rename = "ORDER_PAYMENT_FAILED")]
    OrderPaymentFailed,
    #[serde(rename = "SUBSCRIPTION_INITIATED")]
    SubscriptionInitiated,
    #[serde(rename = "SUBSCRIPTION_FINISHED")]
    SubscriptionFinished,
    #[serde(rename = "SUBSCRIPTION_CANCELLED")]
    SubscriptionCancelled,
    #[serde(rename = "SUBSCRIPTION_OVERDUE")]
    SubscriptionOverdue,
    #[serde(rename = "PAYOUT_INITIATED")]
    PayoutInitiated,
    #[serde(rename = "PAYOUT_COMPLETED")]
    PayoutCompleted,
    #[serde(rename = "PAYOUT_FAILED")]
    PayoutFailed,
    #[serde(rename = "DISPUTE_ACTION_REQUIRED")]
    DisputeActionRequired,
    #[serde(rename = "DISPUTE_UNDER_REVIEW")]
    DisputeUnderReview,
    #[serde(rename = "DISPUTE_WON")]
    DisputeWon,
    #[serde(rename = "DISPUTE_LOST")]
    DisputeLost,
}
impl ::std::fmt::Display for WebhookCallbackEvent {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::OrderCompleted => f.write_str("ORDER_COMPLETED"),
            Self::OrderAuthorised => f.write_str("ORDER_AUTHORISED"),
            Self::OrderCancelled => f.write_str("ORDER_CANCELLED"),
            Self::OrderFailed => f.write_str("ORDER_FAILED"),
            Self::OrderIncrementalAuthorisationAuthorised => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED")
            }
            Self::OrderIncrementalAuthorisationDeclined => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_DECLINED")
            }
            Self::OrderIncrementalAuthorisationFailed => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_FAILED")
            }
            Self::OrderPaymentAuthenticationChallenged => {
                f.write_str("ORDER_PAYMENT_AUTHENTICATION_CHALLENGED")
            }
            Self::OrderPaymentAuthenticated => f.write_str("ORDER_PAYMENT_AUTHENTICATED"),
            Self::OrderPaymentDeclined => f.write_str("ORDER_PAYMENT_DECLINED"),
            Self::OrderPaymentFailed => f.write_str("ORDER_PAYMENT_FAILED"),
            Self::SubscriptionInitiated => f.write_str("SUBSCRIPTION_INITIATED"),
            Self::SubscriptionFinished => f.write_str("SUBSCRIPTION_FINISHED"),
            Self::SubscriptionCancelled => f.write_str("SUBSCRIPTION_CANCELLED"),
            Self::SubscriptionOverdue => f.write_str("SUBSCRIPTION_OVERDUE"),
            Self::PayoutInitiated => f.write_str("PAYOUT_INITIATED"),
            Self::PayoutCompleted => f.write_str("PAYOUT_COMPLETED"),
            Self::PayoutFailed => f.write_str("PAYOUT_FAILED"),
            Self::DisputeActionRequired => f.write_str("DISPUTE_ACTION_REQUIRED"),
            Self::DisputeUnderReview => f.write_str("DISPUTE_UNDER_REVIEW"),
            Self::DisputeWon => f.write_str("DISPUTE_WON"),
            Self::DisputeLost => f.write_str("DISPUTE_LOST"),
        }
    }
}
impl ::std::str::FromStr for WebhookCallbackEvent {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "ORDER_COMPLETED" => Ok(Self::OrderCompleted),
            "ORDER_AUTHORISED" => Ok(Self::OrderAuthorised),
            "ORDER_CANCELLED" => Ok(Self::OrderCancelled),
            "ORDER_FAILED" => Ok(Self::OrderFailed),
            "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED" => {
                Ok(Self::OrderIncrementalAuthorisationAuthorised)
            }
            "ORDER_INCREMENTAL_AUTHORISATION_DECLINED" => {
                Ok(Self::OrderIncrementalAuthorisationDeclined)
            }
            "ORDER_INCREMENTAL_AUTHORISATION_FAILED" => {
                Ok(Self::OrderIncrementalAuthorisationFailed)
            }
            "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED" => {
                Ok(Self::OrderPaymentAuthenticationChallenged)
            }
            "ORDER_PAYMENT_AUTHENTICATED" => Ok(Self::OrderPaymentAuthenticated),
            "ORDER_PAYMENT_DECLINED" => Ok(Self::OrderPaymentDeclined),
            "ORDER_PAYMENT_FAILED" => Ok(Self::OrderPaymentFailed),
            "SUBSCRIPTION_INITIATED" => Ok(Self::SubscriptionInitiated),
            "SUBSCRIPTION_FINISHED" => Ok(Self::SubscriptionFinished),
            "SUBSCRIPTION_CANCELLED" => Ok(Self::SubscriptionCancelled),
            "SUBSCRIPTION_OVERDUE" => Ok(Self::SubscriptionOverdue),
            "PAYOUT_INITIATED" => Ok(Self::PayoutInitiated),
            "PAYOUT_COMPLETED" => Ok(Self::PayoutCompleted),
            "PAYOUT_FAILED" => Ok(Self::PayoutFailed),
            "DISPUTE_ACTION_REQUIRED" => Ok(Self::DisputeActionRequired),
            "DISPUTE_UNDER_REVIEW" => Ok(Self::DisputeUnderReview),
            "DISPUTE_WON" => Ok(Self::DisputeWon),
            "DISPUTE_LOST" => Ok(Self::DisputeLost),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for WebhookCallbackEvent {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for WebhookCallbackEvent {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for WebhookCallbackEvent {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///`WebhookCreation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Webhook schema for creation and update operations",
///  "type": "object",
///  "required": [
///    "events",
///    "url"
///  ],
///  "properties": {
///    "events": {
///      "$ref": "#/components/schemas/Webhook-Events"
///    },
///    "url": {
///      "$ref": "#/components/schemas/Webhook-Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookCreation {
    pub events: WebhookEvents,
    pub url: WebhookUrl,
}
///`WebhookDisputeEvent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "dispute_id",
///    "event"
///  ],
///  "properties": {
///    "dispute_id": {
///      "description": "The ID of the dispute the event is related to.",
///      "type": "string",
///      "format": "uuid"
///    },
///    "event": {
///      "$ref": "#/components/schemas/Webhook-Callback-Event"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookDisputeEvent {
    ///The ID of the dispute the event is related to.
    pub dispute_id: ::uuid::Uuid,
    pub event: WebhookCallbackEvent,
}
/// List of event types that the webhook is configured to listen to.
///
/// Each event is related to status changes of a specific object in the Merchant API:
///
///   | Object | Event types |
///   | --------- | ----------- |
///   | `Order`   | <ul> <li>`ORDER_COMPLETED`</li> <li>`ORDER_AUTHORISED`</li> <li>`ORDER_CANCELLED`</li> <li>`ORDER_FAILED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_DECLINED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_FAILED`</li> </ul> |
///   | `Payment` | <ul> <li>`ORDER_PAYMENT_AUTHENTICATION_CHALLENGED`</li> <li>`ORDER_PAYMENT_AUTHENTICATED`</li> <li>`ORDER_PAYMENT_DECLINED`</li> <li>`ORDER_PAYMENT_FAILED`</li> </ul> |
///   | `Subscription`  | <ul> <li>`SUBSCRIPTION_INITIATED`</li> <li>`SUBSCRIPTION_FINISHED`</li> <li>`SUBSCRIPTION_CANCELLED`</li> <li>`SUBSCRIPTION_OVERDUE`</li></ul> |
///   | `Payout`  | <ul> <li>`PAYOUT_INITIATED`</li> <li>`PAYOUT_COMPLETED`</li> <li>`PAYOUT_FAILED`</li> </ul> |
///   | `Dispute`  | <ul> <li>`DISPUTE_ACTION_REQUIRED`</li> <li>`DISPUTE_UNDER_REVIEW`</li> <li>`DISPUTE_WON`</li> <li>`DISPUTE_LOST`</li></ul> |
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "List of event types that the webhook is configured to listen to.\n\nEach event is related to status changes of a specific object in the Merchant API:\n\n  | Object | Event types |\n  | --------- | ----------- |\n  | `Order`   | <ul> <li>`ORDER_COMPLETED`</li> <li>`ORDER_AUTHORISED`</li> <li>`ORDER_CANCELLED`</li> <li>`ORDER_FAILED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_DECLINED`</li> <li>`ORDER_INCREMENTAL_AUTHORISATION_FAILED`</li> </ul> |\n  | `Payment` | <ul> <li>`ORDER_PAYMENT_AUTHENTICATION_CHALLENGED`</li> <li>`ORDER_PAYMENT_AUTHENTICATED`</li> <li>`ORDER_PAYMENT_DECLINED`</li> <li>`ORDER_PAYMENT_FAILED`</li> </ul> |\n  | `Subscription`  | <ul> <li>`SUBSCRIPTION_INITIATED`</li> <li>`SUBSCRIPTION_FINISHED`</li> <li>`SUBSCRIPTION_CANCELLED`</li> <li>`SUBSCRIPTION_OVERDUE`</li></ul> |\n  | `Payout`  | <ul> <li>`PAYOUT_INITIATED`</li> <li>`PAYOUT_COMPLETED`</li> <li>`PAYOUT_FAILED`</li> </ul> |\n  | `Dispute`  | <ul> <li>`DISPUTE_ACTION_REQUIRED`</li> <li>`DISPUTE_UNDER_REVIEW`</li> <li>`DISPUTE_WON`</li> <li>`DISPUTE_LOST`</li></ul> |",
///  "type": "array",
///  "items": {
///    "description": "The available event types your can listen to.",
///    "type": "string",
///    "enum": [
///      "ORDER_COMPLETED",
///      "ORDER_AUTHORISED",
///      "ORDER_CANCELLED",
///      "ORDER_FAILED",
///      "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED",
///      "ORDER_INCREMENTAL_AUTHORISATION_DECLINED",
///      "ORDER_INCREMENTAL_AUTHORISATION_FAILED",
///      "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED",
///      "ORDER_PAYMENT_AUTHENTICATED",
///      "ORDER_PAYMENT_DECLINED",
///      "ORDER_PAYMENT_FAILED",
///      "SUBSCRIPTION_INITIATED",
///      "SUBSCRIPTION_FINISHED",
///      "SUBSCRIPTION_CANCELLED",
///      "SUBSCRIPTION_OVERDUE",
///      "PAYOUT_INITIATED",
///      "PAYOUT_COMPLETED",
///      "PAYOUT_FAILED",
///      "DISPUTE_ACTION_REQUIRED",
///      "DISPUTE_UNDER_REVIEW",
///      "DISPUTE_WON",
///      "DISPUTE_LOST"
///    ]
///  },
///  "minItems": 1
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct WebhookEvents(pub ::std::vec::Vec<WebhookEventsItem>);
impl ::std::ops::Deref for WebhookEvents {
    type Target = ::std::vec::Vec<WebhookEventsItem>;
    fn deref(&self) -> &::std::vec::Vec<WebhookEventsItem> {
        &self.0
    }
}
impl ::std::convert::From<WebhookEvents> for ::std::vec::Vec<WebhookEventsItem> {
    fn from(value: WebhookEvents) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::vec::Vec<WebhookEventsItem>> for WebhookEvents {
    fn from(value: ::std::vec::Vec<WebhookEventsItem>) -> Self {
        Self(value)
    }
}
///The available event types your can listen to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The available event types your can listen to.",
///  "type": "string",
///  "enum": [
///    "ORDER_COMPLETED",
///    "ORDER_AUTHORISED",
///    "ORDER_CANCELLED",
///    "ORDER_FAILED",
///    "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED",
///    "ORDER_INCREMENTAL_AUTHORISATION_DECLINED",
///    "ORDER_INCREMENTAL_AUTHORISATION_FAILED",
///    "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED",
///    "ORDER_PAYMENT_AUTHENTICATED",
///    "ORDER_PAYMENT_DECLINED",
///    "ORDER_PAYMENT_FAILED",
///    "SUBSCRIPTION_INITIATED",
///    "SUBSCRIPTION_FINISHED",
///    "SUBSCRIPTION_CANCELLED",
///    "SUBSCRIPTION_OVERDUE",
///    "PAYOUT_INITIATED",
///    "PAYOUT_COMPLETED",
///    "PAYOUT_FAILED",
///    "DISPUTE_ACTION_REQUIRED",
///    "DISPUTE_UNDER_REVIEW",
///    "DISPUTE_WON",
///    "DISPUTE_LOST"
///  ]
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
pub enum WebhookEventsItem {
    #[serde(rename = "ORDER_COMPLETED")]
    OrderCompleted,
    #[serde(rename = "ORDER_AUTHORISED")]
    OrderAuthorised,
    #[serde(rename = "ORDER_CANCELLED")]
    OrderCancelled,
    #[serde(rename = "ORDER_FAILED")]
    OrderFailed,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED")]
    OrderIncrementalAuthorisationAuthorised,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_DECLINED")]
    OrderIncrementalAuthorisationDeclined,
    #[serde(rename = "ORDER_INCREMENTAL_AUTHORISATION_FAILED")]
    OrderIncrementalAuthorisationFailed,
    #[serde(rename = "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED")]
    OrderPaymentAuthenticationChallenged,
    #[serde(rename = "ORDER_PAYMENT_AUTHENTICATED")]
    OrderPaymentAuthenticated,
    #[serde(rename = "ORDER_PAYMENT_DECLINED")]
    OrderPaymentDeclined,
    #[serde(rename = "ORDER_PAYMENT_FAILED")]
    OrderPaymentFailed,
    #[serde(rename = "SUBSCRIPTION_INITIATED")]
    SubscriptionInitiated,
    #[serde(rename = "SUBSCRIPTION_FINISHED")]
    SubscriptionFinished,
    #[serde(rename = "SUBSCRIPTION_CANCELLED")]
    SubscriptionCancelled,
    #[serde(rename = "SUBSCRIPTION_OVERDUE")]
    SubscriptionOverdue,
    #[serde(rename = "PAYOUT_INITIATED")]
    PayoutInitiated,
    #[serde(rename = "PAYOUT_COMPLETED")]
    PayoutCompleted,
    #[serde(rename = "PAYOUT_FAILED")]
    PayoutFailed,
    #[serde(rename = "DISPUTE_ACTION_REQUIRED")]
    DisputeActionRequired,
    #[serde(rename = "DISPUTE_UNDER_REVIEW")]
    DisputeUnderReview,
    #[serde(rename = "DISPUTE_WON")]
    DisputeWon,
    #[serde(rename = "DISPUTE_LOST")]
    DisputeLost,
}
impl ::std::fmt::Display for WebhookEventsItem {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::OrderCompleted => f.write_str("ORDER_COMPLETED"),
            Self::OrderAuthorised => f.write_str("ORDER_AUTHORISED"),
            Self::OrderCancelled => f.write_str("ORDER_CANCELLED"),
            Self::OrderFailed => f.write_str("ORDER_FAILED"),
            Self::OrderIncrementalAuthorisationAuthorised => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED")
            }
            Self::OrderIncrementalAuthorisationDeclined => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_DECLINED")
            }
            Self::OrderIncrementalAuthorisationFailed => {
                f.write_str("ORDER_INCREMENTAL_AUTHORISATION_FAILED")
            }
            Self::OrderPaymentAuthenticationChallenged => {
                f.write_str("ORDER_PAYMENT_AUTHENTICATION_CHALLENGED")
            }
            Self::OrderPaymentAuthenticated => f.write_str("ORDER_PAYMENT_AUTHENTICATED"),
            Self::OrderPaymentDeclined => f.write_str("ORDER_PAYMENT_DECLINED"),
            Self::OrderPaymentFailed => f.write_str("ORDER_PAYMENT_FAILED"),
            Self::SubscriptionInitiated => f.write_str("SUBSCRIPTION_INITIATED"),
            Self::SubscriptionFinished => f.write_str("SUBSCRIPTION_FINISHED"),
            Self::SubscriptionCancelled => f.write_str("SUBSCRIPTION_CANCELLED"),
            Self::SubscriptionOverdue => f.write_str("SUBSCRIPTION_OVERDUE"),
            Self::PayoutInitiated => f.write_str("PAYOUT_INITIATED"),
            Self::PayoutCompleted => f.write_str("PAYOUT_COMPLETED"),
            Self::PayoutFailed => f.write_str("PAYOUT_FAILED"),
            Self::DisputeActionRequired => f.write_str("DISPUTE_ACTION_REQUIRED"),
            Self::DisputeUnderReview => f.write_str("DISPUTE_UNDER_REVIEW"),
            Self::DisputeWon => f.write_str("DISPUTE_WON"),
            Self::DisputeLost => f.write_str("DISPUTE_LOST"),
        }
    }
}
impl ::std::str::FromStr for WebhookEventsItem {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "ORDER_COMPLETED" => Ok(Self::OrderCompleted),
            "ORDER_AUTHORISED" => Ok(Self::OrderAuthorised),
            "ORDER_CANCELLED" => Ok(Self::OrderCancelled),
            "ORDER_FAILED" => Ok(Self::OrderFailed),
            "ORDER_INCREMENTAL_AUTHORISATION_AUTHORISED" => {
                Ok(Self::OrderIncrementalAuthorisationAuthorised)
            }
            "ORDER_INCREMENTAL_AUTHORISATION_DECLINED" => {
                Ok(Self::OrderIncrementalAuthorisationDeclined)
            }
            "ORDER_INCREMENTAL_AUTHORISATION_FAILED" => {
                Ok(Self::OrderIncrementalAuthorisationFailed)
            }
            "ORDER_PAYMENT_AUTHENTICATION_CHALLENGED" => {
                Ok(Self::OrderPaymentAuthenticationChallenged)
            }
            "ORDER_PAYMENT_AUTHENTICATED" => Ok(Self::OrderPaymentAuthenticated),
            "ORDER_PAYMENT_DECLINED" => Ok(Self::OrderPaymentDeclined),
            "ORDER_PAYMENT_FAILED" => Ok(Self::OrderPaymentFailed),
            "SUBSCRIPTION_INITIATED" => Ok(Self::SubscriptionInitiated),
            "SUBSCRIPTION_FINISHED" => Ok(Self::SubscriptionFinished),
            "SUBSCRIPTION_CANCELLED" => Ok(Self::SubscriptionCancelled),
            "SUBSCRIPTION_OVERDUE" => Ok(Self::SubscriptionOverdue),
            "PAYOUT_INITIATED" => Ok(Self::PayoutInitiated),
            "PAYOUT_COMPLETED" => Ok(Self::PayoutCompleted),
            "PAYOUT_FAILED" => Ok(Self::PayoutFailed),
            "DISPUTE_ACTION_REQUIRED" => Ok(Self::DisputeActionRequired),
            "DISPUTE_UNDER_REVIEW" => Ok(Self::DisputeUnderReview),
            "DISPUTE_WON" => Ok(Self::DisputeWon),
            "DISPUTE_LOST" => Ok(Self::DisputeLost),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for WebhookEventsItem {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for WebhookEventsItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for WebhookEventsItem {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
///The ID of the webhook.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The ID of the webhook.",
///  "type": "string",
///  "format": "uuid"
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct WebhookId(pub ::uuid::Uuid);
impl ::std::ops::Deref for WebhookId {
    type Target = ::uuid::Uuid;
    fn deref(&self) -> &::uuid::Uuid {
        &self.0
    }
}
impl ::std::convert::From<WebhookId> for ::uuid::Uuid {
    fn from(value: WebhookId) -> Self {
        value.0
    }
}
impl ::std::convert::From<::uuid::Uuid> for WebhookId {
    fn from(value: ::uuid::Uuid) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for WebhookId {
    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 WebhookId {
    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 WebhookId {
    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 WebhookId {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`WebhookOrderEvent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "event",
///    "order_id"
///  ],
///  "properties": {
///    "event": {
///      "$ref": "#/components/schemas/Webhook-Callback-Event"
///    },
///    "incremental_authorisation_ext_reference": {
///      "description": "The reference sent in the `reference` field of the [Increment authorisation](https://developer.revolut.com/docs/merchant/increment-authorisation) request. Only present for incremental authorisation events.",
///      "type": "string"
///    },
///    "merchant_order_ext_ref": {
///      "description": "The information sent during order creation in the\n`merchant_order_data.reference` field.",
///      "type": "string"
///    },
///    "order_id": {
///      "description": "The ID of the order the event is related to.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookOrderEvent {
    pub event: WebhookCallbackEvent,
    ///The reference sent in the `reference` field of the [Increment authorisation](https://developer.revolut.com/docs/merchant/increment-authorisation) request. Only present for incremental authorisation events.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub incremental_authorisation_ext_reference: ::std::option::Option<::std::string::String>,
    /// The information sent during order creation in the
    /// `merchant_order_data.reference` field.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub merchant_order_ext_ref: ::std::option::Option<::std::string::String>,
    ///The ID of the order the event is related to.
    pub order_id: ::uuid::Uuid,
}
///`WebhookPayoutEvent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "event",
///    "payout_id"
///  ],
///  "properties": {
///    "event": {
///      "$ref": "#/components/schemas/Webhook-Callback-Event"
///    },
///    "payout_id": {
///      "description": "The ID of the payout the event is related to.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookPayoutEvent {
    pub event: WebhookCallbackEvent,
    ///The ID of the payout the event is related to.
    pub payout_id: ::uuid::Uuid,
}
///The signing secret for the webhook. Use it to verify the signature for the webhook request's payload.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The signing secret for the webhook. Use it to verify the signature for the webhook request's payload.",
///  "type": "string"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct WebhookSigningSecret(pub ::std::string::String);
impl ::std::ops::Deref for WebhookSigningSecret {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<WebhookSigningSecret> for ::std::string::String {
    fn from(value: WebhookSigningSecret) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for WebhookSigningSecret {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for WebhookSigningSecret {
    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 WebhookSigningSecret {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
///`WebhookSubscriptionEvent`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "event",
///    "subscription_id"
///  ],
///  "properties": {
///    "event": {
///      "$ref": "#/components/schemas/Webhook-Callback-Event"
///    },
///    "external_reference": {
///      "description": "The information sent in the `external_reference` field of the [Create a subscription](https://developer.revolut.com/docs/merchant/create-subscription) request.",
///      "type": "string"
///    },
///    "subscription_id": {
///      "description": "The ID of the subscription the event is related to.",
///      "type": "string",
///      "format": "uuid"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookSubscriptionEvent {
    pub event: WebhookCallbackEvent,
    ///The information sent in the `external_reference` field of the [Create a subscription](https://developer.revolut.com/docs/merchant/create-subscription) request.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub external_reference: ::std::option::Option<::std::string::String>,
    ///The ID of the subscription the event is related to.
    pub subscription_id: ::uuid::Uuid,
}
/// The request body for updating a webhook.
///
/// All fields are optional. Only the fields provided in the request will be updated.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Webhook update",
///  "description": "The request body for updating a webhook.\n\nAll fields are optional. Only the fields provided in the request will be updated.",
///  "type": "object",
///  "properties": {
///    "events": {
///      "$ref": "#/components/schemas/Webhook-Events"
///    },
///    "url": {
///      "$ref": "#/components/schemas/Webhook-Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookUpdate {
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub events: ::std::option::Option<WebhookEvents>,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub url: ::std::option::Option<WebhookUrl>,
}
impl ::std::default::Default for WebhookUpdate {
    fn default() -> Self {
        Self {
            events: Default::default(),
            url: Default::default(),
        }
    }
}
/// Your webhook's URL to which event notifications will be sent.
///
/// Must be a valid HTTP or HTTPS URL, capable of receiving `POST` requests.
///
/// :::caution
/// Restrictions:
/// - Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)
/// - URI scheme is required and must be either `http` or `https`
/// - URI host is required and cannot be `localhost` or an IP address
/// - Max length: `2000`
/// - Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)
/// :::
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Your webhook's URL to which event notifications will be sent. \n\nMust be a valid HTTP or HTTPS URL, capable of receiving `POST` requests.\n\n:::caution\nRestrictions:\n- Must be a valid URI as defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986)\n- URI scheme is required and must be either `http` or `https`\n- URI host is required and cannot be `localhost` or an IP address\n- Max length: `2000`\n- Reserved or invalid characters must be percent-encoded (for example, use `%20` instead of a space)\n:::",
///  "type": "string",
///  "format": "uri",
///  "maxLength": 2000,
///  "pattern": "^https?:\\/{2}.+/gi"
///}
/// ```text
/// </details>
#[derive(
    ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct WebhookUrl(pub ::std::string::String);
impl ::std::ops::Deref for WebhookUrl {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<WebhookUrl> for ::std::string::String {
    fn from(value: WebhookUrl) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::string::String> for WebhookUrl {
    fn from(value: ::std::string::String) -> Self {
        Self(value)
    }
}
impl ::std::str::FromStr for WebhookUrl {
    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 WebhookUrl {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        self.0.fmt(f)
    }
}
/// A webhook object.
///
/// Unlike the legacy API, `signing_secret` is included in all webhook responses, not only on creation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Webhook",
///  "description": "A webhook object.\n\nUnlike the legacy API, `signing_secret` is included in all webhook responses, not only on creation.",
///  "type": "object",
///  "required": [
///    "events",
///    "id",
///    "signing_secret",
///    "url"
///  ],
///  "properties": {
///    "events": {
///      "$ref": "#/components/schemas/Webhook-Events"
///    },
///    "id": {
///      "$ref": "#/components/schemas/Webhook-Id"
///    },
///    "signing_secret": {
///      "$ref": "#/components/schemas/Webhook-Signing-Secret"
///    },
///    "url": {
///      "$ref": "#/components/schemas/Webhook-Url"
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookV2 {
    pub events: WebhookEvents,
    pub id: WebhookId,
    pub signing_secret: WebhookSigningSecret,
    pub url: WebhookUrl,
}
///`Webhooks`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "object",
///  "required": [
///    "webhooks"
///  ],
///  "properties": {
///    "webhooks": {
///      "description": "List of webhooks.",
///      "type": "array",
///      "items": {
///        "$ref": "#/components/schemas/Webhook-v2"
///      },
///      "maxItems": 10
///    }
///  }
///}
/// ```text
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Webhooks {
    ///List of webhooks.
    pub webhooks: ::std::vec::Vec<WebhookV2>,
}
