opensearch_client/indices/
stats_response.rs1use 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}