fastcomments-sdk 3.0.1

Official FastComments Rust SDK (Typed API Client & Utilities)
Documentation
/*
 * fastcomments
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::client::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct QuestionResultAggregationOverall {
    /// Construct a type with a set of properties K of type T
    #[serde(rename = "dataByDateBucket", skip_serializing_if = "Option::is_none")]
    pub data_by_date_bucket: Option<std::collections::HashMap<String, models::QuestionDatum>>,
    /// Construct a type with a set of properties K of type T
    #[serde(rename = "dataByUrlId", skip_serializing_if = "Option::is_none")]
    pub data_by_url_id: Option<std::collections::HashMap<String, models::QuestionDatum>>,
    #[serde(rename = "countsByValue", skip_serializing_if = "Option::is_none")]
    pub counts_by_value: Option<std::collections::HashMap<String, i32>>,
    #[serde(rename = "total")]
    pub total: i64,
    #[serde(rename = "average", skip_serializing_if = "Option::is_none")]
    pub average: Option<f64>,
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
}

impl QuestionResultAggregationOverall {
    pub fn new(total: i64, created_at: chrono::DateTime<chrono::FixedOffset>) -> QuestionResultAggregationOverall {
        QuestionResultAggregationOverall {
            data_by_date_bucket: None,
            data_by_url_id: None,
            counts_by_value: None,
            total,
            average: None,
            created_at,
        }
    }
}