vapi_client/models/
byo_sip_trunk_credential.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ByoSipTrunkCredential {
16    /// This can be used to bring your own SIP trunks or to connect to a Carrier.
17    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
18    pub provider: Option<ProviderTrue>,
19    /// This is the unique identifier for the credential.
20    #[serde(rename = "id")]
21    pub id: String,
22    /// This is the unique identifier for the org that this credential belongs to.
23    #[serde(rename = "orgId")]
24    pub org_id: String,
25    /// This is the ISO 8601 date-time string of when the credential was created.
26    #[serde(rename = "createdAt")]
27    pub created_at: String,
28    /// This is the ISO 8601 date-time string of when the assistant was last updated.
29    #[serde(rename = "updatedAt")]
30    pub updated_at: String,
31    /// This is the name of credential. This is just for your reference.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// This is the list of SIP trunk's gateways.
35    #[serde(rename = "gateways")]
36    pub gateways: Vec<models::SipTrunkGateway>,
37    /// This can be used to configure the outbound authentication if required by the SIP trunk.
38    #[serde(
39        rename = "outboundAuthenticationPlan",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub outbound_authentication_plan: Option<models::SipTrunkOutboundAuthenticationPlan>,
43    /// 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
44    #[serde(
45        rename = "outboundLeadingPlusEnabled",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub outbound_leading_plus_enabled: Option<bool>,
49    /// This can be used to configure the tech prefix on outbound calls. This is an advanced property.
50    #[serde(rename = "techPrefix", skip_serializing_if = "Option::is_none")]
51    pub tech_prefix: Option<String>,
52    /// 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.
53    #[serde(rename = "sipDiversionHeader", skip_serializing_if = "Option::is_none")]
54    pub sip_diversion_header: Option<String>,
55    /// 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.
56    #[serde(rename = "sbcConfiguration", skip_serializing_if = "Option::is_none")]
57    pub sbc_configuration: Option<serde_json::Value>,
58}
59
60impl ByoSipTrunkCredential {
61    pub fn new(
62        id: String,
63        org_id: String,
64        created_at: String,
65        updated_at: String,
66        gateways: Vec<models::SipTrunkGateway>,
67    ) -> ByoSipTrunkCredential {
68        ByoSipTrunkCredential {
69            provider: None,
70            id,
71            org_id,
72            created_at,
73            updated_at,
74            name: None,
75            gateways,
76            outbound_authentication_plan: None,
77            outbound_leading_plus_enabled: None,
78            tech_prefix: None,
79            sip_diversion_header: None,
80            sbc_configuration: None,
81        }
82    }
83}
84/// This can be used to bring your own SIP trunks or to connect to a Carrier.
85#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
86pub enum ProviderTrue {
87    #[serde(rename = "byo-sip-trunk")]
88    ByoSipTrunk,
89}
90
91impl Default for ProviderTrue {
92    fn default() -> ProviderTrue {
93        Self::ByoSipTrunk
94    }
95}