vapi_client/models/
block_start_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 BlockStartMessage {
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 an optional array of conditions that must be met for this message to be triggered.
23    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
24    pub conditions: Option<Vec<models::BlockStartMessageConditionsInner>>,
25    /// This is the message type that is triggered when the block starts.
26    #[serde(rename = "type")]
27    pub r#type: Type,
28    /// This is the content that the assistant will say when this message is triggered.
29    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
30    pub content: Option<String>,
31}
32
33impl BlockStartMessage {
34    pub fn new(r#type: Type) -> BlockStartMessage {
35        BlockStartMessage {
36            contents: None,
37            conditions: None,
38            r#type,
39            content: None,
40        }
41    }
42}
43/// This is the message type that is triggered when the block starts.
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
45pub enum Type {
46    #[serde(rename = "block-start")]
47    BlockStart,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::BlockStart
53    }
54}