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 ResponseTextDeltaEvent {
    /// Index of the content part
    #[serde(rename = "content_index")]
    pub content_index: f64,
    /// Text delta being added
    #[serde(rename = "delta")]
    pub delta: String,
    /// ID of the output item
    #[serde(rename = "item_id")]
    pub item_id: String,
    /// Index of the output item
    #[serde(rename = "output_index")]
    pub output_index: f64,
    /// Event type
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
}

impl ResponseTextDeltaEvent {
    pub fn new(
        content_index: f64,
        delta: String,
        item_id: String,
        output_index: f64,
        r#type: TypeTrue,
    ) -> ResponseTextDeltaEvent {
        ResponseTextDeltaEvent {
            content_index,
            delta,
            item_id,
            output_index,
            r#type,
        }
    }
}
/// Event type
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "response.output_text.delta")]
    ResponsePeriodOutputTextPeriodDelta,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::ResponsePeriodOutputTextPeriodDelta
    }
}