vapi_client/models/
client_message_speech_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 ClientMessageSpeechUpdate {
16    /// This is the type of the message. \"speech-update\" is sent whenever assistant or user start or stop speaking.
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    /// This is the status of the speech update.
20    #[serde(rename = "status")]
21    pub status: Status,
22    /// This is the role which the speech update is for.
23    #[serde(rename = "role")]
24    pub role: Role,
25}
26
27impl ClientMessageSpeechUpdate {
28    pub fn new(r#type: Type, status: Status, role: Role) -> ClientMessageSpeechUpdate {
29        ClientMessageSpeechUpdate {
30            r#type,
31            status,
32            role,
33        }
34    }
35}
36/// This is the type of the message. \"speech-update\" is sent whenever assistant or user start or stop speaking.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Type {
39    #[serde(rename = "speech-update")]
40    SpeechUpdate,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::SpeechUpdate
46    }
47}
48/// This is the status of the speech update.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Status {
51    #[serde(rename = "started")]
52    Started,
53    #[serde(rename = "stopped")]
54    Stopped,
55}
56
57impl Default for Status {
58    fn default() -> Status {
59        Self::Started
60    }
61}
62/// This is the role which the speech update is for.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum Role {
65    #[serde(rename = "assistant")]
66    Assistant,
67    #[serde(rename = "user")]
68    User,
69}
70
71impl Default for Role {
72    fn default() -> Role {
73        Self::Assistant
74    }
75}
76