/*
* 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 ExactReplacement {
/// 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' }
#[serde(rename = "type")]
pub r#type: TypeTrue,
/// 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
#[serde(rename = "replaceAllEnabled", skip_serializing_if = "Option::is_none")]
pub replace_all_enabled: Option<bool>,
/// This is the key to replace.
#[serde(rename = "key")]
pub key: String,
/// This is the value that will replace the match.
#[serde(rename = "value")]
pub value: String,
}
impl ExactReplacement {
pub fn new(r#type: TypeTrue, key: String, value: String) -> ExactReplacement {
ExactReplacement {
r#type,
replace_all_enabled: None,
key,
value,
}
}
}
/// 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' }
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
#[serde(rename = "exact")]
Exact,
}
impl Default for TypeTrue {
fn default() -> TypeTrue {
Self::Exact
}
}