/*
* 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.123.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 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
}
}