vapi_client/models/server_message_hang.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 ServerMessageHang {
16 #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
17 pub phone_number: Option<Box<models::ServerMessageAssistantRequestPhoneNumber>>,
18 /// This is the type of the message. \"hang\" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as: - the model is too slow to respond - the voice is too slow to respond - the tool call is still waiting for a response from your server - etc.
19 #[serde(rename = "type")]
20 pub r#type: Type,
21 /// This is the ISO-8601 formatted timestamp of when the message was sent.
22 #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
23 pub timestamp: Option<String>,
24 /// This is a live version of the `call.artifact`. This matches what is stored on `call.artifact` after the call.
25 #[serde(rename = "artifact", skip_serializing_if = "Option::is_none")]
26 pub artifact: Option<Box<models::Artifact>>,
27 /// 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`.
28 #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
29 pub assistant: Option<Box<models::CreateAssistantDto>>,
30 /// This is the customer associated with the call. This matches one of the following: - `call.customer`, - `call.customerId`.
31 #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
32 pub customer: Option<Box<models::CreateCustomerDto>>,
33 /// 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.
34 #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
35 pub call: Option<Box<models::Call>>,
36}
37
38impl ServerMessageHang {
39 pub fn new(r#type: Type) -> ServerMessageHang {
40 ServerMessageHang {
41 phone_number: None,
42 r#type,
43 timestamp: None,
44 artifact: None,
45 assistant: None,
46 customer: None,
47 call: None,
48 }
49 }
50}
51/// This is the type of the message. \"hang\" is sent when the assistant is hanging due to a delay. The delay can be caused by many factors, such as: - the model is too slow to respond - the voice is too slow to respond - the tool call is still waiting for a response from your server - etc.
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum Type {
54 #[serde(rename = "hang")]
55 Hang,
56}
57
58impl Default for Type {
59 fn default() -> Type {
60 Self::Hang
61 }
62}
63