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 */
1011use crate::models;
12use serde::{Deserialize, Serialize};
1314#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AnalyticsQuery {
16/// This is the table you want to query.
17#[serde(rename = "table")]
18pub table: TableTrue,
19/// This is the list of columns you want to group by.
20#[serde(rename = "groupBy", skip_serializing_if = "Option::is_none")]
21pub group_by: Option<Vec<GroupByTrue>>,
22/// This is the name of the query. This will be used to identify the query in the response.
23#[serde(rename = "name")]
24pub name: String,
25/// This is the time range for the query.
26#[serde(rename = "timeRange", skip_serializing_if = "Option::is_none")]
27pub time_range: Option<models::TimeRange>,
28/// This is the list of operations you want to perform.
29#[serde(rename = "operations")]
30pub operations: Vec<models::AnalyticsOperation>,
31}
3233impl AnalyticsQuery {
34pub fn new(
35 table: TableTrue,
36 name: String,
37 operations: Vec<models::AnalyticsOperation>,
38 ) -> AnalyticsQuery {
39 AnalyticsQuery {
40 table,
41 group_by: None,
42 name,
43 time_range: None,
44 operations,
45 }
46 }
47}
48/// This is the table you want to query.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum TableTrue {
51#[serde(rename = "call")]
52Call,
53#[serde(rename = "subscription")]
54Subscription,
55}
5657impl Default for TableTrue {
58fn default() -> TableTrue {
59Self::Call
60 }
61}
62/// This is the list of columns you want to group by.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum GroupByTrue {
65#[serde(rename = "type")]
66Type,
67#[serde(rename = "assistantId")]
68AssistantId,
69#[serde(rename = "endedReason")]
70EndedReason,
71#[serde(rename = "analysis.successEvaluation")]
72AnalysisPeriodSuccessEvaluation,
73#[serde(rename = "status")]
74Status,
75}
7677impl Default for GroupByTrue {
78fn default() -> GroupByTrue {
79Self::Type
80 }
81}