late 0.0.1340

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.522.1
 * 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 CheckPhoneNumberAvailability200Response {
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    #[serde(rename = "numberType", skip_serializing_if = "Option::is_none")]
    pub number_type: Option<String>,
    /// Whether deliverable voice inventory exists right now.
    #[serde(rename = "available", skip_serializing_if = "Option::is_none")]
    pub available: Option<bool>,
    /// Nothing deliverable now, but this pair can be pre-ordered: submit KYC as usual and we buy regular stock the moment it returns, otherwise the carrier sources the number (usually 2 to 4 weeks, never guaranteed). Only document tiers (3/4) qualify.
    #[serde(rename = "preOrderable", skip_serializing_if = "Option::is_none")]
    pub pre_orderable: Option<bool>,
    #[serde(rename = "addressConstraint", skip_serializing_if = "Option::is_none")]
    pub address_constraint: Option<AddressConstraint>,
    /// For `geo` only: the area(s) the registered address must be in.
    #[serde(rename = "areas", skip_serializing_if = "Option::is_none")]
    pub areas: Option<Vec<String>>,
    /// Live inventory grouped by area code. Empty when out of stock (or the area lookup failed). Equal to `areaAvailability.inStock`.  - US and CA: the full country inventory (every area code with stock), recognizable metros first, then alphabetical. - Other countries: largest stock first, listing the areas in the latest inventory page (up to 500 numbers, which for most countries is the entire pool).  Pass a chosen `ndc` as `areaCode` on POST /v1/phone-numbers/purchase (or on the KYC submit for regulated countries) to require that area.
    #[serde(rename = "areaOptions", skip_serializing_if = "Option::is_none")]
    pub area_options: Option<Vec<models::CheckPhoneNumberAvailability200ResponseAreaOptionsInner>>,
    /// Every area of the country's numbering plan with nothing deliverable now: `areaAvailability.preOrder` plus `areaAvailability.outOfStock`, kept for older clients. Pass one as `areaCode` with `preOrder: true` on the KYC submit when `preOrderable` is true, or watch it with POST /v1/phone-numbers/stock-watches.
    #[serde(rename = "soldOutAreas", skip_serializing_if = "Option::is_none")]
    pub sold_out_areas:
        Option<Vec<models::CheckPhoneNumberAvailability200ResponseSoldOutAreasInner>>,
    #[serde(rename = "areaAvailability", skip_serializing_if = "Option::is_none")]
    pub area_availability:
        Option<Box<models::CheckPhoneNumberAvailability200ResponseAreaAvailability>>,
}

impl CheckPhoneNumberAvailability200Response {
    pub fn new() -> CheckPhoneNumberAvailability200Response {
        CheckPhoneNumberAvailability200Response {
            country: None,
            number_type: None,
            available: None,
            pre_orderable: None,
            address_constraint: None,
            areas: None,
            area_options: None,
            sold_out_areas: None,
            area_availability: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AddressConstraint {
    #[serde(rename = "geo")]
    Geo,
    #[serde(rename = "country")]
    Country,
    #[serde(rename = "none")]
    None,
}

impl Default for AddressConstraint {
    fn default() -> AddressConstraint {
        Self::Geo
    }
}