Skip to main content

opensearch_client/indices/
stats_response.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::common;
12use crate::indices;
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct StatsResponse {
17    #[serde(rename = "_shards")]
18    pub shards: common::ShardStatistics,
19    #[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
20    pub indices: Option<serde_json::Value>,
21    #[serde(rename = "_all")]
22    pub all: indices::stats::AllIndicesStats,
23}
24
25impl StatsResponse {
26    pub fn new(
27        shards: common::ShardStatistics,
28        all: indices::stats::AllIndicesStats,
29    ) -> StatsResponse {
30        StatsResponse {
31            shards,
32            indices: None,
33            all,
34        }
35    }
36}