/*
* 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.104.0
* 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 CreatePhoneNumberPortInRequest {
/// E.164 numbers to port in.
#[serde(rename = "phoneNumbers")]
pub phone_numbers: Vec<String>,
#[serde(rename = "endUser")]
pub end_user: Box<models::CreatePhoneNumberPortInRequestEndUser>,
/// Document id from POST /v1/phone-numbers/port-in/documents (kind=loa).
#[serde(rename = "loaDocumentId")]
pub loa_document_id: String,
/// Document id from POST /v1/phone-numbers/port-in/documents (kind=invoice).
#[serde(rename = "invoiceDocumentId")]
pub invoice_document_id: String,
/// Requested port date; the carrier confirms the actual FOC later. US/CA default is one week out (shifted off weekends); international orders are scheduled into the carrier's next allowed porting window at or after this date.
#[serde(
rename = "focDatetimeRequested",
skip_serializing_if = "Option::is_none"
)]
pub foc_datetime_requested: Option<String>,
#[serde(rename = "customerReference", skip_serializing_if = "Option::is_none")]
pub customer_reference: Option<String>,
/// Whether the losing account ports all its numbers (full) or keeps some (partial).
#[serde(rename = "portType", skip_serializing_if = "Option::is_none")]
pub port_type: Option<PortType>,
/// Country-specific requirement values for international ports (from GET /v1/phone-numbers/port-in/requirements). Not needed for US/CA. The LOA and invoice requirements are satisfied automatically by loaDocumentId/invoiceDocumentId, and address-type requirements by the endUser service address.
#[serde(rename = "requirements", skip_serializing_if = "Option::is_none")]
pub requirements: Option<Vec<models::CreatePhoneNumberPortInRequestRequirementsInner>>,
}
impl CreatePhoneNumberPortInRequest {
pub fn new(
phone_numbers: Vec<String>,
end_user: models::CreatePhoneNumberPortInRequestEndUser,
loa_document_id: String,
invoice_document_id: String,
) -> CreatePhoneNumberPortInRequest {
CreatePhoneNumberPortInRequest {
phone_numbers,
end_user: Box::new(end_user),
loa_document_id,
invoice_document_id,
foc_datetime_requested: None,
customer_reference: None,
port_type: None,
requirements: None,
}
}
}
/// Whether the losing account ports all its numbers (full) or keeps some (partial).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PortType {
#[serde(rename = "full")]
Full,
#[serde(rename = "partial")]
Partial,
}
impl Default for PortType {
fn default() -> PortType {
Self::Full
}
}