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 AnalysisCost {
    /// This is the type of cost, always 'analysis' for this class.
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the type of analysis performed.
    #[serde(rename = "analysisType")]
    pub analysis_type: AnalysisTypeTrue,
    /// This is the model that was used to perform the analysis.
    #[serde(rename = "model")]
    pub model: serde_json::Value,
    /// This is the number of prompt tokens used in the analysis.
    #[serde(rename = "promptTokens")]
    pub prompt_tokens: f64,
    /// This is the number of completion tokens generated in the analysis.
    #[serde(rename = "completionTokens")]
    pub completion_tokens: f64,
    /// This is the cost of the component in USD.
    #[serde(rename = "cost")]
    pub cost: f64,
}

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

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Analysis
    }
}
/// This is the type of analysis performed.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AnalysisTypeTrue {
    #[serde(rename = "summary")]
    Summary,
    #[serde(rename = "structuredData")]
    StructuredData,
    #[serde(rename = "successEvaluation")]
    SuccessEvaluation,
}

impl Default for AnalysisTypeTrue {
    fn default() -> AnalysisTypeTrue {
        Self::Summary
    }
}