Skip to main content

opensearch_client/common/
get_stats.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 serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct GetStats {
15    #[serde(rename = "current")]
16    pub current: u32,
17    #[serde(rename = "exists_time_in_millis")]
18    pub exists_time_in_millis: String,
19    #[serde(rename = "time_in_millis")]
20    pub time_in_millis: String,
21    #[serde(rename = "total")]
22    pub total: u32,
23    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
24    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
25    #[serde(
26        rename = "exists_time",
27        default,
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub exists_time: Option<String>,
31    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
32    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
33    #[serde(
34        rename = "missing_time",
35        default,
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub missing_time: Option<String>,
39    #[serde(rename = "missing_total")]
40    pub missing_total: u32,
41    #[serde(rename = "missing_time_in_millis")]
42    pub missing_time_in_millis: String,
43    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
44    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
45    #[serde(rename = "getTime", default, skip_serializing_if = "Option::is_none")]
46    pub get_time: Option<String>,
47    #[serde(rename = "exists_total")]
48    pub exists_total: u32,
49}
50
51impl GetStats {
52    pub fn new(
53        current: u32,
54        exists_time_in_millis: String,
55        time_in_millis: String,
56        total: u32,
57        missing_total: u32,
58        missing_time_in_millis: String,
59        exists_total: u32,
60    ) -> GetStats {
61        GetStats {
62            current,
63            exists_time_in_millis,
64            time_in_millis,
65            total,
66            exists_time: None,
67            missing_time: None,
68            missing_total,
69            missing_time_in_millis,
70            get_time: None,
71            exists_total,
72        }
73    }
74}