/*
* 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).
*
* The version of the OpenAPI document: 1.37.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ImessageSenderLifecycle : A provisioned iMessage sender order and its lifecycle. Activation is asynchronous: poll GET /v1/imessage/senders/{senderId} or subscribe to account.connected.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ImessageSenderLifecycle {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<Kind>,
#[serde(
rename = "region",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub region: Option<Option<Region>>,
/// The sender handle once activation assigns it
#[serde(
rename = "handle",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub handle: Option<Option<String>>,
/// imessage:// deep link that opens Messages on this sender with a prefilled text. Share it so contacts message you first (Apple only lets a sender reach contacts who wrote to it first); null until the handle is assigned.
#[serde(
rename = "optInLink",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub opt_in_link: Option<Option<String>>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// Monthly price billed while the sender is active
#[serde(rename = "priceCents", skip_serializing_if = "Option::is_none")]
pub price_cents: Option<i32>,
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
#[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
pub profile_id: Option<String>,
#[serde(
rename = "displayName",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub display_name: Option<Option<String>>,
#[serde(
rename = "failureReason",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub failure_reason: Option<Option<String>>,
/// The messaging account created at activation
#[serde(
rename = "accountId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub account_id: Option<Option<String>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
}
impl ImessageSenderLifecycle {
/// A provisioned iMessage sender order and its lifecycle. Activation is asynchronous: poll GET /v1/imessage/senders/{senderId} or subscribe to account.connected.
pub fn new() -> ImessageSenderLifecycle {
ImessageSenderLifecycle {
id: None,
kind: None,
region: None,
handle: None,
opt_in_link: None,
status: None,
price_cents: None,
provider: None,
profile_id: None,
display_name: None,
failure_reason: None,
account_id: None,
created_at: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
#[serde(rename = "phone")]
Phone,
#[serde(rename = "email")]
Email,
}
impl Default for Kind {
fn default() -> Kind {
Self::Phone
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Region {
#[serde(rename = "US")]
Us,
#[serde(rename = "GB")]
Gb,
}
impl Default for Region {
fn default() -> Region {
Self::Us
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "ordering")]
Ordering,
#[serde(rename = "activating")]
Activating,
#[serde(rename = "active")]
Active,
#[serde(rename = "suspended")]
Suspended,
#[serde(rename = "canceled")]
Canceled,
#[serde(rename = "failed")]
Failed,
}
impl Default for Status {
fn default() -> Status {
Self::Ordering
}
}