/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetPhoneNumber200ResponsePhoneNumber {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
    pub phone_number: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    #[serde(rename = "metaPreverifiedId", skip_serializing_if = "Option::is_none")]
    pub meta_preverified_id: Option<String>,
    #[serde(
        rename = "metaVerificationStatus",
        skip_serializing_if = "Option::is_none"
    )]
    pub meta_verification_status: Option<String>,
    /// For a regulated number with an Onfido ID step — the link to forward to the end user. Appears once the order is placed; null otherwise.
    #[serde(
        rename = "onfidoVerificationUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub onfido_verification_url: Option<Option<String>>,
    #[serde(
        rename = "endUserFirstName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub end_user_first_name: Option<Option<String>>,
    #[serde(
        rename = "endUserLastName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub end_user_last_name: Option<Option<String>>,
    /// Reviewer rejection reason when status is regulatory_declined.
    #[serde(
        rename = "regulatoryDeclineReason",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub regulatory_decline_reason: Option<Option<String>>,
    #[serde(rename = "provisionedAt", skip_serializing_if = "Option::is_none")]
    pub provisioned_at: Option<String>,
}

impl GetPhoneNumber200ResponsePhoneNumber {
    pub fn new() -> GetPhoneNumber200ResponsePhoneNumber {
        GetPhoneNumber200ResponsePhoneNumber {
            id: None,
            phone_number: None,
            status: None,
            country: None,
            meta_preverified_id: None,
            meta_verification_status: None,
            onfido_verification_url: None,
            end_user_first_name: None,
            end_user_last_name: None,
            regulatory_decline_reason: None,
            provisioned_at: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending_payment")]
    PendingPayment,
    #[serde(rename = "pending_regulatory")]
    PendingRegulatory,
    #[serde(rename = "regulatory_declined")]
    RegulatoryDeclined,
    #[serde(rename = "provisioning")]
    Provisioning,
    #[serde(rename = "verifying")]
    Verifying,
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "suspended")]
    Suspended,
    #[serde(rename = "releasing")]
    Releasing,
    #[serde(rename = "released")]
    Released,
}

impl Default for Status {
    fn default() -> Status {
        Self::PendingPayment
    }
}
