use crate::common;
use crate::indices;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct StatsResponse {
#[serde(rename = "_shards")]
pub shards: common::ShardStatistics,
#[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
pub indices: Option<serde_json::Value>,
#[serde(rename = "_all")]
pub all: indices::stats::AllIndicesStats,
}
impl StatsResponse {
pub fn new(
shards: common::ShardStatistics,
all: indices::stats::AllIndicesStats,
) -> StatsResponse {
StatsResponse {
shards,
indices: None,
all,
}
}
}