aws_sdk_lexmodelsv2/operation/update_bot/
_update_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 UpdateBotInput {
6    /// <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
7    pub bot_id: ::std::option::Option<::std::string::String>,
8    /// <p>The new name of the bot. The name must be unique in the account that creates the bot.</p>
9    pub bot_name: ::std::option::Option<::std::string::String>,
10    /// <p>A description of the bot.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.</p>
13    pub role_arn: ::std::option::Option<::std::string::String>,
14    /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
15    pub data_privacy: ::std::option::Option<crate::types::DataPrivacy>,
16    /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
17    /// <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>
18    /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
19    pub idle_session_ttl_in_seconds: ::std::option::Option<i32>,
20    /// <p>The type of the bot to be updated.</p>
21    pub bot_type: ::std::option::Option<crate::types::BotType>,
22    /// <p>The list of bot members in the network associated with the update action.</p>
23    pub bot_members: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>,
24}
25impl UpdateBotInput {
26    /// <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
27    pub fn bot_id(&self) -> ::std::option::Option<&str> {
28        self.bot_id.as_deref()
29    }
30    /// <p>The new name of the bot. The 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.</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 permissions 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>The type of the bot to be updated.</p>
53    pub fn bot_type(&self) -> ::std::option::Option<&crate::types::BotType> {
54        self.bot_type.as_ref()
55    }
56    /// <p>The list of bot members in the network associated with the update action.</p>
57    ///
58    /// 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()`.
59    pub fn bot_members(&self) -> &[crate::types::BotMember] {
60        self.bot_members.as_deref().unwrap_or_default()
61    }
62}
63impl UpdateBotInput {
64    /// Creates a new builder-style object to manufacture [`UpdateBotInput`](crate::operation::update_bot::UpdateBotInput).
65    pub fn builder() -> crate::operation::update_bot::builders::UpdateBotInputBuilder {
66        crate::operation::update_bot::builders::UpdateBotInputBuilder::default()
67    }
68}
69
70/// A builder for [`UpdateBotInput`](crate::operation::update_bot::UpdateBotInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct UpdateBotInputBuilder {
74    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
75    pub(crate) bot_name: ::std::option::Option<::std::string::String>,
76    pub(crate) description: ::std::option::Option<::std::string::String>,
77    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
78    pub(crate) data_privacy: ::std::option::Option<crate::types::DataPrivacy>,
79    pub(crate) idle_session_ttl_in_seconds: ::std::option::Option<i32>,
80    pub(crate) bot_type: ::std::option::Option<crate::types::BotType>,
81    pub(crate) bot_members: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>,
82}
83impl UpdateBotInputBuilder {
84    /// <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
85    /// This field is required.
86    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.bot_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
91    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.bot_id = input;
93        self
94    }
95    /// <p>The unique identifier of the bot to update. This identifier is returned by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_CreateBot.html">CreateBot</a> operation.</p>
96    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.bot_id
98    }
99    /// <p>The new name of the bot. The name must be unique in the account that creates the bot.</p>
100    /// This field is required.
101    pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.bot_name = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The new name of the bot. The name must be unique in the account that creates the bot.</p>
106    pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.bot_name = input;
108        self
109    }
110    /// <p>The new name of the bot. The name must be unique in the account that creates the bot.</p>
111    pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
112        &self.bot_name
113    }
114    /// <p>A description of the bot.</p>
115    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.description = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>A description of the bot.</p>
120    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.description = input;
122        self
123    }
124    /// <p>A description of the bot.</p>
125    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
126        &self.description
127    }
128    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.</p>
129    /// This field is required.
130    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.role_arn = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.</p>
135    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.role_arn = input;
137        self
138    }
139    /// <p>The Amazon Resource Name (ARN) of an IAM role that has permissions to access the bot.</p>
140    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
141        &self.role_arn
142    }
143    /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
144    /// This field is required.
145    pub fn data_privacy(mut self, input: crate::types::DataPrivacy) -> Self {
146        self.data_privacy = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
150    pub fn set_data_privacy(mut self, input: ::std::option::Option<crate::types::DataPrivacy>) -> Self {
151        self.data_privacy = input;
152        self
153    }
154    /// <p>Provides information on additional privacy protections Amazon Lex should use with the bot's data.</p>
155    pub fn get_data_privacy(&self) -> &::std::option::Option<crate::types::DataPrivacy> {
156        &self.data_privacy
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    /// This field is required.
162    pub fn idle_session_ttl_in_seconds(mut self, input: i32) -> Self {
163        self.idle_session_ttl_in_seconds = ::std::option::Option::Some(input);
164        self
165    }
166    /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
167    /// <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>
168    /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
169    pub fn set_idle_session_ttl_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
170        self.idle_session_ttl_in_seconds = input;
171        self
172    }
173    /// <p>The time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot.</p>
174    /// <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>
175    /// <p>You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.</p>
176    pub fn get_idle_session_ttl_in_seconds(&self) -> &::std::option::Option<i32> {
177        &self.idle_session_ttl_in_seconds
178    }
179    /// <p>The type of the bot to be updated.</p>
180    pub fn bot_type(mut self, input: crate::types::BotType) -> Self {
181        self.bot_type = ::std::option::Option::Some(input);
182        self
183    }
184    /// <p>The type of the bot to be updated.</p>
185    pub fn set_bot_type(mut self, input: ::std::option::Option<crate::types::BotType>) -> Self {
186        self.bot_type = input;
187        self
188    }
189    /// <p>The type of the bot to be updated.</p>
190    pub fn get_bot_type(&self) -> &::std::option::Option<crate::types::BotType> {
191        &self.bot_type
192    }
193    /// Appends an item to `bot_members`.
194    ///
195    /// To override the contents of this collection use [`set_bot_members`](Self::set_bot_members).
196    ///
197    /// <p>The list of bot members in the network associated with the update action.</p>
198    pub fn bot_members(mut self, input: crate::types::BotMember) -> Self {
199        let mut v = self.bot_members.unwrap_or_default();
200        v.push(input);
201        self.bot_members = ::std::option::Option::Some(v);
202        self
203    }
204    /// <p>The list of bot members in the network associated with the update action.</p>
205    pub fn set_bot_members(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BotMember>>) -> Self {
206        self.bot_members = input;
207        self
208    }
209    /// <p>The list of bot members in the network associated with the update action.</p>
210    pub fn get_bot_members(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BotMember>> {
211        &self.bot_members
212    }
213    /// Consumes the builder and constructs a [`UpdateBotInput`](crate::operation::update_bot::UpdateBotInput).
214    pub fn build(self) -> ::std::result::Result<crate::operation::update_bot::UpdateBotInput, ::aws_smithy_types::error::operation::BuildError> {
215        ::std::result::Result::Ok(crate::operation::update_bot::UpdateBotInput {
216            bot_id: self.bot_id,
217            bot_name: self.bot_name,
218            description: self.description,
219            role_arn: self.role_arn,
220            data_privacy: self.data_privacy,
221            idle_session_ttl_in_seconds: self.idle_session_ttl_in_seconds,
222            bot_type: self.bot_type,
223            bot_members: self.bot_members,
224        })
225    }
226}