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

/// PutIndexTemplateRequestBodyJson
/// The template definition

#[derive(Clone, Default, Debug, Serialize, Deserialize)]
pub struct PutIndexTemplateRequestBodyJson {
    /// 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>,
    #[serde(rename = "template", default, skip_serializing_if = "Option::is_none")]
    pub template: Option<indices::put_index_template::IndexTemplateMapping>,
    #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
    pub version: Option<u32>,
    #[serde(
        rename = "data_stream",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub data_stream: Option<indices::IndexTemplateDataStreamConfiguration>,
    #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")]
    pub meta: Option<common::Metadata>,
    /// 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>>,
    /// 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>,
}

impl PutIndexTemplateRequestBodyJson {
    /// The template definition
    pub fn new() -> PutIndexTemplateRequestBodyJson {
        PutIndexTemplateRequestBodyJson {
            priority: None,
            template: None,
            version: None,
            data_stream: None,
            meta: None,
            composed_of: None,
            index_patterns: None,
        }
    }
}