opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

use serde::{Deserialize, Serialize};




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AggregationBreakdown {
    #[serde(rename = "reduce_count")]
    pub reduce_count: u32,
    #[serde(rename = "collect_count")]
    pub collect_count: u32,
    #[serde(rename = "build_aggregation")]
    pub build_aggregation: u32,
    #[serde(rename = "build_leaf_collector_count")]
    pub build_leaf_collector_count: u32,
    #[serde(rename = "build_leaf_collector")]
    pub build_leaf_collector: u32,
    #[serde(rename = "collect")]
    pub collect: u32,
    #[serde(rename = "build_aggregation_count")]
    pub build_aggregation_count: u32,
    #[serde(rename = "initialize_count")]
    pub initialize_count: u32,
    #[serde(rename = "post_collection", default, skip_serializing_if = "Option::is_none")]
    pub post_collection: Option<u32>,
    #[serde(rename = "post_collection_count", default, skip_serializing_if = "Option::is_none")]
    pub post_collection_count: Option<u32>,
    #[serde(rename = "initialize")]
    pub initialize: u32,
    #[serde(rename = "reduce")]
    pub reduce: u32,
}

impl AggregationBreakdown {
    
    pub fn new(reduce_count: u32, collect_count: u32, build_aggregation: u32, build_leaf_collector_count: u32, build_leaf_collector: u32, collect: u32, build_aggregation_count: u32, initialize_count: u32, initialize: u32, reduce: u32) -> AggregationBreakdown {
        AggregationBreakdown {
            reduce_count,
            collect_count,
            build_aggregation,
            build_leaf_collector_count,
            build_leaf_collector,
            collect,
            build_aggregation_count,
            initialize_count,
            post_collection: None,
            post_collection_count: None,
            initialize,
            reduce,
        }
    }
}