vapi_client/models/
custom_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 CustomMessage {
17    /// 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.
18    #[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
19    pub contents: Option<Vec<models::ToolMessageStartContentsInner>>,
20    /// This is a custom message.
21    #[serde(rename = "type")]
22    pub r#type: Type,
23    /// This is the content that the assistant will say when this message is triggered.
24    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
25    pub content: Option<String>,
26}
27
28impl CustomMessage {
29    pub fn new(r#type: Type) -> CustomMessage {
30        CustomMessage {
31            contents: None,
32            r#type,
33            content: None,
34        }
35    }
36}
37/// This is a custom message.
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Type {
40    #[serde(rename = "custom-message")]
41    CustomMessage,
42}
43
44impl Default for Type {
45    fn default() -> Type {
46        Self::CustomMessage
47    }
48}