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 serde::{Deserialize, Serialize};




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MergesStats {
    #[serde(rename = "total_auto_throttle", default, skip_serializing_if = "Option::is_none")]
    pub total_auto_throttle: Option<String>,
    #[serde(rename = "total_docs")]
    pub total_docs: u32,
    #[serde(rename = "current_docs")]
    pub current_docs: u32,
    #[serde(rename = "total")]
    pub total: u32,
    #[serde(rename = "total_stopped_time_in_millis")]
    pub total_stopped_time_in_millis: String,  /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
  /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
    #[serde(rename = "total_throttled_time", default, skip_serializing_if = "Option::is_none")]
    pub total_throttled_time: Option<String>,
    #[serde(rename = "total_size", default, skip_serializing_if = "Option::is_none")]
    pub total_size: Option<String>,
    #[serde(rename = "total_throttled_time_in_millis")]
    pub total_throttled_time_in_millis: String,
    #[serde(rename = "total_size_in_bytes")]
    pub total_size_in_bytes: u32,
    #[serde(rename = "current_size", default, skip_serializing_if = "Option::is_none")]
    pub current_size: Option<String>,  /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
  /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
    #[serde(rename = "total_stopped_time", default, skip_serializing_if = "Option::is_none")]
    pub total_stopped_time: Option<String>,
    #[serde(rename = "total_time_in_millis")]
    pub total_time_in_millis: String,
    #[serde(rename = "unreferenced_file_cleanups_performed", default, skip_serializing_if = "Option::is_none")]
    pub unreferenced_file_cleanups_performed: Option<u32>,
    #[serde(rename = "current")]
    pub current: u32,
    #[serde(rename = "current_size_in_bytes")]
    pub current_size_in_bytes: u32,  /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
  /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
    #[serde(rename = "total_time", default, skip_serializing_if = "Option::is_none")]
    pub total_time: Option<String>,
    #[serde(rename = "total_auto_throttle_in_bytes")]
    pub total_auto_throttle_in_bytes: u32,
}

impl MergesStats {
    
    pub fn new(total_docs: u32, current_docs: u32, total: u32, total_stopped_time_in_millis: String, total_throttled_time_in_millis: String, total_size_in_bytes: u32, total_time_in_millis: String, current: u32, current_size_in_bytes: u32, total_auto_throttle_in_bytes: u32) -> MergesStats {
        MergesStats {
            total_auto_throttle: None,
            total_docs,
            current_docs,
            total,
            total_stopped_time_in_millis,
            total_throttled_time: None,
            total_size: None,
            total_throttled_time_in_millis,
            total_size_in_bytes,
            current_size: None,
            total_stopped_time: None,
            total_time_in_millis,
            unreferenced_file_cleanups_performed: None,
            current,
            current_size_in_bytes,
            total_time: None,
            total_auto_throttle_in_bytes,
        }
    }
}