vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateByoSipTrunkCredentialDto {
    /// This can be used to bring your own SIP trunks or to connect to a Carrier.
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<ProviderTrue>,
    /// This is the list of SIP trunk's gateways.
    #[serde(rename = "gateways")]
    pub gateways: Vec<models::SipTrunkGateway>,
    /// This can be used to configure the outbound authentication if required by the SIP trunk.
    #[serde(
        rename = "outboundAuthenticationPlan",
        skip_serializing_if = "Option::is_none"
    )]
    pub outbound_authentication_plan: Option<models::SipTrunkOutboundAuthenticationPlan>,
    /// This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior.  Usage: - Vonage/Twilio requires leading plus for all outbound calls. Set this to true.  @default false
    #[serde(
        rename = "outboundLeadingPlusEnabled",
        skip_serializing_if = "Option::is_none"
    )]
    pub outbound_leading_plus_enabled: Option<bool>,
    /// This can be used to configure the tech prefix on outbound calls. This is an advanced property.
    #[serde(rename = "techPrefix", skip_serializing_if = "Option::is_none")]
    pub tech_prefix: Option<String>,
    /// This can be used to enable the SIP diversion header for authenticating the calling number if the SIP trunk supports it. This is an advanced property.
    #[serde(rename = "sipDiversionHeader", skip_serializing_if = "Option::is_none")]
    pub sip_diversion_header: Option<String>,
    /// This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk's `gateways`, rather than the managed SBC provided by Vapi.
    #[serde(rename = "sbcConfiguration", skip_serializing_if = "Option::is_none")]
    pub sbc_configuration: Option<serde_json::Value>,
    /// This is the name of credential. This is just for your reference.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

impl CreateByoSipTrunkCredentialDto {
    pub fn new(gateways: Vec<models::SipTrunkGateway>) -> CreateByoSipTrunkCredentialDto {
        CreateByoSipTrunkCredentialDto {
            provider: None,
            gateways,
            outbound_authentication_plan: None,
            outbound_leading_plus_enabled: None,
            tech_prefix: None,
            sip_diversion_header: None,
            sbc_configuration: None,
            name: None,
        }
    }
}
/// This can be used to bring your own SIP trunks or to connect to a Carrier.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "byo-sip-trunk")]
    ByoSipTrunk,
}

impl Default for ProviderTrue {
    fn default() -> ProviderTrue {
        Self::ByoSipTrunk
    }
}