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
65
66
67
68
69
70
71
/*
* 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};
/// IndexTemplate
/// New index template definition to be simulated, if no index template name is specified.
#[derive(Clone, Default, Debug, Serialize, Deserialize)]
pub struct IndexTemplate {
#[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")]
pub meta: Option<common::Metadata>,
#[serde(
rename = "data_stream",
default,
skip_serializing_if = "Option::is_none"
)]
pub data_stream: Option<indices::IndexTemplateDataStreamConfiguration>,
#[serde(rename = "template", default, skip_serializing_if = "Option::is_none")]
pub template: Option<indices::IndexTemplateSummary>,
#[serde(
rename = "allow_auto_create",
default,
skip_serializing_if = "Option::is_none"
)]
pub allow_auto_create: Option<bool>,
/// 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>,
/// 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>,
/// A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`.
#[serde(rename = "index_patterns")]
pub index_patterns: common::Names,
}
impl IndexTemplate {
/// New index template definition to be simulated, if no index template name is specified.
pub fn new(index_patterns: common::Names) -> IndexTemplate {
IndexTemplate {
meta: None,
data_stream: None,
template: None,
allow_auto_create: None,
priority: None,
composed_of: None,
version: None,
index_patterns,
}
}
}