aws_sdk_lexmodelsv2/operation/create_bot/_create_bot_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 CreateBotInput {
6 /// <p>The name of the bot. The bot name must be unique in the account that creates the bot.</p>
7 pub bot_name: ::std::option::Option<::std::string::String>,
8 /// <p>A description of the bot. It appears in lists to help you identify a particular bot.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.</p>
11 pub role_arn: ::std::option::Option<::std::string::String>,
12 /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
13 pub data_privacy: ::std::option::Option<crate::types::DataPrivacy>,
14 /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
15 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p>
16 /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
17 pub idle_session_ttl_in_seconds: ::std::option::Option<i32>,
18 /// <p>A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the <code>UpdateBot</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>
19 pub bot_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20 /// <p>A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the <code>UpdateAlias</code> operation to update tags. To update tags on the test alias, use the <code>TagResource</code> operation.</p>
21 pub test_bot_alias_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22 /// <p>The type of a bot to create.</p>
23 pub bot_type: ::std::option::Option<crate::types::BotType>,
24 /// <p>The list of bot members in a network to be created.</p>
25 pub bot_members: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>,
26 /// <p>Specifies the configuration for error logging during bot creation.</p>
27 pub error_log_settings: ::std::option::Option<crate::types::ErrorLogSettings>,
28}
29impl CreateBotInput {
30 /// <p>The name of the bot. The bot name must be unique in the account that creates the bot.</p>
31 pub fn bot_name(&self) -> ::std::option::Option<&str> {
32 self.bot_name.as_deref()
33 }
34 /// <p>A description of the bot. It appears in lists to help you identify a particular bot.</p>
35 pub fn description(&self) -> ::std::option::Option<&str> {
36 self.description.as_deref()
37 }
38 /// <p>The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.</p>
39 pub fn role_arn(&self) -> ::std::option::Option<&str> {
40 self.role_arn.as_deref()
41 }
42 /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
43 pub fn data_privacy(&self) -> ::std::option::Option<&crate::types::DataPrivacy> {
44 self.data_privacy.as_ref()
45 }
46 /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
47 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p>
48 /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
49 pub fn idle_session_ttl_in_seconds(&self) -> ::std::option::Option<i32> {
50 self.idle_session_ttl_in_seconds
51 }
52 /// <p>A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the <code>UpdateBot</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>
53 pub fn bot_tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
54 self.bot_tags.as_ref()
55 }
56 /// <p>A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the <code>UpdateAlias</code> operation to update tags. To update tags on the test alias, use the <code>TagResource</code> operation.</p>
57 pub fn test_bot_alias_tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
58 self.test_bot_alias_tags.as_ref()
59 }
60 /// <p>The type of a bot to create.</p>
61 pub fn bot_type(&self) -> ::std::option::Option<&crate::types::BotType> {
62 self.bot_type.as_ref()
63 }
64 /// <p>The list of bot members in a network to be created.</p>
65 ///
66 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bot_members.is_none()`.
67 pub fn bot_members(&self) -> &[crate::types::BotMember] {
68 self.bot_members.as_deref().unwrap_or_default()
69 }
70 /// <p>Specifies the configuration for error logging during bot creation.</p>
71 pub fn error_log_settings(&self) -> ::std::option::Option<&crate::types::ErrorLogSettings> {
72 self.error_log_settings.as_ref()
73 }
74}
75impl CreateBotInput {
76 /// Creates a new builder-style object to manufacture [`CreateBotInput`](crate::operation::create_bot::CreateBotInput).
77 pub fn builder() -> crate::operation::create_bot::builders::CreateBotInputBuilder {
78 crate::operation::create_bot::builders::CreateBotInputBuilder::default()
79 }
80}
81
82/// A builder for [`CreateBotInput`](crate::operation::create_bot::CreateBotInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct CreateBotInputBuilder {
86 pub(crate) bot_name: ::std::option::Option<::std::string::String>,
87 pub(crate) description: ::std::option::Option<::std::string::String>,
88 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
89 pub(crate) data_privacy: ::std::option::Option<crate::types::DataPrivacy>,
90 pub(crate) idle_session_ttl_in_seconds: ::std::option::Option<i32>,
91 pub(crate) bot_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
92 pub(crate) test_bot_alias_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
93 pub(crate) bot_type: ::std::option::Option<crate::types::BotType>,
94 pub(crate) bot_members: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>,
95 pub(crate) error_log_settings: ::std::option::Option<crate::types::ErrorLogSettings>,
96}
97impl CreateBotInputBuilder {
98 /// <p>The name of the bot. The bot name must be unique in the account that creates the bot.</p>
99 /// This field is required.
100 pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.bot_name = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>The name of the bot. The bot name must be unique in the account that creates the bot.</p>
105 pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.bot_name = input;
107 self
108 }
109 /// <p>The name of the bot. The bot name must be unique in the account that creates the bot.</p>
110 pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
111 &self.bot_name
112 }
113 /// <p>A description of the bot. It appears in lists to help you identify a particular bot.</p>
114 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.description = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>A description of the bot. It appears in lists to help you identify a particular bot.</p>
119 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.description = input;
121 self
122 }
123 /// <p>A description of the bot. It appears in lists to help you identify a particular bot.</p>
124 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
125 &self.description
126 }
127 /// <p>The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.</p>
128 /// This field is required.
129 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.role_arn = ::std::option::Option::Some(input.into());
131 self
132 }
133 /// <p>The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.</p>
134 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.role_arn = input;
136 self
137 }
138 /// <p>The Amazon Resource Name (ARN) of an IAM role that has permission to access the bot.</p>
139 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
140 &self.role_arn
141 }
142 /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
143 /// This field is required.
144 pub fn data_privacy(mut self, input: crate::types::DataPrivacy) -> Self {
145 self.data_privacy = ::std::option::Option::Some(input);
146 self
147 }
148 /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
149 pub fn set_data_privacy(mut self, input: ::std::option::Option<crate::types::DataPrivacy>) -> Self {
150 self.data_privacy = input;
151 self
152 }
153 /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
154 pub fn get_data_privacy(&self) -> &::std::option::Option<crate::types::DataPrivacy> {
155 &self.data_privacy
156 }
157 /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
158 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p>
159 /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
160 /// This field is required.
161 pub fn idle_session_ttl_in_seconds(mut self, input: i32) -> Self {
162 self.idle_session_ttl_in_seconds = ::std::option::Option::Some(input);
163 self
164 }
165 /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
166 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p>
167 /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
168 pub fn set_idle_session_ttl_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
169 self.idle_session_ttl_in_seconds = input;
170 self
171 }
172 /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
173 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.</p>
174 /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
175 pub fn get_idle_session_ttl_in_seconds(&self) -> &::std::option::Option<i32> {
176 &self.idle_session_ttl_in_seconds
177 }
178 /// Adds a key-value pair to `bot_tags`.
179 ///
180 /// To override the contents of this collection use [`set_bot_tags`](Self::set_bot_tags).
181 ///
182 /// <p>A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the <code>UpdateBot</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>
183 pub fn bot_tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
184 let mut hash_map = self.bot_tags.unwrap_or_default();
185 hash_map.insert(k.into(), v.into());
186 self.bot_tags = ::std::option::Option::Some(hash_map);
187 self
188 }
189 /// <p>A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the <code>UpdateBot</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>
190 pub fn set_bot_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
191 self.bot_tags = input;
192 self
193 }
194 /// <p>A list of tags to add to the bot. You can only add tags when you create a bot. You can't use the <code>UpdateBot</code> operation to update tags. To update tags, use the <code>TagResource</code> operation.</p>
195 pub fn get_bot_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
196 &self.bot_tags
197 }
198 /// Adds a key-value pair to `test_bot_alias_tags`.
199 ///
200 /// To override the contents of this collection use [`set_test_bot_alias_tags`](Self::set_test_bot_alias_tags).
201 ///
202 /// <p>A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the <code>UpdateAlias</code> operation to update tags. To update tags on the test alias, use the <code>TagResource</code> operation.</p>
203 pub fn test_bot_alias_tags(
204 mut self,
205 k: impl ::std::convert::Into<::std::string::String>,
206 v: impl ::std::convert::Into<::std::string::String>,
207 ) -> Self {
208 let mut hash_map = self.test_bot_alias_tags.unwrap_or_default();
209 hash_map.insert(k.into(), v.into());
210 self.test_bot_alias_tags = ::std::option::Option::Some(hash_map);
211 self
212 }
213 /// <p>A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the <code>UpdateAlias</code> operation to update tags. To update tags on the test alias, use the <code>TagResource</code> operation.</p>
214 pub fn set_test_bot_alias_tags(
215 mut self,
216 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
217 ) -> Self {
218 self.test_bot_alias_tags = input;
219 self
220 }
221 /// <p>A list of tags to add to the test alias for a bot. You can only add tags when you create a bot. You can't use the <code>UpdateAlias</code> operation to update tags. To update tags on the test alias, use the <code>TagResource</code> operation.</p>
222 pub fn get_test_bot_alias_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
223 &self.test_bot_alias_tags
224 }
225 /// <p>The type of a bot to create.</p>
226 pub fn bot_type(mut self, input: crate::types::BotType) -> Self {
227 self.bot_type = ::std::option::Option::Some(input);
228 self
229 }
230 /// <p>The type of a bot to create.</p>
231 pub fn set_bot_type(mut self, input: ::std::option::Option<crate::types::BotType>) -> Self {
232 self.bot_type = input;
233 self
234 }
235 /// <p>The type of a bot to create.</p>
236 pub fn get_bot_type(&self) -> &::std::option::Option<crate::types::BotType> {
237 &self.bot_type
238 }
239 /// Appends an item to `bot_members`.
240 ///
241 /// To override the contents of this collection use [`set_bot_members`](Self::set_bot_members).
242 ///
243 /// <p>The list of bot members in a network to be created.</p>
244 pub fn bot_members(mut self, input: crate::types::BotMember) -> Self {
245 let mut v = self.bot_members.unwrap_or_default();
246 v.push(input);
247 self.bot_members = ::std::option::Option::Some(v);
248 self
249 }
250 /// <p>The list of bot members in a network to be created.</p>
251 pub fn set_bot_members(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>) -> Self {
252 self.bot_members = input;
253 self
254 }
255 /// <p>The list of bot members in a network to be created.</p>
256 pub fn get_bot_members(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BotMember>> {
257 &self.bot_members
258 }
259 /// <p>Specifies the configuration for error logging during bot creation.</p>
260 pub fn error_log_settings(mut self, input: crate::types::ErrorLogSettings) -> Self {
261 self.error_log_settings = ::std::option::Option::Some(input);
262 self
263 }
264 /// <p>Specifies the configuration for error logging during bot creation.</p>
265 pub fn set_error_log_settings(mut self, input: ::std::option::Option<crate::types::ErrorLogSettings>) -> Self {
266 self.error_log_settings = input;
267 self
268 }
269 /// <p>Specifies the configuration for error logging during bot creation.</p>
270 pub fn get_error_log_settings(&self) -> &::std::option::Option<crate::types::ErrorLogSettings> {
271 &self.error_log_settings
272 }
273 /// Consumes the builder and constructs a [`CreateBotInput`](crate::operation::create_bot::CreateBotInput).
274 pub fn build(self) -> ::std::result::Result<crate::operation::create_bot::CreateBotInput, ::aws_smithy_types::error::operation::BuildError> {
275 ::std::result::Result::Ok(crate::operation::create_bot::CreateBotInput {
276 bot_name: self.bot_name,
277 description: self.description,
278 role_arn: self.role_arn,
279 data_privacy: self.data_privacy,
280 idle_session_ttl_in_seconds: self.idle_session_ttl_in_seconds,
281 bot_tags: self.bot_tags,
282 test_bot_alias_tags: self.test_bot_alias_tags,
283 bot_type: self.bot_type,
284 bot_members: self.bot_members,
285 error_log_settings: self.error_log_settings,
286 })
287 }
288}