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