vapi_client/models/
analytics_operation.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 AnalyticsOperation {
16    /// This is the aggregation operation you want to perform.
17    #[serde(rename = "operation")]
18    pub operation: OperationTrue,
19    /// This is the columns you want to perform the aggregation operation on.
20    #[serde(rename = "column")]
21    pub column: ColumnTrue,
22    /// This is the alias for column name returned. Defaults to `${operation}${column}`.
23    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
24    pub alias: Option<String>,
25}
26
27impl AnalyticsOperation {
28    pub fn new(operation: OperationTrue, column: ColumnTrue) -> AnalyticsOperation {
29        AnalyticsOperation {
30            operation,
31            column,
32            alias: None,
33        }
34    }
35}
36/// This is the aggregation operation you want to perform.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum OperationTrue {
39    #[serde(rename = "sum")]
40    Sum,
41    #[serde(rename = "avg")]
42    Avg,
43    #[serde(rename = "count")]
44    Count,
45    #[serde(rename = "min")]
46    Min,
47    #[serde(rename = "max")]
48    Max,
49    #[serde(rename = "history")]
50    History,
51}
52
53impl Default for OperationTrue {
54    fn default() -> OperationTrue {
55        Self::Sum
56    }
57}
58/// This is the columns you want to perform the aggregation operation on.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum ColumnTrue {
61    #[serde(rename = "id")]
62    Id,
63    #[serde(rename = "cost")]
64    Cost,
65    #[serde(rename = "costBreakdown.llm")]
66    CostBreakdownPeriodLlm,
67    #[serde(rename = "costBreakdown.stt")]
68    CostBreakdownPeriodStt,
69    #[serde(rename = "costBreakdown.tts")]
70    CostBreakdownPeriodTts,
71    #[serde(rename = "costBreakdown.vapi")]
72    CostBreakdownPeriodVapi,
73    #[serde(rename = "costBreakdown.ttsCharacters")]
74    CostBreakdownPeriodTtsCharacters,
75    #[serde(rename = "costBreakdown.llmPromptTokens")]
76    CostBreakdownPeriodLlmPromptTokens,
77    #[serde(rename = "costBreakdown.llmCompletionTokens")]
78    CostBreakdownPeriodLlmCompletionTokens,
79    #[serde(rename = "duration")]
80    Duration,
81    #[serde(rename = "concurrency")]
82    Concurrency,
83    #[serde(rename = "minutesUsed")]
84    MinutesUsed,
85}
86
87impl Default for ColumnTrue {
88    fn default() -> ColumnTrue {
89        Self::Id
90    }
91}