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 AdaptiveSelection {  /// The exponentially weighted moving average queue size of search requests on the keyed node.
    #[serde(rename = "avg_queue_size", default, skip_serializing_if = "Option::is_none")]
    pub avg_queue_size: Option<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 = "avg_response_time", default, skip_serializing_if = "Option::is_none")]
    pub avg_response_time: Option<String>,  /// The number of outstanding search requests to the keyed node from the node these stats are for.
    #[serde(rename = "outgoing_searches", default, skip_serializing_if = "Option::is_none")]
    pub outgoing_searches: Option<u32>,  /// The rank of this node; used for shard selection when routing search requests.
    #[serde(rename = "rank", default, skip_serializing_if = "Option::is_none")]
    pub rank: 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 = "avg_service_time", default, skip_serializing_if = "Option::is_none")]
    pub avg_service_time: Option<String>,
    #[serde(rename = "avg_service_time_ns", default, skip_serializing_if = "Option::is_none")]
    pub avg_service_time_ns: Option<String>,
    #[serde(rename = "avg_response_time_ns", default, skip_serializing_if = "Option::is_none")]
    pub avg_response_time_ns: Option<String>,
}

impl AdaptiveSelection {
    
    pub fn new() -> AdaptiveSelection {
        AdaptiveSelection {
            avg_queue_size: None,
            avg_response_time: None,
            outgoing_searches: None,
            rank: None,
            avg_service_time: None,
            avg_service_time_ns: None,
            avg_response_time_ns: None,
        }
    }
}