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: Box<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(name: String, time_range: models::TimeRange, result: Vec<serde_json::Value>) -> AnalyticsQueryResult {
29        AnalyticsQueryResult {
30            name,
31            time_range: Box::new(time_range),
32            result,
33        }
34    }
35}
36