vapi_client/models/analytics_query_result.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 AnalyticsQueryResult {
16 /// This is the unique key for the query.
17 #[serde(rename = "name")]
18 pub name: String,
19 /// This is the time range for the query.
20 #[serde(rename = "timeRange")]
21 pub time_range: models::TimeRange,
22 /// This is the result of the query, a list of unique groups with result of their aggregations. Example: \"result\": [ { \"date\": \"2023-01-01\", \"assistantId\": \"123\", \"endedReason\": \"customer-ended-call\", \"sumDuration\": 120, \"avgCost\": 10.5 }, { \"date\": \"2023-01-02\", \"assistantId\": \"123\", \"endedReason\": \"customer-did-not-give-microphone-permission\", \"sumDuration\": 0, \"avgCost\": 0 }, // Additional results ]
23 #[serde(rename = "result")]
24 pub result: Vec<serde_json::Value>,
25}
26
27impl AnalyticsQueryResult {
28 pub fn new(
29 name: String,
30 time_range: models::TimeRange,
31 result: Vec<serde_json::Value>,
32 ) -> AnalyticsQueryResult {
33 AnalyticsQueryResult {
34 name,
35 time_range,
36 result,
37 }
38 }
39}