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