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 SnapshotsRecord {  /// The unique identifier for the snapshot.
    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,  /// Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures
  /// this behavior while keeping the semantics of the field type.
  /// 
  /// Depending on the target language, code generators can keep the union or remove it and leniently parse
  /// strings to the target type.
    #[serde(rename = "start_epoch", default, skip_serializing_if = "Option::is_none")]
    pub start_epoch: Option<common::StringifiedEpochTimeUnitSeconds>,  /// The number of successful shards in the snapshot.
    #[serde(rename = "successful_shards", default, skip_serializing_if = "Option::is_none")]
    pub successful_shards: Option<String>,  /// The reason for any snapshot failures.
    #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
    pub reason: Option<String>,  /// The total number of shards in the snapshot.
    #[serde(rename = "total_shards", default, skip_serializing_if = "Option::is_none")]
    pub total_shards: 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 = "duration", default, skip_serializing_if = "Option::is_none")]
    pub duration: Option<String>,  /// Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures
  /// this behavior while keeping the semantics of the field type.
  /// 
  /// Depending on the target language, code generators can keep the union or remove it and leniently parse
  /// strings to the target type.
    #[serde(rename = "end_epoch", default, skip_serializing_if = "Option::is_none")]
    pub end_epoch: Option<common::StringifiedEpochTimeUnitSeconds>,  /// Time of day, expressed as HH:MM:SS.
    #[serde(rename = "end_time", default, skip_serializing_if = "Option::is_none")]
    pub end_time: Option<String>,  /// The number of failed shards in the snapshot.
    #[serde(rename = "failed_shards", default, skip_serializing_if = "Option::is_none")]
    pub failed_shards: Option<String>,  /// The number of indexes in the snapshot.
    #[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
    pub indices: Option<String>,  /// Time of day, expressed as HH:MM:SS.
    #[serde(rename = "start_time", default, skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,  /// The state of the snapshot process.
  /// Returned values include:
  /// `FAILED`: The snapshot process failed.
  /// `INCOMPATIBLE`: The snapshot process is incompatible with the current cluster version.
  /// `IN_PROGRESS`: The snapshot process started but has not completed.
  /// `PARTIAL`: The snapshot process completed with a partial success.
  /// `SUCCESS`: The snapshot process completed with a full success.
    #[serde(rename = "status", default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,  /// The repository name.
    #[serde(rename = "repository", default, skip_serializing_if = "Option::is_none")]
    pub repository: Option<String>,
}

impl SnapshotsRecord {
    
    pub fn new() -> SnapshotsRecord {
        SnapshotsRecord {
            id: None,
            start_epoch: None,
            successful_shards: None,
            reason: None,
            total_shards: None,
            duration: None,
            end_epoch: None,
            end_time: None,
            failed_shards: None,
            indices: None,
            start_time: None,
            status: None,
            repository: None,
        }
    }
}