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




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NodeStatistics {
    #[serde(rename = "failures", default, skip_serializing_if = "Option::is_none")]
    pub failures: Option<Vec<common::ErrorCause>>,  /// The number of nodes that responded successfully to the request.
    #[serde(rename = "successful")]
    pub successful: u32,  /// The total number of nodes selected by the request.
    #[serde(rename = "total")]
    pub total: u32,  /// The number of nodes that rejected the request or failed to respond. If this value is not 0, then a reason for the rejection or failure is included in the response.
    #[serde(rename = "failed")]
    pub failed: u32,
}

impl NodeStatistics {
    
    pub fn new(successful: u32, total: u32, failed: u32) -> NodeStatistics {
        NodeStatistics {
            failures: None,
            successful,
            total,
            failed,
        }
    }
}