vapi_client/models/
client_message_transfer_update.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 ClientMessageTransferUpdate {
16    /// This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
20    pub destination: Option<Box<models::ClientMessageTransferUpdateDestination>>,
21    /// This is the assistant that the call is being transferred to. This is only sent if `destination.type` is \"assistant\".
22    #[serde(rename = "toAssistant", skip_serializing_if = "Option::is_none")]
23    pub to_assistant: Option<Box<models::CreateAssistantDto>>,
24    /// This is the assistant that the call is being transferred from. This is only sent if `destination.type` is \"assistant\".
25    #[serde(rename = "fromAssistant", skip_serializing_if = "Option::is_none")]
26    pub from_assistant: Option<Box<models::CreateAssistantDto>>,
27    /// This is the step that the conversation moved to.
28    #[serde(rename = "toStepRecord", skip_serializing_if = "Option::is_none")]
29    pub to_step_record: Option<serde_json::Value>,
30    /// This is the step that the conversation moved from. =
31    #[serde(rename = "fromStepRecord", skip_serializing_if = "Option::is_none")]
32    pub from_step_record: Option<serde_json::Value>,
33}
34
35impl ClientMessageTransferUpdate {
36    pub fn new(r#type: Type) -> ClientMessageTransferUpdate {
37        ClientMessageTransferUpdate {
38            r#type,
39            destination: None,
40            to_assistant: None,
41            from_assistant: None,
42            to_step_record: None,
43            from_step_record: None,
44        }
45    }
46}
47/// This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Type {
50    #[serde(rename = "transfer-update")]
51    TransferUpdate,
52}
53
54impl Default for Type {
55    fn default() -> Type {
56        Self::TransferUpdate
57    }
58}
59