1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Vapi API
*
* Voice AI for developers.
*
* The version of the OpenAPI document: 1.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CustomMessage {
/// 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.
#[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
/// This is a custom message.
#[serde(rename = "type")]
pub r#type: TypeTrue,
/// This is the content that the assistant will say when this message is triggered.
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
}
impl CustomMessage {
pub fn new(r#type: TypeTrue) -> CustomMessage {
CustomMessage {
contents: None,
r#type,
content: None,
}
}
}
/// This is a custom message.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
#[serde(rename = "custom-message")]
CustomMessage,
}
impl Default for TypeTrue {
fn default() -> TypeTrue {
Self::CustomMessage
}
}