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