vapi_client/models/
client_inbound_message_control.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 ClientInboundMessageControl {
16    /// This is the type of the message. Send \"control\" message to control the assistant. `control` options are: - \"mute-assistant\" - mute the assistant - \"unmute-assistant\" - unmute the assistant - \"say-first-message\" - say the first message (this is used when video recording is enabled and the conversation is only started once the client side kicks off the recording)
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This is the control action
20    #[serde(rename = "control")]
21    pub control: ControlTrue,
22}
23
24impl ClientInboundMessageControl {
25    pub fn new(r#type: TypeTrue, control: ControlTrue) -> ClientInboundMessageControl {
26        ClientInboundMessageControl { r#type, control }
27    }
28}
29/// This is the type of the message. Send \"control\" message to control the assistant. `control` options are: - \"mute-assistant\" - mute the assistant - \"unmute-assistant\" - unmute the assistant - \"say-first-message\" - say the first message (this is used when video recording is enabled and the conversation is only started once the client side kicks off the recording)
30#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
31pub enum TypeTrue {
32    #[serde(rename = "control")]
33    Control,
34}
35
36impl Default for TypeTrue {
37    fn default() -> TypeTrue {
38        Self::Control
39    }
40}
41/// This is the control action
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum ControlTrue {
44    #[serde(rename = "mute-assistant")]
45    MuteAssistant,
46    #[serde(rename = "unmute-assistant")]
47    UnmuteAssistant,
48    #[serde(rename = "say-first-message")]
49    SayFirstMessage,
50}
51
52impl Default for ControlTrue {
53    fn default() -> ControlTrue {
54        Self::MuteAssistant
55    }
56}