opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

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,
    /// Total number of backing indexes for the selected data streams.
    #[serde(rename = "backing_indices")]
    pub backing_indices: u32,
    /// Total number of selected data streams.
    #[serde(rename = "data_stream_count")]
    pub data_stream_count: u32,
    /// Contains statistics for the selected data streams.
    #[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,
        }
    }
}