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

/// SimulateIndexTemplate
/// New index template definition, which will be included in the simulation, as if it already exists in the system

#[derive(Clone, Default, Debug, Serialize, Deserialize)]
pub struct SimulateIndexTemplate {
    /// 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 = "index_patterns",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub index_patterns: Option<common::Indices>,
    #[serde(rename = "template", default, skip_serializing_if = "Option::is_none")]
    pub template: Option<indices::put_index_template::IndexTemplateMapping>,
    #[serde(
        rename = "data_stream",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub data_stream: Option<indices::IndexTemplateDataStreamConfiguration>,
    /// An ordered list of component template names.
    /// Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence.
    #[serde(
        rename = "composed_of",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub composed_of: Option<Vec<String>>,
    #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
    pub version: Option<u32>,
    /// This setting overrides the value of the `action.auto_create_index` cluster setting.
    /// If set to `true` in a template, then indexes can be automatically created using that template even if auto-creation of indexes is disabled using `actions.auto_create_index`.
    /// If set to `false`, then indexes or data streams matching the template must always be explicitly created, and may never be automatically created.
    #[serde(
        rename = "allow_auto_create",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_auto_create: Option<bool>,
    #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")]
    pub meta: Option<common::Metadata>,
    /// Priority to determine index template precedence when a new data stream or index is created.
    /// The index template with the highest priority is chosen.
    /// If no priority is specified the template is treated as though it is of priority 0 (lowest priority).
    /// This number is not automatically generated by OpenSearch.
    #[serde(rename = "priority", default, skip_serializing_if = "Option::is_none")]
    pub priority: Option<u32>,
}

impl SimulateIndexTemplate {
    /// New index template definition, which will be included in the simulation, as if it already exists in the system
    pub fn new() -> SimulateIndexTemplate {
        SimulateIndexTemplate {
            index_patterns: None,
            template: None,
            data_stream: None,
            composed_of: None,
            version: None,
            allow_auto_create: None,
            meta: None,
            priority: None,
        }
    }
}