vapi_client/models/
server_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 ServerMessageTransferUpdate {
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 a live version of the `call.artifact`.  This matches what is stored on `call.artifact` after the call.
27    #[serde(rename = "artifact", skip_serializing_if = "Option::is_none")]
28    pub artifact: Option<models::Artifact>,
29    /// This is the assistant that the message is associated with.
30    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
31    pub assistant: Option<models::CreateAssistantDto>,
32    /// This is the customer that the message is associated with.
33    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
34    pub customer: Option<models::CreateCustomerDto>,
35    /// This is the call that the message is associated with.
36    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
37    pub call: Option<models::Call>,
38    /// This is the chat object.
39    #[serde(rename = "chat", skip_serializing_if = "Option::is_none")]
40    pub chat: Option<models::Chat>,
41    /// This is the assistant that the call is being transferred to. This is only sent if `destination.type` is \"assistant\".
42    #[serde(rename = "toAssistant", skip_serializing_if = "Option::is_none")]
43    pub to_assistant: Option<models::CreateAssistantDto>,
44    /// This is the assistant that the call is being transferred from. This is only sent if `destination.type` is \"assistant\".
45    #[serde(rename = "fromAssistant", skip_serializing_if = "Option::is_none")]
46    pub from_assistant: Option<models::CreateAssistantDto>,
47    /// This is the step that the conversation moved to.
48    #[serde(rename = "toStepRecord", skip_serializing_if = "Option::is_none")]
49    pub to_step_record: Option<serde_json::Value>,
50    /// This is the step that the conversation moved from. =
51    #[serde(rename = "fromStepRecord", skip_serializing_if = "Option::is_none")]
52    pub from_step_record: Option<serde_json::Value>,
53}
54
55impl ServerMessageTransferUpdate {
56    pub fn new(r#type: TypeTrue) -> ServerMessageTransferUpdate {
57        ServerMessageTransferUpdate {
58            phone_number: None,
59            r#type,
60            destination: None,
61            timestamp: None,
62            artifact: None,
63            assistant: None,
64            customer: None,
65            call: None,
66            chat: None,
67            to_assistant: None,
68            from_assistant: None,
69            to_step_record: None,
70            from_step_record: None,
71        }
72    }
73}
74/// This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum TypeTrue {
77    #[serde(rename = "transfer-update")]
78    TransferUpdate,
79}
80
81impl Default for TypeTrue {
82    fn default() -> TypeTrue {
83        Self::TransferUpdate
84    }
85}