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::ServerMessageAssistantRequestPhoneNumber>,
18    /// This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.
19    #[serde(rename = "type")]
20    pub r#type: Type,
21    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
22    pub destination: Option<models::ClientMessageTransferUpdateDestination>,
23    /// This is the timestamp of when the message was sent in milliseconds since Unix Epoch.
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 is currently active. This is provided for convenience.  This matches one of the following: - `call.assistant`, - `call.assistantId`, - `call.squad[n].assistant`, - `call.squad[n].assistantId`, - `call.squadId->[n].assistant`, - `call.squadId->[n].assistantId`.
30    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
31    pub assistant: Option<models::CreateAssistantDto>,
32    /// This is the customer associated with the call.  This matches one of the following: - `call.customer`, - `call.customerId`.
33    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
34    pub customer: Option<models::CreateCustomerDto>,
35    /// This is the call object.  This matches what was returned in POST /call.  Note: This might get stale during the call. To get the latest call object, especially after the call is ended, use GET /call/:id.
36    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
37    pub call: Option<models::Call>,
38    /// This is the assistant that the call is being transferred to. This is only sent if `destination.type` is \"assistant\".
39    #[serde(rename = "toAssistant", skip_serializing_if = "Option::is_none")]
40    pub to_assistant: Option<models::CreateAssistantDto>,
41    /// This is the assistant that the call is being transferred from. This is only sent if `destination.type` is \"assistant\".
42    #[serde(rename = "fromAssistant", skip_serializing_if = "Option::is_none")]
43    pub from_assistant: Option<models::CreateAssistantDto>,
44    /// This is the step that the conversation moved to.
45    #[serde(rename = "toStepRecord", skip_serializing_if = "Option::is_none")]
46    pub to_step_record: Option<serde_json::Value>,
47    /// This is the step that the conversation moved from. =
48    #[serde(rename = "fromStepRecord", skip_serializing_if = "Option::is_none")]
49    pub from_step_record: Option<serde_json::Value>,
50}
51
52impl ServerMessageTransferUpdate {
53    pub fn new(r#type: Type) -> ServerMessageTransferUpdate {
54        ServerMessageTransferUpdate {
55            phone_number: None,
56            r#type,
57            destination: None,
58            timestamp: None,
59            artifact: None,
60            assistant: None,
61            customer: None,
62            call: None,
63            to_assistant: None,
64            from_assistant: None,
65            to_step_record: None,
66            from_step_record: None,
67        }
68    }
69}
70/// This is the type of the message. \"transfer-update\" is sent whenever a transfer happens.
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Type {
73    #[serde(rename = "transfer-update")]
74    TransferUpdate,
75}
76
77impl Default for Type {
78    fn default() -> Type {
79        Self::TransferUpdate
80    }
81}
82