Skip to main content

opensearch_client/indices/
data_streams_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 DataStreamsStatsResponse {
17    #[serde(rename = "_shards")]
18    pub shards: common::ShardStatistics,
19    /// Total number of backing indexes for the selected data streams.
20    #[serde(rename = "backing_indices")]
21    pub backing_indices: u32,
22    /// Total number of selected data streams.
23    #[serde(rename = "data_stream_count")]
24    pub data_stream_count: u32,
25    /// Contains statistics for the selected data streams.
26    #[serde(rename = "data_streams")]
27    pub data_streams: Vec<indices::DataStreamStats>,
28    #[serde(
29        rename = "total_store_size",
30        default,
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub total_store_size: Option<String>,
34    #[serde(rename = "total_store_size_bytes")]
35    pub total_store_size_bytes: u32,
36}
37
38impl DataStreamsStatsResponse {
39    pub fn new(
40        shards: common::ShardStatistics,
41        backing_indices: u32,
42        data_stream_count: u32,
43        data_streams: Vec<indices::DataStreamStats>,
44        total_store_size_bytes: u32,
45    ) -> DataStreamsStatsResponse {
46        DataStreamsStatsResponse {
47            shards,
48            backing_indices,
49            data_stream_count,
50            data_streams,
51            total_store_size: None,
52            total_store_size_bytes,
53        }
54    }
55}