vapi_client/models/
server_message_language_change_detected.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 ServerMessageLanguageChangeDetected {
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. \"language-change-detected\" is sent when the transcriber is automatically switched based on the detected language.
19    #[serde(rename = "type")]
20    pub r#type: TypeTrue,
21    /// This is the timestamp of the message.
22    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
23    pub timestamp: Option<f64>,
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<models::Artifact>,
27    /// This is the assistant that the message is associated with.
28    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
29    pub assistant: Option<models::CreateAssistantDto>,
30    /// This is the customer that the message is associated with.
31    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
32    pub customer: Option<models::CreateCustomerDto>,
33    /// This is the call that the message is associated with.
34    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
35    pub call: Option<models::Call>,
36    /// This is the chat object.
37    #[serde(rename = "chat", skip_serializing_if = "Option::is_none")]
38    pub chat: Option<models::Chat>,
39    /// This is the language the transcriber is switched to.
40    #[serde(rename = "language")]
41    pub language: String,
42}
43
44impl ServerMessageLanguageChangeDetected {
45    pub fn new(r#type: TypeTrue, language: String) -> ServerMessageLanguageChangeDetected {
46        ServerMessageLanguageChangeDetected {
47            phone_number: None,
48            r#type,
49            timestamp: None,
50            artifact: None,
51            assistant: None,
52            customer: None,
53            call: None,
54            chat: None,
55            language,
56        }
57    }
58}
59/// This is the type of the message. \"language-change-detected\" is sent when the transcriber is automatically switched based on the detected language.
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum TypeTrue {
62    #[serde(rename = "language-change-detected")]
63    LanguageChangeDetected,
64}
65
66impl Default for TypeTrue {
67    fn default() -> TypeTrue {
68        Self::LanguageChangeDetected
69    }
70}