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

/// PutAlias
/// The settings for the alias, such as `routing` or `filter`

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PutAlias {
    #[serde(rename = "index", default, skip_serializing_if = "Option::is_none")]
    pub index: Option<String>,
    #[serde(
        rename = "index_routing",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub index_routing: Option<String>,
    #[serde(rename = "routing", default, skip_serializing_if = "Option::is_none")]
    pub routing: Option<String>,
    #[serde(rename = "filter", default, skip_serializing_if = "Option::is_none")]
    pub filter: Option<crate::dsl::Query>,
    /// If `true`, sets the write index or data stream for the alias.
    /// If an alias points to multiple indexes or data streams and `is_write_index` isn't set, the alias rejects write requests.
    /// If an index alias points to one index and `is_write_index` isn't set, the index automatically acts as the write index.
    /// Data stream aliases don't automatically set a write data stream, even if the alias points to one data stream.
    #[serde(
        rename = "is_write_index",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub is_write_index: Option<bool>,
    #[serde(
        rename = "search_routing",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub search_routing: Option<String>,
    #[serde(rename = "alias", default, skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
}

impl PutAlias {
    /// The settings for the alias, such as `routing` or `filter`
    pub fn new() -> PutAlias {
        PutAlias {
            index: None,
            index_routing: None,
            routing: None,
            filter: None,
            is_write_index: None,
            search_routing: None,
            alias: None,
        }
    }
}