vapi_client/models/transcriber_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 TranscriberCost {
19 /// This is the type of cost, always 'transcriber' for this class.
20 #[serde(rename = "type")]
21 pub r#type: Type,
22 /// 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`.
23 #[serde(rename = "transcriber")]
24 pub transcriber: serde_json::Value,
25 /// 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.
26 #[serde(rename = "minutes")]
27 pub minutes: f64,
28 /// This is the cost of the component in USD.
29 #[serde(rename = "cost")]
30 pub cost: f64,
31}
32
33impl TranscriberCost {
34 pub fn new(
35 r#type: Type,
36 transcriber: serde_json::Value,
37 minutes: f64,
38 cost: f64,
39 ) -> TranscriberCost {
40 TranscriberCost {
41 r#type,
42 transcriber,
43 minutes,
44 cost,
45 }
46 }
47}
48/// This is the type of cost, always 'transcriber' for this class.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, OpenApi)]
50pub enum Type {
51 #[serde(rename = "transcriber")]
52 Transcriber,
53}
54
55impl Default for Type {
56 fn default() -> Type {
57 Self::Transcriber
58 }
59}