Skip to main content

opensearch_client/core/search/
aggregation_profile.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use crate::core;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AggregationProfile {
16    #[serde(rename = "time_in_nanos")]
17    pub time_in_nanos: String,
18    #[serde(rename = "breakdown")]
19    pub breakdown: core::search::AggregationBreakdown,
20    #[serde(rename = "children", default, skip_serializing_if = "Option::is_none")]
21    pub children: Option<Vec<core::search::AggregationProfile>>,
22    #[serde(rename = "debug", default, skip_serializing_if = "Option::is_none")]
23    pub debug: Option<core::search::AggregationProfileDebug>,
24    #[serde(rename = "type")]
25    pub r#type: String,
26    #[serde(rename = "description")]
27    pub description: String,
28}
29
30impl AggregationProfile {
31    pub fn new(
32        time_in_nanos: String,
33        breakdown: core::search::AggregationBreakdown,
34        r#type: String,
35        description: String,
36    ) -> AggregationProfile {
37        AggregationProfile {
38            time_in_nanos,
39            breakdown,
40            children: None,
41            debug: None,
42            r#type,
43            description,
44        }
45    }
46}