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 FallbackCustomVoice {
    /// This is the flag to toggle voice caching for the assistant.
    #[serde(rename = "cachingEnabled", skip_serializing_if = "Option::is_none")]
    pub caching_enabled: Option<bool>,
    /// This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.
    #[serde(rename = "provider")]
    pub provider: ProviderTrue,
    /// This is where the voice request will be sent.  Request Example:  POST https://{server.url} Content-Type: application/json  {   \"message\": {     \"type\": \"voice-request\",     \"text\": \"Hello, world!\",     \"sampleRate\": 24000,     ...other metadata about the call...   } }  Response Expected: 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport: ``` response.on('data', (chunk: Buffer) => {   outputStream.write(chunk); }); ```
    #[serde(rename = "server")]
    pub server: models::Server,
    /// This is the plan for chunking the model output before it is sent to the voice provider.
    #[serde(rename = "chunkPlan", skip_serializing_if = "Option::is_none")]
    pub chunk_plan: Option<models::ChunkPlan>,
}

impl FallbackCustomVoice {
    pub fn new(provider: ProviderTrue, server: models::Server) -> FallbackCustomVoice {
        FallbackCustomVoice {
            caching_enabled: None,
            provider,
            server,
            chunk_plan: None,
        }
    }
}
/// This is the voice provider that will be used. Use `custom-voice` for providers that are not natively supported.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderTrue {
    #[serde(rename = "custom-voice")]
    CustomVoice,
}

impl Default for ProviderTrue {
    fn default() -> ProviderTrue {
        Self::CustomVoice
    }
}