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