late 0.0.678

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
Documentation
/*
 * 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 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>,
    #[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. For US and CA this is the full country inventory (every area code with stock, recognizable metros listed first, then alphabetical); other countries are ordered largest stock first; they list the areas in the latest inventory page (up to 500 numbers, which for most countries is the entire pool). Empty when out of stock (or the area lookup failed). 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>>,
}

impl CheckPhoneNumberAvailability200Response {
    pub fn new() -> CheckPhoneNumberAvailability200Response {
        CheckPhoneNumberAvailability200Response {
            country: None,
            number_type: None,
            available: None,
            address_constraint: None,
            areas: None,
            area_options: 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
    }
}