vapi_client/models/transfer_plan.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 TransferPlan {
17 /// 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'
18 #[serde(rename = "mode")]
19 pub mode: Mode,
20 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
21 pub message: Option<models::TransferPlanMessage>,
22 /// 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
23 #[serde(rename = "sipVerb", skip_serializing_if = "Option::is_none")]
24 pub sip_verb: Option<SipVerb>,
25 /// 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> ```
26 #[serde(rename = "twiml", skip_serializing_if = "Option::is_none")]
27 pub twiml: Option<String>,
28 /// 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`.
29 #[serde(rename = "summaryPlan", skip_serializing_if = "Option::is_none")]
30 pub summary_plan: Option<models::SummaryPlan>,
31}
32
33impl TransferPlan {
34 pub fn new(mode: Mode) -> TransferPlan {
35 TransferPlan {
36 mode,
37 message: None,
38 sip_verb: None,
39 twiml: None,
40 summary_plan: None,
41 }
42 }
43}
44/// 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'
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Mode {
47 #[serde(rename = "blind-transfer")]
48 BlindTransfer,
49 #[serde(rename = "blind-transfer-add-summary-to-sip-header")]
50 BlindTransferAddSummaryToSipHeader,
51 #[serde(rename = "warm-transfer-say-message")]
52 WarmTransferSayMessage,
53 #[serde(rename = "warm-transfer-say-summary")]
54 WarmTransferSaySummary,
55 #[serde(rename = "warm-transfer-twiml")]
56 WarmTransferTwiml,
57 #[serde(rename = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message")]
58 WarmTransferWaitForOperatorToSpeakFirstAndThenSayMessage,
59 #[serde(rename = "warm-transfer-wait-for-operator-to-speak-first-and-then-say-summary")]
60 WarmTransferWaitForOperatorToSpeakFirstAndThenSaySummary,
61}
62
63impl Default for Mode {
64 fn default() -> Mode {
65 Self::BlindTransfer
66 }
67}
68/// 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
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum SipVerb {
71 #[serde(rename = "refer")]
72 Refer,
73 #[serde(rename = "bye")]
74 Bye,
75 #[serde(rename = "dial")]
76 Dial,
77}
78
79impl Default for SipVerb {
80 fn default() -> SipVerb {
81 Self::Refer
82 }
83}