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