aws_sdk_qbusiness/operation/create_index/_create_index_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateIndexInput {
6 /// <p>The identifier of the Amazon Q Business application using the index.</p>
7 pub application_id: ::std::option::Option<::std::string::String>,
8 /// <p>A name for the Amazon Q Business index.</p>
9 pub display_name: ::std::option::Option<::std::string::String>,
10 /// <p>A description for the Amazon Q Business index.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>The index type that's suitable for your needs. For more information on what's included in each type of index, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers">Amazon Q Business tiers</a>.</p>
13 pub r#type: ::std::option::Option<crate::types::IndexType>,
14 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16 /// <p>The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.</p>
17 pub capacity_configuration: ::std::option::Option<crate::types::IndexCapacityConfiguration>,
18 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
19 pub client_token: ::std::option::Option<::std::string::String>,
20}
21impl CreateIndexInput {
22 /// <p>The identifier of the Amazon Q Business application using the index.</p>
23 pub fn application_id(&self) -> ::std::option::Option<&str> {
24 self.application_id.as_deref()
25 }
26 /// <p>A name for the Amazon Q Business index.</p>
27 pub fn display_name(&self) -> ::std::option::Option<&str> {
28 self.display_name.as_deref()
29 }
30 /// <p>A description for the Amazon Q Business index.</p>
31 pub fn description(&self) -> ::std::option::Option<&str> {
32 self.description.as_deref()
33 }
34 /// <p>The index type that's suitable for your needs. For more information on what's included in each type of index, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers">Amazon Q Business tiers</a>.</p>
35 pub fn r#type(&self) -> ::std::option::Option<&crate::types::IndexType> {
36 self.r#type.as_ref()
37 }
38 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
39 ///
40 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
41 pub fn tags(&self) -> &[crate::types::Tag] {
42 self.tags.as_deref().unwrap_or_default()
43 }
44 /// <p>The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.</p>
45 pub fn capacity_configuration(&self) -> ::std::option::Option<&crate::types::IndexCapacityConfiguration> {
46 self.capacity_configuration.as_ref()
47 }
48 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
49 pub fn client_token(&self) -> ::std::option::Option<&str> {
50 self.client_token.as_deref()
51 }
52}
53impl CreateIndexInput {
54 /// Creates a new builder-style object to manufacture [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
55 pub fn builder() -> crate::operation::create_index::builders::CreateIndexInputBuilder {
56 crate::operation::create_index::builders::CreateIndexInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateIndexInputBuilder {
64 pub(crate) application_id: ::std::option::Option<::std::string::String>,
65 pub(crate) display_name: ::std::option::Option<::std::string::String>,
66 pub(crate) description: ::std::option::Option<::std::string::String>,
67 pub(crate) r#type: ::std::option::Option<crate::types::IndexType>,
68 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
69 pub(crate) capacity_configuration: ::std::option::Option<crate::types::IndexCapacityConfiguration>,
70 pub(crate) client_token: ::std::option::Option<::std::string::String>,
71}
72impl CreateIndexInputBuilder {
73 /// <p>The identifier of the Amazon Q Business application using the index.</p>
74 /// This field is required.
75 pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.application_id = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The identifier of the Amazon Q Business application using the index.</p>
80 pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.application_id = input;
82 self
83 }
84 /// <p>The identifier of the Amazon Q Business application using the index.</p>
85 pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
86 &self.application_id
87 }
88 /// <p>A name for the Amazon Q Business index.</p>
89 /// This field is required.
90 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.display_name = ::std::option::Option::Some(input.into());
92 self
93 }
94 /// <p>A name for the Amazon Q Business index.</p>
95 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.display_name = input;
97 self
98 }
99 /// <p>A name for the Amazon Q Business index.</p>
100 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.display_name
102 }
103 /// <p>A description for the Amazon Q Business index.</p>
104 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105 self.description = ::std::option::Option::Some(input.into());
106 self
107 }
108 /// <p>A description for the Amazon Q Business index.</p>
109 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.description = input;
111 self
112 }
113 /// <p>A description for the Amazon Q Business index.</p>
114 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115 &self.description
116 }
117 /// <p>The index type that's suitable for your needs. For more information on what's included in each type of index, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers">Amazon Q Business tiers</a>.</p>
118 pub fn r#type(mut self, input: crate::types::IndexType) -> Self {
119 self.r#type = ::std::option::Option::Some(input);
120 self
121 }
122 /// <p>The index type that's suitable for your needs. For more information on what's included in each type of index, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers">Amazon Q Business tiers</a>.</p>
123 pub fn set_type(mut self, input: ::std::option::Option<crate::types::IndexType>) -> Self {
124 self.r#type = input;
125 self
126 }
127 /// <p>The index type that's suitable for your needs. For more information on what's included in each type of index, see <a href="https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers">Amazon Q Business tiers</a>.</p>
128 pub fn get_type(&self) -> &::std::option::Option<crate::types::IndexType> {
129 &self.r#type
130 }
131 /// Appends an item to `tags`.
132 ///
133 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
134 ///
135 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
136 pub fn tags(mut self, input: crate::types::Tag) -> Self {
137 let mut v = self.tags.unwrap_or_default();
138 v.push(input);
139 self.tags = ::std::option::Option::Some(v);
140 self
141 }
142 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
143 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
144 self.tags = input;
145 self
146 }
147 /// <p>A list of key-value pairs that identify or categorize the index. You can also use tags to help control access to the index. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.</p>
148 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
149 &self.tags
150 }
151 /// <p>The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.</p>
152 pub fn capacity_configuration(mut self, input: crate::types::IndexCapacityConfiguration) -> Self {
153 self.capacity_configuration = ::std::option::Option::Some(input);
154 self
155 }
156 /// <p>The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.</p>
157 pub fn set_capacity_configuration(mut self, input: ::std::option::Option<crate::types::IndexCapacityConfiguration>) -> Self {
158 self.capacity_configuration = input;
159 self
160 }
161 /// <p>The capacity units you want to provision for your index. You can add and remove capacity to fit your usage needs.</p>
162 pub fn get_capacity_configuration(&self) -> &::std::option::Option<crate::types::IndexCapacityConfiguration> {
163 &self.capacity_configuration
164 }
165 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
166 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.client_token = ::std::option::Option::Some(input.into());
168 self
169 }
170 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
171 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.client_token = input;
173 self
174 }
175 /// <p>A token that you provide to identify the request to create an index. Multiple calls to the <code>CreateIndex</code> API with the same client token will create only one index.</p>
176 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
177 &self.client_token
178 }
179 /// Consumes the builder and constructs a [`CreateIndexInput`](crate::operation::create_index::CreateIndexInput).
180 pub fn build(self) -> ::std::result::Result<crate::operation::create_index::CreateIndexInput, ::aws_smithy_types::error::operation::BuildError> {
181 ::std::result::Result::Ok(crate::operation::create_index::CreateIndexInput {
182 application_id: self.application_id,
183 display_name: self.display_name,
184 description: self.description,
185 r#type: self.r#type,
186 tags: self.tags,
187 capacity_configuration: self.capacity_configuration,
188 client_token: self.client_token,
189 })
190 }
191}