vapi_client/models/voice_cost.rs
1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct VoiceCost {
16 /// This is the type of cost, always 'voice' for this class.
17 #[serde(rename = "type")]
18 pub r#type: TypeTrue,
19 /// 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`.
20 #[serde(rename = "voice")]
21 pub voice: serde_json::Value,
22 /// 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.
23 #[serde(rename = "characters")]
24 pub characters: f64,
25 /// This is the cost of the component in USD.
26 #[serde(rename = "cost")]
27 pub cost: f64,
28}
29
30impl VoiceCost {
31 pub fn new(
32 r#type: TypeTrue,
33 voice: serde_json::Value,
34 characters: f64,
35 cost: f64,
36 ) -> VoiceCost {
37 VoiceCost {
38 r#type,
39 voice,
40 characters,
41 cost,
42 }
43 }
44}
45/// This is the type of cost, always 'voice' for this class.
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum TypeTrue {
48 #[serde(rename = "voice")]
49 Voice,
50}
51
52impl Default for TypeTrue {
53 fn default() -> TypeTrue {
54 Self::Voice
55 }
56}