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 TranscriberCost {
    /// This is the type of cost, always 'transcriber' for this class.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the transcriber that was used during the call.  This matches one of the below: - `call.assistant.transcriber`, - `call.assistantId->transcriber`, - `call.squad[n].assistant.transcriber`, - `call.squad[n].assistantId->transcriber`, - `call.squadId->[n].assistant.transcriber`, - `call.squadId->[n].assistantId->transcriber`.
    #[serde(rename = "transcriber")]
    pub transcriber: serde_json::Value,
    /// This is the minutes of `transcriber` usage. This should match `call.endedAt` - `call.startedAt` for single assistant calls, while squad calls will have multiple transcriber costs one for each assistant that was used.
    #[serde(rename = "minutes")]
    pub minutes: f64,
    /// This is the cost of the component in USD.
    #[serde(rename = "cost")]
    pub cost: f64,
}

impl TranscriberCost {
    pub fn new(
        r#type: TypeTrue,
        transcriber: serde_json::Value,
        minutes: f64,
        cost: f64,
    ) -> TranscriberCost {
        TranscriberCost {
            r#type,
            transcriber,
            minutes,
            cost,
        }
    }
}
/// This is the type of cost, always 'transcriber' for this class.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "transcriber")]
    Transcriber,
}

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