vapi_client/models/transfer_destination_number.rs
1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TransferDestinationNumber {
17 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
18 pub message: Option<models::TransferDestinationAssistantMessage>,
19 #[serde(rename = "type")]
20 pub r#type: Type,
21 /// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it. Use cases: - `false`: To allow non-E164 numbers like `+001234567890`, `1234`, or `abc`. This is useful for dialing out to non-E164 numbers on your SIP trunks. - `true` (default): To allow only E164 numbers like `+14155551234`. This is standard for PSTN calls. If `false`, the `number` is still required to only contain alphanumeric characters (regex: `/^\\+?[a-zA-Z0-9]+$/`). @default true (E164 check is enabled)
22 #[serde(
23 rename = "numberE164CheckEnabled",
24 skip_serializing_if = "Option::is_none"
25 )]
26 pub number_e164_check_enabled: Option<bool>,
27 /// This is the phone number to transfer the call to.
28 #[serde(rename = "number")]
29 pub number: String,
30 /// This is the extension to dial after transferring the call to the `number`.
31 #[serde(rename = "extension", skip_serializing_if = "Option::is_none")]
32 pub extension: Option<String>,
33 /// This is the caller ID to use when transferring the call to the `number`. Usage: - If not provided, the caller ID will be the number the call is coming from. Example, +14151111111 calls in to and the assistant transfers out to +16470000000. +16470000000 will see +14151111111 as the caller. - To change this behavior, provide a `callerId`. - Set to '{{customer.number}}' to always use the customer's number as the caller ID. - Set to '{{phoneNumber.number}}' to always use the phone number of the assistant as the caller ID. - Set to any E164 number to always use that number as the caller ID. This needs to be a number that is owned or verified by your Transport provider like Twilio. For Twilio, you can read up more here: https://www.twilio.com/docs/voice/twiml/dial#callerid
34 #[serde(rename = "callerId", skip_serializing_if = "Option::is_none")]
35 pub caller_id: Option<String>,
36 /// This configures how transfer is executed and the experience of the destination party receiving the call. Defaults to `blind-transfer`. @default `transferPlan.mode='blind-transfer'`
37 #[serde(rename = "transferPlan", skip_serializing_if = "Option::is_none")]
38 pub transfer_plan: Option<models::TransferPlan>,
39 /// This is the description of the destination, used by the AI to choose when and how to transfer the call.
40 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
41 pub description: Option<String>,
42}
43
44impl TransferDestinationNumber {
45 pub fn new(r#type: Type, number: String) -> TransferDestinationNumber {
46 TransferDestinationNumber {
47 message: None,
48 r#type,
49 number_e164_check_enabled: None,
50 number,
51 extension: None,
52 caller_id: None,
53 transfer_plan: None,
54 description: None,
55 }
56 }
57}
58///
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum Type {
61 #[serde(rename = "number")]
62 Number,
63}
64
65impl Default for Type {
66 fn default() -> Type {
67 Self::Number
68 }
69}