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};

/// Create
/// The snapshot definition


#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Create {
    #[serde(rename = "metadata", default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<common::Metadata>,  /// Feature states to include in the snapshot. Each feature state includes one or more system indexes containing related data. You can view a list of eligible features using the get features API. If `include_global_state` is `true`, all current feature states are included by default. If `include_global_state` is `false`, no feature states are included by default.
    #[serde(rename = "feature_states", default, skip_serializing_if = "Option::is_none")]
    pub feature_states: Option<Vec<String>>,  /// If `true`, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indexes, such as Watches and task records (configurable with `feature_states`).
    #[serde(rename = "include_global_state", default, skip_serializing_if = "Option::is_none")]
    pub include_global_state: Option<bool>,  /// A comma-separated list of data streams, indexes, and aliases used to limit the request.
  /// Supports wildcards (`*`).
  /// To target all data streams and indexes, omit this parameter or use `*` or `_all`.
    #[serde(rename = "indices", default, skip_serializing_if = "Option::is_none")]
    pub indices: Option<common::Indices>,  /// If `true`, the request ignores data streams and indexes in `indexes` that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed.
    #[serde(rename = "ignore_unavailable", default, skip_serializing_if = "Option::is_none")]
    pub ignore_unavailable: Option<bool>,  /// If `true`, allows restoring a partial snapshot of indexes with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If `false`, the entire restore operation will fail if one or more indexes included in the snapshot do not have all primary shards available.
    #[serde(rename = "partial", default, skip_serializing_if = "Option::is_none")]
    pub partial: Option<bool>,
}

impl Create {
      /// The snapshot definition
    pub fn new() -> Create {
        Create {
            metadata: None,
            feature_states: None,
            include_global_state: None,
            indices: None,
            ignore_unavailable: None,
            partial: None,
        }
    }
}