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