late 0.0.697

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 EnableWhatsAppCallingLegacyRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// tel:+E164 / sip:... / wss://... destination
    #[serde(rename = "forwardTo")]
    pub forward_to: String,
    #[serde(rename = "sipAuthUsername", skip_serializing_if = "Option::is_none")]
    pub sip_auth_username: Option<String>,
    /// Stored encrypted, never returned by any endpoint.
    #[serde(rename = "sipAuthPassword", skip_serializing_if = "Option::is_none")]
    pub sip_auth_password: Option<String>,
    #[serde(rename = "recordingEnabled", skip_serializing_if = "Option::is_none")]
    pub recording_enabled: Option<bool>,
    #[serde(rename = "callIconCountries", skip_serializing_if = "Option::is_none")]
    pub call_icon_countries: Option<Vec<String>>,
    /// Hard cap (seconds) on a forwarded call; the carrier hangs up both legs when it fires. Safety valve against dead-air billing when a destination hangs up but the signal is lost.
    #[serde(
        rename = "maxCallDurationSeconds",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_call_duration_seconds: Option<i32>,
    /// Caller ID presented to the forward destination. caller = the WhatsApp user's number (sip: destinations only; ignored on tel: forwards). Fixes AI-agent trunks that reject seeing the business number call itself.
    #[serde(rename = "forwardCallerId", skip_serializing_if = "Option::is_none")]
    pub forward_caller_id: Option<ForwardCallerId>,
}

impl EnableWhatsAppCallingLegacyRequest {
    pub fn new(account_id: String, forward_to: String) -> EnableWhatsAppCallingLegacyRequest {
        EnableWhatsAppCallingLegacyRequest {
            account_id,
            forward_to,
            sip_auth_username: None,
            sip_auth_password: None,
            recording_enabled: None,
            call_icon_countries: None,
            max_call_duration_seconds: None,
            forward_caller_id: None,
        }
    }
}
/// Caller ID presented to the forward destination. caller = the WhatsApp user's number (sip: destinations only; ignored on tel: forwards). Fixes AI-agent trunks that reject seeing the business number call itself.
#[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
    }
}