vapi_client/models/
custom_message.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 CustomMessage {
16    /// This is an alternative to the `content` property. It allows to specify variants of the same content, one per language.  Usage: - If your assistants are multilingual, you can provide content for each language. - If you don't provide content for a language, the first item in the array will be automatically translated to the active language at that moment.  This will override the `content` property.
17    #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
18    pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
19    /// This is a custom message.
20    #[serde(rename = "type")]
21    pub r#type: TypeTrue,
22    /// This is the content that the assistant will say when this message is triggered.
23    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
24    pub content: Option<String>,
25}
26
27impl CustomMessage {
28    pub fn new(r#type: TypeTrue) -> CustomMessage {
29        CustomMessage {
30            contents: None,
31            r#type,
32            content: None,
33        }
34    }
35}
36/// This is a custom message.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum TypeTrue {
39    #[serde(rename = "custom-message")]
40    CustomMessage,
41}
42
43impl Default for TypeTrue {
44    fn default() -> TypeTrue {
45        Self::CustomMessage
46    }
47}