late 0.0.988

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).
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).
 *
 * The version of the OpenAPI document: 1.32.1
 * 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 UpdateWhatsAppCallingLegacyRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "forwardTo", skip_serializing_if = "Option::is_none")]
    pub forward_to: Option<String>,
    #[serde(
        rename = "sipAuthUsername",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sip_auth_username: Option<Option<String>>,
    #[serde(
        rename = "sipAuthPassword",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sip_auth_password: Option<Option<String>>,
    #[serde(rename = "recordingEnabled", skip_serializing_if = "Option::is_none")]
    pub recording_enabled: Option<bool>,
    #[serde(
        rename = "callIconCountries",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub call_icon_countries: Option<Option<Vec<String>>>,
    /// Hard cap (seconds) on forwarded calls; null clears the cap.
    #[serde(
        rename = "maxCallDurationSeconds",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub max_call_duration_seconds: Option<Option<i32>>,
    /// caller = present the WhatsApp user's number to the forward destination (sip: only).
    #[serde(rename = "forwardCallerId", skip_serializing_if = "Option::is_none")]
    pub forward_caller_id: Option<ForwardCallerId>,
}

impl UpdateWhatsAppCallingLegacyRequest {
    pub fn new(account_id: String) -> UpdateWhatsAppCallingLegacyRequest {
        UpdateWhatsAppCallingLegacyRequest {
            account_id,
            forward_to: None,
            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 = present the WhatsApp user's number to the forward destination (sip: only).
#[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
    }
}