vapi_client/models/
voice_cost.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use utoipa::OpenApi;
13
14
15use crate::models;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, OpenApi)]
18pub struct VoiceCost {
19    /// This is the type of cost, always 'voice' for this class.
20    #[serde(rename = "type")]
21    pub r#type: Type,
22    /// This is the voice that was used during the call.  This matches one of the following: - `call.assistant.voice`, - `call.assistantId->voice`, - `call.squad[n].assistant.voice`, - `call.squad[n].assistantId->voice`, - `call.squadId->[n].assistant.voice`, - `call.squadId->[n].assistantId->voice`.
23    #[serde(rename = "voice")]
24    pub voice: serde_json::Value,
25    /// This is the number of characters that were generated during the call. These should be total characters used in the call for single assistant calls, while squad calls will have multiple voice costs one for each assistant that was used.
26    #[serde(rename = "characters")]
27    pub characters: f64,
28    /// This is the cost of the component in USD.
29    #[serde(rename = "cost")]
30    pub cost: f64,
31}
32
33impl VoiceCost {
34    pub fn new(r#type: Type, voice: serde_json::Value, characters: f64, cost: f64) -> VoiceCost {
35        VoiceCost {
36            r#type,
37            voice,
38            characters,
39            cost,
40        }
41    }
42}
43/// This is the type of cost, always 'voice' for this class.
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
45pub enum Type {
46    #[serde(rename = "voice")]
47    Voice,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::Voice
53    }
54}