vapi_client/models/transfer_plan.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 TransferPlan {
16 /// This configures how transfer is executed and the experience of the destination party receiving the call. Usage: - `blind-transfer`: The assistant forwards the call to the destination without any message or summary. - `blind-transfer-add-summary-to-sip-header`: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary. - `warm-transfer-say-message`: The assistant dials the destination, delivers the `message` to the destination party, connects the customer, and leaves the call. - `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call. - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer. - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer. - `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call. @default 'blind-transfer'
17 #[serde(rename = "mode")]
18 pub mode: Mode,
19 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
20 pub message: Option<Box<models::TransferPlanMessage>>,
21 /// This specifies the SIP verb to use while transferring the call. - 'refer': Uses SIP REFER to transfer the call (default) - 'bye': Ends current call with SIP BYE - 'dial': Uses SIP DIAL to transfer the call
22 #[serde(rename = "sipVerb", skip_serializing_if = "Option::is_none")]
23 pub sip_verb: Option<SipVerb>,
24 /// This is the TwiML instructions to execute on the destination call leg before connecting the customer. Usage: - Used only when `mode` is `warm-transfer-twiml`. - Supports only `Play`, `Say`, `Gather`, `Hangup` and `Pause` verbs. - Maximum length is 4096 characters. Example: ``` <Say voice=\"alice\" language=\"en-US\">Hello, transferring a customer to you.</Say> <Pause length=\"2\"/> <Say>They called about billing questions.</Say> ```
25 #[serde(rename = "twiml", skip_serializing_if = "Option::is_none")]
26 pub twiml: Option<String>,
27 /// This is the plan for generating a summary of the call to present to the destination party. Usage: - Used only when `mode` is `blind-transfer-add-summary-to-sip-header` or `warm-transfer-say-summary` or `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`.
28 #[serde(rename = "summaryPlan", skip_serializing_if = "Option::is_none")]
29 pub summary_plan: Option<Box<models::SummaryPlan>>,
30}
31
32impl TransferPlan {
33 pub fn new(mode: Mode) -> TransferPlan {
34 TransferPlan {
35 mode,
36 message: None,
37 sip_verb: None,
38 twiml: None,
39 summary_plan: None,
40 }
41 }
42}
43/// This configures how transfer is executed and the experience of the destination party receiving the call. Usage: - `blind-transfer`: The assistant forwards the call to the destination without any message or summary. - `blind-transfer-add-summary-to-sip-header`: The assistant forwards the call to the destination and adds a SIP header X-Transfer-Summary to the call to include the summary. - `warm-transfer-say-message`: The assistant dials the destination, delivers the `message` to the destination party, connects the customer, and leaves the call. - `warm-transfer-say-summary`: The assistant dials the destination, provides a summary of the call to the destination party, connects the customer, and leaves the call. - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-message`: The assistant dials the destination, waits for the operator to speak, delivers the `message` to the destination party, and then connects the customer. - `warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary`: The assistant dials the destination, waits for the operator to speak, provides a summary of the call to the destination party, and then connects the customer. - `warm-transfer-twiml`: The assistant dials the destination, executes the twiml instructions on the destination call leg, connects the customer, and leaves the call. @default 'blind-transfer'
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum Mode {
46 #[serde(rename = "blind-transfer")]
47 BlindTransfer,
48 #[serde(rename = "blind-transfer-add-summary-to-sip-header")]
49 BlindTransferAddSummaryToSipHeader,
50 #[serde(rename = "warm-transfer-say-message")]
51 WarmTransferSayMessage,
52 #[serde(rename = "warm-transfer-say-summary")]
53 WarmTransferSaySummary,
54 #[serde(rename = "warm-transfer-twiml")]
55 WarmTransferTwiml,
56 #[serde(rename = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message")]
57 WarmTransferWaitForOperatorToSpeakFirstAndThenSayMessage,
58 #[serde(rename = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary")]
59 WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary,
60}
61
62impl Default for Mode {
63 fn default() -> Mode {
64 Self::BlindTransfer
65 }
66}
67/// This specifies the SIP verb to use while transferring the call. - 'refer': Uses SIP REFER to transfer the call (default) - 'bye': Ends current call with SIP BYE - 'dial': Uses SIP DIAL to transfer the call
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum SipVerb {
70 #[serde(rename = "refer")]
71 Refer,
72 #[serde(rename = "bye")]
73 Bye,
74 #[serde(rename = "dial")]
75 Dial,
76}
77
78impl Default for SipVerb {
79 fn default() -> SipVerb {
80 Self::Refer
81 }
82}
83