Skip to main content

opensearch_client/indices/
put_alias.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use crate::common;
12use serde::{Deserialize, Serialize};
13
14/// PutAlias
15/// The settings for the alias, such as `routing` or `filter`
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct PutAlias {
19    #[serde(rename = "index", default, skip_serializing_if = "Option::is_none")]
20    pub index: Option<String>,
21    #[serde(
22        rename = "index_routing",
23        default,
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub index_routing: Option<String>,
27    #[serde(rename = "routing", default, skip_serializing_if = "Option::is_none")]
28    pub routing: Option<String>,
29    #[serde(rename = "filter", default, skip_serializing_if = "Option::is_none")]
30    pub filter: Option<crate::dsl::Query>,
31    /// If `true`, sets the write index or data stream for the alias.
32    /// If an alias points to multiple indexes or data streams and `is_write_index` isn't set, the alias rejects write requests.
33    /// If an index alias points to one index and `is_write_index` isn't set, the index automatically acts as the write index.
34    /// Data stream aliases don't automatically set a write data stream, even if the alias points to one data stream.
35    #[serde(
36        rename = "is_write_index",
37        default,
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub is_write_index: Option<bool>,
41    #[serde(
42        rename = "search_routing",
43        default,
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub search_routing: Option<String>,
47    #[serde(rename = "alias", default, skip_serializing_if = "Option::is_none")]
48    pub alias: Option<String>,
49}
50
51impl PutAlias {
52    /// The settings for the alias, such as `routing` or `filter`
53    pub fn new() -> PutAlias {
54        PutAlias {
55            index: None,
56            index_routing: None,
57            routing: None,
58            filter: None,
59            is_write_index: None,
60            search_routing: None,
61            alias: None,
62        }
63    }
64}