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 FormatPlan {
    /// This determines whether the chunk is formatted before being sent to the voice provider. This helps with enunciation. This includes phone numbers, emails and addresses. Default `true`.  Usage: - To rely on the voice provider's formatting logic, set this to `false`.  If `voice.chunkPlan.enabled` is `false`, this is automatically `false` since there's no chunk to format.  @default true
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// This is the cutoff after which a number is converted to individual digits instead of being spoken as words.  Example: - If cutoff 2025, \"12345\" is converted to \"1 2 3 4 5\" while \"1200\" is converted to \"twelve hundred\".  Usage: - If your use case doesn't involve IDs like zip codes, set this to a high value. - If your use case involves IDs that are shorter than 5 digits, set this to a lower value.  @default 2025
    #[serde(
        rename = "numberToDigitsCutoff",
        skip_serializing_if = "Option::is_none"
    )]
    pub number_to_digits_cutoff: Option<f64>,
    /// These are the custom replacements you can make to the chunk before it is sent to the voice provider.  Usage: - To replace a specific word or phrase with a different word or phrase, use the `ExactReplacement` type. Eg. `{ type: 'exact', key: 'hello', value: 'hi' }` - To replace a word or phrase that matches a pattern, use the `RegexReplacement` type. Eg. `{ type: 'regex', regex: '\\\\b[a-zA-Z]{5}\\\\b', value: 'hi' }`  @default []
    #[serde(rename = "replacements", skip_serializing_if = "Option::is_none")]
    pub replacements: Option<Vec<models::FormatPlanReplacementsInner>>,
    /// List of formatters to apply. If not provided, all default formatters will be applied. If provided, only the specified formatters will be applied. Note: Some essential formatters like angle bracket removal will always be applied. @default undefined
    #[serde(rename = "formattersEnabled", skip_serializing_if = "Option::is_none")]
    pub formatters_enabled: Option<Vec<FormattersEnabledTrue>>,
}

impl FormatPlan {
    pub fn new() -> FormatPlan {
        FormatPlan {
            enabled: None,
            number_to_digits_cutoff: None,
            replacements: None,
            formatters_enabled: None,
        }
    }
}
/// List of formatters to apply. If not provided, all default formatters will be applied. If provided, only the specified formatters will be applied. Note: Some essential formatters like angle bracket removal will always be applied. @default undefined
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FormattersEnabledTrue {
    #[serde(rename = "markdown")]
    Markdown,
    #[serde(rename = "asterisk")]
    Asterisk,
    #[serde(rename = "quote")]
    Quote,
    #[serde(rename = "dash")]
    Dash,
    #[serde(rename = "newline")]
    Newline,
    #[serde(rename = "colon")]
    Colon,
    #[serde(rename = "acronym")]
    Acronym,
    #[serde(rename = "dollarAmount")]
    DollarAmount,
    #[serde(rename = "email")]
    Email,
    #[serde(rename = "date")]
    Date,
    #[serde(rename = "time")]
    Time,
    #[serde(rename = "distance")]
    Distance,
    #[serde(rename = "unit")]
    Unit,
    #[serde(rename = "percentage")]
    Percentage,
    #[serde(rename = "phoneNumber")]
    PhoneNumber,
    #[serde(rename = "number")]
    Number,
    #[serde(rename = "stripAsterisk")]
    StripAsterisk,
}

impl Default for FormattersEnabledTrue {
    fn default() -> FormattersEnabledTrue {
        Self::Markdown
    }
}