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