late 0.0.1055

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.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 OrderImessageSenderRequest {
    #[serde(rename = "profileId")]
    pub profile_id: String,
    #[serde(rename = "kind")]
    pub kind: Kind,
    /// Required for phone senders. Without availableNumberId the number is carrier-assigned in this region and revealed once the sender activates.
    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
    pub region: Option<Region>,
    /// A number from GET /v1/imessage/senders/available-numbers. It is assigned and activated on order instead of waiting for provisioning. Phone senders only.
    #[serde(rename = "availableNumberId", skip_serializing_if = "Option::is_none")]
    pub available_number_id: Option<String>,
    /// US phone senders only. Preferred area for a carrier-assigned number (ignored with availableNumberId).
    #[serde(rename = "zipCode", skip_serializing_if = "Option::is_none")]
    pub zip_code: Option<String>,
    /// Local part for email senders (required for kind: email)
    #[serde(rename = "emailName", skip_serializing_if = "Option::is_none")]
    pub email_name: Option<String>,
    /// Domain for email senders (required for kind: email)
    #[serde(rename = "emailDomain", skip_serializing_if = "Option::is_none")]
    pub email_domain: Option<String>,
    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
    pub display_name: Option<String>,
    /// Idempotency key for safe retries
    #[serde(rename = "purchaseIntentId", skip_serializing_if = "Option::is_none")]
    pub purchase_intent_id: Option<String>,
    #[serde(rename = "contact", skip_serializing_if = "Option::is_none")]
    pub contact: Option<Box<models::OrderImessageSenderRequestContact>>,
}

impl OrderImessageSenderRequest {
    pub fn new(profile_id: String, kind: Kind) -> OrderImessageSenderRequest {
        OrderImessageSenderRequest {
            profile_id,
            kind,
            region: None,
            available_number_id: None,
            zip_code: None,
            email_name: None,
            email_domain: None,
            display_name: None,
            purchase_intent_id: None,
            contact: 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
    }
}
/// Required for phone senders. Without availableNumberId the number is carrier-assigned in this region and revealed once the sender activates.
#[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
    }
}