vapi_client/models/
client_inbound_message_control.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ClientInboundMessageControl {
17    /// 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)
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// This is the control action
21    #[serde(rename = "control")]
22    pub control: Control,
23}
24
25impl ClientInboundMessageControl {
26    pub fn new(r#type: Type, control: Control) -> ClientInboundMessageControl {
27        ClientInboundMessageControl { r#type, control }
28    }
29}
30/// 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)
31#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
32pub enum Type {
33    #[serde(rename = "control")]
34    Control,
35}
36
37impl Default for Type {
38    fn default() -> Type {
39        Self::Control
40    }
41}
42/// This is the control action
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Control {
45    #[serde(rename = "mute-assistant")]
46    MuteAssistant,
47    #[serde(rename = "unmute-assistant")]
48    UnmuteAssistant,
49    #[serde(rename = "say-first-message")]
50    SayFirstMessage,
51}
52
53impl Default for Control {
54    fn default() -> Control {
55        Self::MuteAssistant
56    }
57}