/*
* 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.162.2
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// OwnedPhoneNumber : A number you bought or ported. Null fields are omitted, except `socialAccountId` and `ownerAccountId`. Credentials stored for the number (such as the SIP digest password) are never returned; `sipAuthUsername` is the only SIP credential field exposed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OwnedPhoneNumber {
#[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 = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
/// For example local, mobile, national or toll_free.
#[serde(rename = "numberType", skip_serializing_if = "Option::is_none")]
pub number_type: Option<String>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
pub profile_id: Option<Box<models::OwnedPhoneNumberProfileId>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
/// Present once the number order has been placed (i.e. the requirement group was approved). Absent while still in identity review.
#[serde(
rename = "telnyxOrderId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub telnyx_order_id: Option<Option<String>>,
/// Present on a pre-order: the carrier request placed for a number with no stock yet.
#[serde(
rename = "telnyxAdvancedOrderId",
skip_serializing_if = "Option::is_none"
)]
pub telnyx_advanced_order_id: Option<String>,
/// For regulated numbers, who it's registered for (company or person), set from the submitted KYC.
#[serde(
rename = "registrantName",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub registrant_name: 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>>,
/// The latest reviewer comment on a regulated number still in review.
#[serde(
rename = "regulatoryReviewComment",
skip_serializing_if = "Option::is_none"
)]
pub regulatory_review_comment: Option<String>,
/// `action_required` when the reviewer is waiting on you.
#[serde(
rename = "regulatoryInfoStatus",
skip_serializing_if = "Option::is_none"
)]
pub regulatory_info_status: Option<String>,
/// For regulated (Tier 3/4) numbers with an Onfido ID-verification step: the link to forward to the end user. Set once the order is placed; null otherwise. Poll this field after submitting KYC.
#[serde(
rename = "onfidoVerificationUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub onfido_verification_url: Option<Option<String>>,
/// Stable redirect to the live Onfido session. Prefer it over `onfidoVerificationUrl`, since it always resolves to a fresh session.
#[serde(
rename = "verifyUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub verify_url: Option<Option<String>>,
/// True once the verify link has been opened at least once.
#[serde(rename = "onfidoOpened", skip_serializing_if = "Option::is_none")]
pub onfido_opened: Option<bool>,
#[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<MetaVerificationStatus>,
#[serde(rename = "metaVerifiedAt", skip_serializing_if = "Option::is_none")]
pub meta_verified_at: Option<String>,
#[serde(
rename = "metaVerificationExpiresAt",
skip_serializing_if = "Option::is_none"
)]
pub meta_verification_expires_at: Option<String>,
/// The WhatsApp account the number is linked to; null when WhatsApp is not connected.
#[serde(
rename = "socialAccountId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub social_account_id: Option<Option<String>>,
/// The telephony account that owns Calls and SMS on the number.
#[serde(
rename = "ownerAccountId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub owner_account_id: Option<Option<String>>,
/// SIP trunk the number is attached to; null when not trunked. While attached, enabling Calls or WhatsApp calling, requesting WhatsApp verification, and releasing the number all return 409.
#[serde(
rename = "sipTrunkId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub sip_trunk_id: Option<Option<String>>,
/// False for a standalone phone bought for Calls or SMS only.
#[serde(rename = "whatsAppRequested", skip_serializing_if = "Option::is_none")]
pub whats_app_requested: Option<bool>,
#[serde(rename = "smsRequested", skip_serializing_if = "Option::is_none")]
pub sms_requested: Option<bool>,
#[serde(rename = "provisionedAt", skip_serializing_if = "Option::is_none")]
pub provisioned_at: Option<String>,
#[serde(rename = "activatedAt", skip_serializing_if = "Option::is_none")]
pub activated_at: Option<String>,
#[serde(rename = "connectedAt", skip_serializing_if = "Option::is_none")]
pub connected_at: Option<String>,
#[serde(rename = "suspendedAt", skip_serializing_if = "Option::is_none")]
pub suspended_at: Option<String>,
#[serde(rename = "releasedAt", skip_serializing_if = "Option::is_none")]
pub released_at: Option<String>,
/// Meta's Embedded Signup error from the last failed connect attempt (raw text, often localized).
#[serde(rename = "signupError", skip_serializing_if = "Option::is_none")]
pub signup_error: Option<String>,
#[serde(rename = "signupErrorAt", skip_serializing_if = "Option::is_none")]
pub signup_error_at: Option<String>,
#[serde(rename = "signupErrorStep", skip_serializing_if = "Option::is_none")]
pub signup_error_step: Option<String>,
/// What this number bills each month, in cents. Stamped when the number was bought, so an existing number keeps its price when the rate card changes.
#[serde(rename = "monthlyCents", skip_serializing_if = "Option::is_none")]
pub monthly_cents: Option<i32>,
/// False for numbers you brought yourself (connected via Meta embedded signup). They live on your own carrier, so SMS/Calls can't be enabled on them.
#[serde(rename = "hostedByZernio", skip_serializing_if = "Option::is_none")]
pub hosted_by_zernio: Option<bool>,
/// Whether the number can send SMS. Absent while unknown.
#[serde(rename = "smsCapable", skip_serializing_if = "Option::is_none")]
pub sms_capable: Option<bool>,
/// Whether the number can send MMS. Absent while unknown.
#[serde(rename = "mmsCapable", skip_serializing_if = "Option::is_none")]
pub mms_capable: Option<bool>,
/// True when the number can only text numbers in its own country. Absent while unknown.
#[serde(rename = "domesticOnly", skip_serializing_if = "Option::is_none")]
pub domestic_only: Option<bool>,
/// True while a 10DLC registration covering this number is in review.
#[serde(
rename = "smsRegistrationPending",
skip_serializing_if = "Option::is_none"
)]
pub sms_registration_pending: Option<bool>,
/// True when outbound SMS is unlocked: an approved 10DLC covers the number, or the number is outside the US.
#[serde(rename = "smsSendApproved", skip_serializing_if = "Option::is_none")]
pub sms_send_approved: Option<bool>,
/// Brand of the 10DLC registration covering the number.
#[serde(
rename = "smsBrandName",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub sms_brand_name: Option<Option<String>>,
#[serde(rename = "features", skip_serializing_if = "Option::is_none")]
pub features: Option<Box<models::OwnedPhoneNumberFeatures>>,
/// Whether WhatsApp Business Calling is enabled on this number (manage via /v1/whatsapp/phone-numbers/{id}/calling).
#[serde(rename = "callingEnabled", skip_serializing_if = "Option::is_none")]
pub calling_enabled: Option<bool>,
/// WhatsApp calling forward destination.
#[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
pub forward_to: Option<String>,
/// SIP digest username for a sip: forward destination. The password is never returned.
#[serde(rename = "sipAuthUsername", skip_serializing_if = "Option::is_none")]
pub sip_auth_username: Option<String>,
#[serde(rename = "callerIdVerifiedAt", skip_serializing_if = "Option::is_none")]
pub caller_id_verified_at: Option<String>,
#[serde(
rename = "maxCallDurationSeconds",
skip_serializing_if = "Option::is_none"
)]
pub max_call_duration_seconds: Option<i32>,
#[serde(rename = "recordingEnabled", skip_serializing_if = "Option::is_none")]
pub recording_enabled: Option<bool>,
#[serde(
rename = "transcriptionEnabled",
skip_serializing_if = "Option::is_none"
)]
pub transcription_enabled: Option<bool>,
#[serde(
rename = "transcriptionLanguage",
skip_serializing_if = "Option::is_none"
)]
pub transcription_language: Option<TranscriptionLanguage>,
#[serde(rename = "callIconCountries", skip_serializing_if = "Option::is_none")]
pub call_icon_countries: Option<Vec<String>>,
#[serde(rename = "forwardCallerId", skip_serializing_if = "Option::is_none")]
pub forward_caller_id: Option<ForwardCallerId>,
/// Whether Calls (PSTN voice) is on.
#[serde(rename = "pstnVoiceEnabled", skip_serializing_if = "Option::is_none")]
pub pstn_voice_enabled: Option<bool>,
#[serde(rename = "pstnForwardTo", skip_serializing_if = "Option::is_none")]
pub pstn_forward_to: Option<String>,
#[serde(rename = "voicemailEnabled", skip_serializing_if = "Option::is_none")]
pub voicemail_enabled: Option<bool>,
#[serde(rename = "voicemailGreeting", skip_serializing_if = "Option::is_none")]
pub voicemail_greeting: Option<String>,
#[serde(
rename = "businessHoursEnabled",
skip_serializing_if = "Option::is_none"
)]
pub business_hours_enabled: Option<bool>,
#[serde(
rename = "businessHoursTimezone",
skip_serializing_if = "Option::is_none"
)]
pub business_hours_timezone: Option<String>,
#[serde(rename = "businessHours", skip_serializing_if = "Option::is_none")]
pub business_hours: Option<Vec<models::EnableVoiceOnNumber200ResponseBusinessHoursInner>>,
#[serde(rename = "blockedCallers", skip_serializing_if = "Option::is_none")]
pub blocked_callers: Option<Vec<String>>,
#[serde(rename = "ivrEnabled", skip_serializing_if = "Option::is_none")]
pub ivr_enabled: Option<bool>,
#[serde(rename = "ivrPrompt", skip_serializing_if = "Option::is_none")]
pub ivr_prompt: Option<String>,
#[serde(rename = "ivrOptions", skip_serializing_if = "Option::is_none")]
pub ivr_options: Option<Vec<models::EnableVoiceOnNumber200ResponseIvrOptionsInner>>,
}
impl OwnedPhoneNumber {
/// A number you bought or ported. Null fields are omitted, except `socialAccountId` and `ownerAccountId`. Credentials stored for the number (such as the SIP digest password) are never returned; `sipAuthUsername` is the only SIP credential field exposed.
pub fn new() -> OwnedPhoneNumber {
OwnedPhoneNumber {
_id: None,
phone_number: None,
country: None,
number_type: None,
status: None,
profile_id: None,
created_at: None,
updated_at: None,
telnyx_order_id: None,
telnyx_advanced_order_id: None,
registrant_name: None,
end_user_first_name: None,
end_user_last_name: None,
regulatory_decline_reason: None,
regulatory_review_comment: None,
regulatory_info_status: None,
onfido_verification_url: None,
verify_url: None,
onfido_opened: None,
meta_preverified_id: None,
meta_verification_status: None,
meta_verified_at: None,
meta_verification_expires_at: None,
social_account_id: None,
owner_account_id: None,
sip_trunk_id: None,
whats_app_requested: None,
sms_requested: None,
provisioned_at: None,
activated_at: None,
connected_at: None,
suspended_at: None,
released_at: None,
signup_error: None,
signup_error_at: None,
signup_error_step: None,
monthly_cents: None,
hosted_by_zernio: None,
sms_capable: None,
mms_capable: None,
domestic_only: None,
sms_registration_pending: None,
sms_send_approved: None,
sms_brand_name: None,
features: None,
calling_enabled: None,
forward_to: None,
sip_auth_username: None,
caller_id_verified_at: None,
max_call_duration_seconds: None,
recording_enabled: None,
transcription_enabled: None,
transcription_language: None,
call_icon_countries: None,
forward_caller_id: None,
pstn_voice_enabled: None,
pstn_forward_to: None,
voicemail_enabled: None,
voicemail_greeting: None,
business_hours_enabled: None,
business_hours_timezone: None,
business_hours: None,
blocked_callers: None,
ivr_enabled: None,
ivr_prompt: None,
ivr_options: 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
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MetaVerificationStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "code_requested")]
CodeRequested,
#[serde(rename = "verified")]
Verified,
#[serde(rename = "expired")]
Expired,
}
impl Default for MetaVerificationStatus {
fn default() -> MetaVerificationStatus {
Self::Pending
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TranscriptionLanguage {
#[serde(rename = "auto")]
Auto,
#[serde(rename = "en")]
En,
#[serde(rename = "es")]
Es,
}
impl Default for TranscriptionLanguage {
fn default() -> TranscriptionLanguage {
Self::Auto
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForwardCallerId {
#[serde(rename = "business")]
Business,
#[serde(rename = "caller")]
Caller,
}
impl Default for ForwardCallerId {
fn default() -> ForwardCallerId {
Self::Business
}
}