1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
* 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 VapiPhoneNumber {
#[serde(
rename = "fallbackDestination",
skip_serializing_if = "Option::is_none"
)]
pub fallback_destination: Option<models::ImportTwilioPhoneNumberDtoFallbackDestination>,
/// This is the hooks that will be used for incoming calls to this phone number.
#[serde(rename = "hooks", skip_serializing_if = "Option::is_none")]
pub hooks: Option<Vec<models::ImportTwilioPhoneNumberDtoHooksInner>>,
/// This is to create free SIP phone numbers on Vapi.
#[serde(rename = "provider")]
pub provider: ProviderTrue,
/// This is the unique identifier for the phone number.
#[serde(rename = "id")]
pub id: String,
/// This is the unique identifier for the org that this phone number belongs to.
#[serde(rename = "orgId")]
pub org_id: String,
/// This is the ISO 8601 date-time string of when the phone number was created.
#[serde(rename = "createdAt")]
pub created_at: String,
/// This is the ISO 8601 date-time string of when the phone number was last updated.
#[serde(rename = "updatedAt")]
pub updated_at: String,
/// This is the status of the phone number.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<StatusTrue>,
/// These are the digits of the phone number you purchased from Vapi.
#[serde(rename = "number", skip_serializing_if = "Option::is_none")]
pub number: Option<String>,
/// This is the name of the phone number. This is just for your own reference.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// This is the assistant that will be used for incoming calls to this phone number. If neither `assistantId`, `squadId` nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
#[serde(rename = "assistantId", skip_serializing_if = "Option::is_none")]
pub assistant_id: Option<String>,
/// This is the workflow that will be used for incoming calls to this phone number. If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
#[serde(rename = "workflowId", skip_serializing_if = "Option::is_none")]
pub workflow_id: Option<String>,
/// This is the squad that will be used for incoming calls to this phone number. If neither `assistantId`, `squadId`, nor `workflowId` is set, `assistant-request` will be sent to your Server URL. Check `ServerMessage` and `ServerMessageResponse` for the shape of the message and response that is expected.
#[serde(rename = "squadId", skip_serializing_if = "Option::is_none")]
pub squad_id: Option<String>,
/// This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. The order of precedence is: 1. assistant.server 2. phoneNumber.server 3. org.server
#[serde(rename = "server", skip_serializing_if = "Option::is_none")]
pub server: Option<models::Server>,
/// This is the area code of the phone number to purchase.
#[serde(
rename = "numberDesiredAreaCode",
skip_serializing_if = "Option::is_none"
)]
pub number_desired_area_code: Option<String>,
/// This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer. This is case-insensitive.
#[serde(rename = "sipUri", skip_serializing_if = "Option::is_none")]
pub sip_uri: Option<String>,
/// This enables authentication for incoming SIP INVITE requests to the `sipUri`. If not set, any username/password to the 401 challenge of the SIP INVITE will be accepted.
#[serde(rename = "authentication", skip_serializing_if = "Option::is_none")]
pub authentication: Option<models::SipAuthentication>,
}
impl VapiPhoneNumber {
pub fn new(
provider: ProviderTrue,
id: String,
org_id: String,
created_at: String,
updated_at: String,
) -> VapiPhoneNumber {
VapiPhoneNumber {
fallback_destination: None,
hooks: None,
provider,
id,
org_id,
created_at,
updated_at,
status: None,
number: None,
name: None,
assistant_id: None,
workflow_id: None,
squad_id: None,
server: None,
number_desired_area_code: None,
sip_uri: None,
authentication: None,
}
}
}
/// This is to create free SIP phone numbers on Vapi.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
#[serde(rename = "vapi")]
Vapi,
}
impl Default for ProviderTrue {
fn default() -> ProviderTrue {
Self::Vapi
}
}
/// This is the status of the phone number.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusTrue {
#[serde(rename = "active")]
Active,
#[serde(rename = "activating")]
Activating,
#[serde(rename = "blocked")]
Blocked,
}
impl Default for StatusTrue {
fn default() -> StatusTrue {
Self::Active
}
}