vapi_client/models/
exact_replacement.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ExactReplacement {
16    /// This is the exact replacement type. You can use this to replace a specific word or phrase with a different word or phrase.  Usage: - Replace \"hello\" with \"hi\": { type: 'exact', key: 'hello', value: 'hi' } - Replace \"good morning\" with \"good day\": { type: 'exact', key: 'good morning', value: 'good day' } - Replace a specific name: { type: 'exact', key: 'John Doe', value: 'Jane Smith' } - Replace an acronym: { type: 'exact', key: 'AI', value: 'Artificial Intelligence' } - Replace a company name with its phonetic pronunciation: { type: 'exact', key: 'Vapi', value: 'Vappy' }
17    #[serde(rename = "type")]
18    pub r#type: TypeTrue,
19    /// This option let's you control whether to replace all instances of the key or only the first one. By default, it only replaces the first instance. Examples: - For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: false }. Before: \"hello world, hello universe\" | After: \"hi world, hello universe\" - For { type: 'exact', key: 'hello', value: 'hi', replaceAllEnabled: true }. Before: \"hello world, hello universe\" | After: \"hi world, hi universe\" @default false
20    #[serde(rename = "replaceAllEnabled", skip_serializing_if = "Option::is_none")]
21    pub replace_all_enabled: Option<bool>,
22    /// This is the key to replace.
23    #[serde(rename = "key")]
24    pub key: String,
25    /// This is the value that will replace the match.
26    #[serde(rename = "value")]
27    pub value: String,
28}
29
30impl ExactReplacement {
31    pub fn new(r#type: TypeTrue, key: String, value: String) -> ExactReplacement {
32        ExactReplacement {
33            r#type,
34            replace_all_enabled: None,
35            key,
36            value,
37        }
38    }
39}
40/// This is the exact replacement type. You can use this to replace a specific word or phrase with a different word or phrase.  Usage: - Replace \"hello\" with \"hi\": { type: 'exact', key: 'hello', value: 'hi' } - Replace \"good morning\" with \"good day\": { type: 'exact', key: 'good morning', value: 'good day' } - Replace a specific name: { type: 'exact', key: 'John Doe', value: 'Jane Smith' } - Replace an acronym: { type: 'exact', key: 'AI', value: 'Artificial Intelligence' } - Replace a company name with its phonetic pronunciation: { type: 'exact', key: 'Vapi', value: 'Vappy' }
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum TypeTrue {
43    #[serde(rename = "exact")]
44    Exact,
45}
46
47impl Default for TypeTrue {
48    fn default() -> TypeTrue {
49        Self::Exact
50    }
51}