/*
* 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.24.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 CreateSipTrunkRequest {
/// Display name for the trunk.
#[serde(rename = "label")]
pub label: String,
/// Fully-qualified hostname inbound calls are delivered to (e.g. sip.rtc.elevenlabs.io, sip.retellai.com).
#[serde(rename = "sipHost")]
pub sip_host: String,
/// Defaults to 5061 for tls, 5060 otherwise.
#[serde(rename = "sipPort", skip_serializing_if = "Option::is_none")]
pub sip_port: Option<i32>,
/// Signaling transport toward sipHost. Default tls (with SRTP media).
#[serde(rename = "transport", skip_serializing_if = "Option::is_none")]
pub transport: Option<Transport>,
}
impl CreateSipTrunkRequest {
pub fn new(label: String, sip_host: String) -> CreateSipTrunkRequest {
CreateSipTrunkRequest {
label,
sip_host,
sip_port: None,
transport: None,
}
}
}
/// Signaling transport toward sipHost. Default tls (with SRTP media).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Transport {
#[serde(rename = "tls")]
Tls,
#[serde(rename = "tcp")]
Tcp,
#[serde(rename = "udp")]
Udp,
}
impl Default for Transport {
fn default() -> Transport {
Self::Tls
}
}