vapi_client/models/
client_message_transcript.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 ClientMessageTranscript {
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. \"transcript\" is sent as transcriber outputs partial or final transcript.
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 the call that the message is associated with.
25    #[serde(rename = "call", skip_serializing_if = "Option::is_none")]
26    pub call: Option<models::Call>,
27    /// This is the customer that the message is associated with.
28    #[serde(rename = "customer", skip_serializing_if = "Option::is_none")]
29    pub customer: Option<models::CreateCustomerDto>,
30    /// This is the assistant that the message is associated with.
31    #[serde(rename = "assistant", skip_serializing_if = "Option::is_none")]
32    pub assistant: Option<models::CreateAssistantDto>,
33    /// This is the role for which the transcript is for.
34    #[serde(rename = "role")]
35    pub role: RoleTrue,
36    /// This is the type of the transcript.
37    #[serde(rename = "transcriptType")]
38    pub transcript_type: TranscriptTypeTrue,
39    /// This is the transcript content.
40    #[serde(rename = "transcript")]
41    pub transcript: String,
42}
43
44impl ClientMessageTranscript {
45    pub fn new(
46        r#type: TypeTrue,
47        role: RoleTrue,
48        transcript_type: TranscriptTypeTrue,
49        transcript: String,
50    ) -> ClientMessageTranscript {
51        ClientMessageTranscript {
52            phone_number: None,
53            r#type,
54            timestamp: None,
55            call: None,
56            customer: None,
57            assistant: None,
58            role,
59            transcript_type,
60            transcript,
61        }
62    }
63}
64/// This is the type of the message. \"transcript\" is sent as transcriber outputs partial or final transcript.
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum TypeTrue {
67    #[serde(rename = "transcript")]
68    Transcript,
69    #[serde(rename = "transcript[transcriptType=\"final\"]")]
70    TranscriptLeftSquareBracketTranscriptTypeEqualDoubleQuoteFinalDoubleQuoteRightSquareBracket,
71}
72
73impl Default for TypeTrue {
74    fn default() -> TypeTrue {
75        Self::Transcript
76    }
77}
78/// This is the role for which the transcript is for.
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum RoleTrue {
81    #[serde(rename = "assistant")]
82    Assistant,
83    #[serde(rename = "user")]
84    User,
85}
86
87impl Default for RoleTrue {
88    fn default() -> RoleTrue {
89        Self::Assistant
90    }
91}
92/// This is the type of the transcript.
93#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
94pub enum TranscriptTypeTrue {
95    #[serde(rename = "partial")]
96    Partial,
97    #[serde(rename = "final")]
98    Final,
99}
100
101impl Default for TranscriptTypeTrue {
102    fn default() -> TranscriptTypeTrue {
103        Self::Partial
104    }
105}