vapi_client/models/
client_inbound_message_add_message.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 ClientInboundMessageAddMessage {
17    /// This is the type of the message. Send \"add-message\" message to add a message to the conversation history.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// This is the message to add to the conversation.
21    #[serde(rename = "message")]
22    pub message: models::OpenAiMessage,
23    /// This is the flag to trigger a response, or to insert the message into the conversation history silently. Defaults to `true`.  Usage: - Use `true` to trigger a response. - Use `false` to insert the message into the conversation history silently.  @default true
24    #[serde(
25        rename = "triggerResponseEnabled",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub trigger_response_enabled: Option<bool>,
29}
30
31impl ClientInboundMessageAddMessage {
32    pub fn new(r#type: Type, message: models::OpenAiMessage) -> ClientInboundMessageAddMessage {
33        ClientInboundMessageAddMessage {
34            r#type,
35            message,
36            trigger_response_enabled: None,
37        }
38    }
39}
40/// This is the type of the message. Send \"add-message\" message to add a message to the conversation history.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Type {
43    #[serde(rename = "add-message")]
44    AddMessage,
45}
46
47impl Default for Type {
48    fn default() -> Type {
49        Self::AddMessage
50    }
51}