vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * 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
    }
}