1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* 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,
}
}
}