use crate::common;
use crate::indices;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DataStreamsStatsResponse {
#[serde(rename = "_shards")]
pub shards: common::ShardStatistics,
#[serde(rename = "backing_indices")]
pub backing_indices: u32,
#[serde(rename = "data_stream_count")]
pub data_stream_count: u32,
#[serde(rename = "data_streams")]
pub data_streams: Vec<indices::DataStreamStats>,
#[serde(
rename = "total_store_size",
default,
skip_serializing_if = "Option::is_none"
)]
pub total_store_size: Option<String>,
#[serde(rename = "total_store_size_bytes")]
pub total_store_size_bytes: u32,
}
impl DataStreamsStatsResponse {
pub fn new(
shards: common::ShardStatistics,
backing_indices: u32,
data_stream_count: u32,
data_streams: Vec<indices::DataStreamStats>,
total_store_size_bytes: u32,
) -> DataStreamsStatsResponse {
DataStreamsStatsResponse {
shards,
backing_indices,
data_stream_count,
data_streams,
total_store_size: None,
total_store_size_bytes,
}
}
}