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: Type,
19    /// This is the control action
20    #[serde(rename = "control")]
21    pub control: Control,
22}
23
24impl ClientInboundMessageControl {
25    pub fn new(r#type: Type, control: Control) -> ClientInboundMessageControl {
26        ClientInboundMessageControl {
27            r#type,
28            control,
29        }
30    }
31}
32/// 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)
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Type {
35    #[serde(rename = "control")]
36    Control,
37}
38
39impl Default for Type {
40    fn default() -> Type {
41        Self::Control
42    }
43}
44/// This is the control action
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Control {
47    #[serde(rename = "mute-assistant")]
48    MuteAssistant,
49    #[serde(rename = "unmute-assistant")]
50    UnmuteAssistant,
51    #[serde(rename = "say-first-message")]
52    SayFirstMessage,
53}
54
55impl Default for Control {
56    fn default() -> Control {
57        Self::MuteAssistant
58    }
59}
60