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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateIndexInput {
/// <p>The unique identifier of the collection in which to create the index.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).</p>
pub index_name: ::std::option::Option<::std::string::String>,
/// <p>The JSON schema definition for the index, including field mappings and settings.</p>
pub index_schema: ::std::option::Option<::aws_smithy_types::Document>,
}
impl CreateIndexInput {
/// <p>The unique identifier of the collection in which to create the index.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).</p>
pub fn index_name(&self) -> ::std::option::Option<&str> {
self.index_name.as_deref()
}
/// <p>The JSON schema definition for the index, including field mappings and settings.</p>
pub fn index_schema(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.index_schema.as_ref()
}
}
impl CreateIndexInput {
/// Creates a new builder-style object to manufacture [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
pub fn builder() -> crate::operation::create_index::builders::CreateIndexInputBuilder {
crate::operation::create_index::builders::CreateIndexInputBuilder::default()
}
}
/// A builder for [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateIndexInputBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) index_name: ::std::option::Option<::std::string::String>,
pub(crate) index_schema: ::std::option::Option<::aws_smithy_types::Document>,
}
impl CreateIndexInputBuilder {
/// <p>The unique identifier of the collection in which to create the index.</p>
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier of the collection in which to create the index.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The unique identifier of the collection in which to create the index.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).</p>
/// This field is required.
pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.index_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).</p>
pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.index_name = input;
self
}
/// <p>The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).</p>
pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
&self.index_name
}
/// <p>The JSON schema definition for the index, including field mappings and settings.</p>
pub fn index_schema(mut self, input: ::aws_smithy_types::Document) -> Self {
self.index_schema = ::std::option::Option::Some(input);
self
}
/// <p>The JSON schema definition for the index, including field mappings and settings.</p>
pub fn set_index_schema(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.index_schema = input;
self
}
/// <p>The JSON schema definition for the index, including field mappings and settings.</p>
pub fn get_index_schema(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.index_schema
}
/// Consumes the builder and constructs a [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
pub fn build(self) -> ::std::result::Result<crate::operation::create_index::CreateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_index::CreateIndexInput {
id: self.id,
index_name: self.index_name,
index_schema: self.index_schema,
})
}
}