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

/// RestoreRequestBodyJson
/// Details of what to restore


#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RestoreRequestBodyJson {  /// A comma-delimited list of index settings that you don't want to restore from a snapshot.
    #[serde(rename = "ignore_index_settings", default, skip_serializing_if = "Option::is_none")]
    pub ignore_index_settings: Option<Vec<String>>,  /// How to handle index aliases from the original snapshot. If `true`, index aliases from the original snapshot are restored. If `false`, aliases along with associated indexes are not restored. Defaults to `true`.
    #[serde(rename = "include_aliases", default, skip_serializing_if = "Option::is_none")]
    pub include_aliases: Option<bool>,  /// How to handle data streams or indexes that are missing or closed. If `false`, the request returns an error for any data stream or index that is missing or closed. If `true`, the request ignores data streams and indexes in indexes that are missing or closed. Defaults to `false`.
    #[serde(rename = "ignore_unavailable", default, skip_serializing_if = "Option::is_none")]
    pub ignore_unavailable: Option<bool>,  /// Whether to restore the current cluster state. If `false`, the cluster state is not restored. If true, the current cluster state is restored. Defaults to `false`.
    #[serde(rename = "include_global_state", default, skip_serializing_if = "Option::is_none")]
    pub include_global_state: Option<bool>,  /// The pattern to apply to the restored data streams and indexes. Data streams and indexes matching the rename pattern will be renamed according to the `rename_replacement` setting.
  /// The rename pattern is applied as defined by the regular expression that supports referencing the original text.
  /// The request fails if two or more data streams or indexes are renamed into the same name.
  /// If you rename a restored data stream, its backing indexes are also renamed. For example, if you rename the logs data stream to `recovered-logs`, the backing index `.ds-logs-1` is renamed to `.ds-recovered-logs-1`.
  /// If you rename a restored stream, ensure an index template matches the new stream name. If there are no matching index template names, the stream cannot roll over and new backing indexes are not created.
    #[serde(rename = "rename_pattern", default, skip_serializing_if = "Option::is_none")]
    pub rename_pattern: Option<String>,  /// The rename replacement string.
    #[serde(rename = "rename_replacement", default, skip_serializing_if = "Option::is_none")]
    pub rename_replacement: Option<String>,  /// 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>,  /// How the restore operation will behave if indexes in the snapshot do not have all primary shards available.
  /// If `false`, the entire restore operation fails if any indexes in the snapshot do not have all primary shards available.
  /// If `true`, allows the restoration of a partial snapshot of indexes with unavailable shards. Only shards that were successfully included in the snapshot are restored. All missing shards are recreated as empty. By default, the entire restore operation fails if one or more indexes included in the snapshot do not have all primary shards available. To change this behavior, set `partial` to `true`.
  /// Defaults to `false`.
    #[serde(rename = "partial", default, skip_serializing_if = "Option::is_none")]
    pub partial: Option<bool>,  /// The index settings to be updated.
    #[serde(rename = "index_settings", default, skip_serializing_if = "Option::is_none")]
    pub index_settings: Option<indices::IndexSettings>,
}

impl RestoreRequestBodyJson {
      /// Details of what to restore
    pub fn new() -> RestoreRequestBodyJson {
        RestoreRequestBodyJson {
            ignore_index_settings: None,
            include_aliases: None,
            ignore_unavailable: None,
            include_global_state: None,
            rename_pattern: None,
            rename_replacement: None,
            indices: None,
            partial: None,
            index_settings: None,
        }
    }
}