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<Provider>,
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(rename = "outboundAuthenticationPlan", skip_serializing_if = "Option::is_none")]
39    pub outbound_authentication_plan: Option<models::SipTrunkOutboundAuthenticationPlan>,
40    /// 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
41    #[serde(rename = "outboundLeadingPlusEnabled", skip_serializing_if = "Option::is_none")]
42    pub outbound_leading_plus_enabled: Option<bool>,
43    /// This can be used to configure the tech prefix on outbound calls. This is an advanced property.
44    #[serde(rename = "techPrefix", skip_serializing_if = "Option::is_none")]
45    pub tech_prefix: Option<String>,
46    /// 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.
47    #[serde(rename = "sipDiversionHeader", skip_serializing_if = "Option::is_none")]
48    pub sip_diversion_header: Option<String>,
49    /// 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.
50    #[serde(rename = "sbcConfiguration", skip_serializing_if = "Option::is_none")]
51    pub sbc_configuration: Option<serde_json::Value>,
52}
53
54impl ByoSipTrunkCredential {
55    pub fn new(id: String, org_id: String, created_at: String, updated_at: String, gateways: Vec<models::SipTrunkGateway>) -> ByoSipTrunkCredential {
56        ByoSipTrunkCredential {
57            provider: None,
58            id,
59            org_id,
60            created_at,
61            updated_at,
62            name: None,
63            gateways,
64            outbound_authentication_plan: None,
65            outbound_leading_plus_enabled: None,
66            tech_prefix: None,
67            sip_diversion_header: None,
68            sbc_configuration: None,
69        }
70    }
71}
72/// This can be used to bring your own SIP trunks or to connect to a Carrier.
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum Provider {
75    #[serde(rename = "byo-sip-trunk")]
76    ByoSipTrunk,
77}
78
79impl Default for Provider {
80    fn default() -> Provider {
81        Self::ByoSipTrunk
82    }
83}
84