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
/*
* 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};
/// PutComponentTemplateRequestBodyJson
/// The template definition.
#[derive(Clone, Default, Debug, Serialize, Deserialize)]
pub struct PutComponentTemplateRequestBodyJson {
#[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
pub version: Option<u32>,
#[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")]
pub meta: Option<common::Metadata>,
/// This setting overrides the `action.auto_create_index` cluster setting.
/// When set to `true` in a component template, indexes are automatically created using that
/// template. When set to `false`, data streams matching the component template must always be explicitly created.
#[serde(
rename = "allow_auto_create",
default,
skip_serializing_if = "Option::is_none"
)]
pub allow_auto_create: Option<bool>,
#[serde(rename = "template")]
pub template: indices::IndexState,
}
impl PutComponentTemplateRequestBodyJson {
/// The template definition.
pub fn new(template: indices::IndexState) -> PutComponentTemplateRequestBodyJson {
PutComponentTemplateRequestBodyJson {
version: None,
meta: None,
allow_auto_create: None,
template,
}
}
}