aws_sdk_lexmodelsv2/operation/create_slot/
_create_slot_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 CreateSlotInput {
6    /// <p>The name of the slot. Slot names must be unique within the bot that contains the slot.</p>
7    pub slot_name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the slot. Use this to help identify the slot in lists.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.</p>
11    pub slot_type_id: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.</p>
13    pub value_elicitation_setting: ::std::option::Option<crate::types::SlotValueElicitationSetting>,
14    /// <p>Determines how slot values are used in Amazon CloudWatch logs. If the value of the <code>obfuscationSetting</code> parameter is <code>DefaultObfuscation</code>, slot values are obfuscated in the log output. If the value is <code>None</code>, the actual value is present in the log output.</p>
15    /// <p>The default is to obfuscate values in the CloudWatch logs.</p>
16    pub obfuscation_setting: ::std::option::Option<crate::types::ObfuscationSetting>,
17    /// <p>The identifier of the bot associated with the slot.</p>
18    pub bot_id: ::std::option::Option<::std::string::String>,
19    /// <p>The version of the bot associated with the slot.</p>
20    pub bot_version: ::std::option::Option<::std::string::String>,
21    /// <p>The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
22    pub locale_id: ::std::option::Option<::std::string::String>,
23    /// <p>The identifier of the intent that contains the slot.</p>
24    pub intent_id: ::std::option::Option<::std::string::String>,
25    /// <p>Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the <code>en-US</code> locale. If you set this value to <code>true</code> in any other locale, Amazon Lex throws a <code>ValidationException</code>.</p>
26    /// <p>If the <code>multipleValuesSetting</code> is not set, the default value is <code>false</code>.</p>
27    pub multiple_values_setting: ::std::option::Option<crate::types::MultipleValuesSetting>,
28    /// <p>Specifications for the constituent sub slots and the expression for the composite slot.</p>
29    pub sub_slot_setting: ::std::option::Option<crate::types::SubSlotSetting>,
30}
31impl CreateSlotInput {
32    /// <p>The name of the slot. Slot names must be unique within the bot that contains the slot.</p>
33    pub fn slot_name(&self) -> ::std::option::Option<&str> {
34        self.slot_name.as_deref()
35    }
36    /// <p>A description of the slot. Use this to help identify the slot in lists.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.</p>
41    pub fn slot_type_id(&self) -> ::std::option::Option<&str> {
42        self.slot_type_id.as_deref()
43    }
44    /// <p>Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.</p>
45    pub fn value_elicitation_setting(&self) -> ::std::option::Option<&crate::types::SlotValueElicitationSetting> {
46        self.value_elicitation_setting.as_ref()
47    }
48    /// <p>Determines how slot values are used in Amazon CloudWatch logs. If the value of the <code>obfuscationSetting</code> parameter is <code>DefaultObfuscation</code>, slot values are obfuscated in the log output. If the value is <code>None</code>, the actual value is present in the log output.</p>
49    /// <p>The default is to obfuscate values in the CloudWatch logs.</p>
50    pub fn obfuscation_setting(&self) -> ::std::option::Option<&crate::types::ObfuscationSetting> {
51        self.obfuscation_setting.as_ref()
52    }
53    /// <p>The identifier of the bot associated with the slot.</p>
54    pub fn bot_id(&self) -> ::std::option::Option<&str> {
55        self.bot_id.as_deref()
56    }
57    /// <p>The version of the bot associated with the slot.</p>
58    pub fn bot_version(&self) -> ::std::option::Option<&str> {
59        self.bot_version.as_deref()
60    }
61    /// <p>The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
62    pub fn locale_id(&self) -> ::std::option::Option<&str> {
63        self.locale_id.as_deref()
64    }
65    /// <p>The identifier of the intent that contains the slot.</p>
66    pub fn intent_id(&self) -> ::std::option::Option<&str> {
67        self.intent_id.as_deref()
68    }
69    /// <p>Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the <code>en-US</code> locale. If you set this value to <code>true</code> in any other locale, Amazon Lex throws a <code>ValidationException</code>.</p>
70    /// <p>If the <code>multipleValuesSetting</code> is not set, the default value is <code>false</code>.</p>
71    pub fn multiple_values_setting(&self) -> ::std::option::Option<&crate::types::MultipleValuesSetting> {
72        self.multiple_values_setting.as_ref()
73    }
74    /// <p>Specifications for the constituent sub slots and the expression for the composite slot.</p>
75    pub fn sub_slot_setting(&self) -> ::std::option::Option<&crate::types::SubSlotSetting> {
76        self.sub_slot_setting.as_ref()
77    }
78}
79impl CreateSlotInput {
80    /// Creates a new builder-style object to manufacture [`CreateSlotInput`](crate::operation::create_slot::CreateSlotInput).
81    pub fn builder() -> crate::operation::create_slot::builders::CreateSlotInputBuilder {
82        crate::operation::create_slot::builders::CreateSlotInputBuilder::default()
83    }
84}
85
86/// A builder for [`CreateSlotInput`](crate::operation::create_slot::CreateSlotInput).
87#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
88#[non_exhaustive]
89pub struct CreateSlotInputBuilder {
90    pub(crate) slot_name: ::std::option::Option<::std::string::String>,
91    pub(crate) description: ::std::option::Option<::std::string::String>,
92    pub(crate) slot_type_id: ::std::option::Option<::std::string::String>,
93    pub(crate) value_elicitation_setting: ::std::option::Option<crate::types::SlotValueElicitationSetting>,
94    pub(crate) obfuscation_setting: ::std::option::Option<crate::types::ObfuscationSetting>,
95    pub(crate) bot_id: ::std::option::Option<::std::string::String>,
96    pub(crate) bot_version: ::std::option::Option<::std::string::String>,
97    pub(crate) locale_id: ::std::option::Option<::std::string::String>,
98    pub(crate) intent_id: ::std::option::Option<::std::string::String>,
99    pub(crate) multiple_values_setting: ::std::option::Option<crate::types::MultipleValuesSetting>,
100    pub(crate) sub_slot_setting: ::std::option::Option<crate::types::SubSlotSetting>,
101}
102impl CreateSlotInputBuilder {
103    /// <p>The name of the slot. Slot names must be unique within the bot that contains the slot.</p>
104    /// This field is required.
105    pub fn slot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.slot_name = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The name of the slot. Slot names must be unique within the bot that contains the slot.</p>
110    pub fn set_slot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.slot_name = input;
112        self
113    }
114    /// <p>The name of the slot. Slot names must be unique within the bot that contains the slot.</p>
115    pub fn get_slot_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.slot_name
117    }
118    /// <p>A description of the slot. Use this to help identify the slot in lists.</p>
119    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.description = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>A description of the slot. Use this to help identify the slot in lists.</p>
124    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.description = input;
126        self
127    }
128    /// <p>A description of the slot. Use this to help identify the slot in lists.</p>
129    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
130        &self.description
131    }
132    /// <p>The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.</p>
133    pub fn slot_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.slot_type_id = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.</p>
138    pub fn set_slot_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.slot_type_id = input;
140        self
141    }
142    /// <p>The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.</p>
143    pub fn get_slot_type_id(&self) -> &::std::option::Option<::std::string::String> {
144        &self.slot_type_id
145    }
146    /// <p>Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.</p>
147    /// This field is required.
148    pub fn value_elicitation_setting(mut self, input: crate::types::SlotValueElicitationSetting) -> Self {
149        self.value_elicitation_setting = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.</p>
153    pub fn set_value_elicitation_setting(mut self, input: ::std::option::Option<crate::types::SlotValueElicitationSetting>) -> Self {
154        self.value_elicitation_setting = input;
155        self
156    }
157    /// <p>Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.</p>
158    pub fn get_value_elicitation_setting(&self) -> &::std::option::Option<crate::types::SlotValueElicitationSetting> {
159        &self.value_elicitation_setting
160    }
161    /// <p>Determines how slot values are used in Amazon CloudWatch logs. If the value of the <code>obfuscationSetting</code> parameter is <code>DefaultObfuscation</code>, slot values are obfuscated in the log output. If the value is <code>None</code>, the actual value is present in the log output.</p>
162    /// <p>The default is to obfuscate values in the CloudWatch logs.</p>
163    pub fn obfuscation_setting(mut self, input: crate::types::ObfuscationSetting) -> Self {
164        self.obfuscation_setting = ::std::option::Option::Some(input);
165        self
166    }
167    /// <p>Determines how slot values are used in Amazon CloudWatch logs. If the value of the <code>obfuscationSetting</code> parameter is <code>DefaultObfuscation</code>, slot values are obfuscated in the log output. If the value is <code>None</code>, the actual value is present in the log output.</p>
168    /// <p>The default is to obfuscate values in the CloudWatch logs.</p>
169    pub fn set_obfuscation_setting(mut self, input: ::std::option::Option<crate::types::ObfuscationSetting>) -> Self {
170        self.obfuscation_setting = input;
171        self
172    }
173    /// <p>Determines how slot values are used in Amazon CloudWatch logs. If the value of the <code>obfuscationSetting</code> parameter is <code>DefaultObfuscation</code>, slot values are obfuscated in the log output. If the value is <code>None</code>, the actual value is present in the log output.</p>
174    /// <p>The default is to obfuscate values in the CloudWatch logs.</p>
175    pub fn get_obfuscation_setting(&self) -> &::std::option::Option<crate::types::ObfuscationSetting> {
176        &self.obfuscation_setting
177    }
178    /// <p>The identifier of the bot associated with the slot.</p>
179    /// This field is required.
180    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.bot_id = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// <p>The identifier of the bot associated with the slot.</p>
185    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.bot_id = input;
187        self
188    }
189    /// <p>The identifier of the bot associated with the slot.</p>
190    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
191        &self.bot_id
192    }
193    /// <p>The version of the bot associated with the slot.</p>
194    /// This field is required.
195    pub fn bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.bot_version = ::std::option::Option::Some(input.into());
197        self
198    }
199    /// <p>The version of the bot associated with the slot.</p>
200    pub fn set_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.bot_version = input;
202        self
203    }
204    /// <p>The version of the bot associated with the slot.</p>
205    pub fn get_bot_version(&self) -> &::std::option::Option<::std::string::String> {
206        &self.bot_version
207    }
208    /// <p>The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
209    /// This field is required.
210    pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.locale_id = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
215    pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.locale_id = input;
217        self
218    }
219    /// <p>The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
220    pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
221        &self.locale_id
222    }
223    /// <p>The identifier of the intent that contains the slot.</p>
224    /// This field is required.
225    pub fn intent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226        self.intent_id = ::std::option::Option::Some(input.into());
227        self
228    }
229    /// <p>The identifier of the intent that contains the slot.</p>
230    pub fn set_intent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231        self.intent_id = input;
232        self
233    }
234    /// <p>The identifier of the intent that contains the slot.</p>
235    pub fn get_intent_id(&self) -> &::std::option::Option<::std::string::String> {
236        &self.intent_id
237    }
238    /// <p>Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the <code>en-US</code> locale. If you set this value to <code>true</code> in any other locale, Amazon Lex throws a <code>ValidationException</code>.</p>
239    /// <p>If the <code>multipleValuesSetting</code> is not set, the default value is <code>false</code>.</p>
240    pub fn multiple_values_setting(mut self, input: crate::types::MultipleValuesSetting) -> Self {
241        self.multiple_values_setting = ::std::option::Option::Some(input);
242        self
243    }
244    /// <p>Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the <code>en-US</code> locale. If you set this value to <code>true</code> in any other locale, Amazon Lex throws a <code>ValidationException</code>.</p>
245    /// <p>If the <code>multipleValuesSetting</code> is not set, the default value is <code>false</code>.</p>
246    pub fn set_multiple_values_setting(mut self, input: ::std::option::Option<crate::types::MultipleValuesSetting>) -> Self {
247        self.multiple_values_setting = input;
248        self
249    }
250    /// <p>Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the <code>en-US</code> locale. If you set this value to <code>true</code> in any other locale, Amazon Lex throws a <code>ValidationException</code>.</p>
251    /// <p>If the <code>multipleValuesSetting</code> is not set, the default value is <code>false</code>.</p>
252    pub fn get_multiple_values_setting(&self) -> &::std::option::Option<crate::types::MultipleValuesSetting> {
253        &self.multiple_values_setting
254    }
255    /// <p>Specifications for the constituent sub slots and the expression for the composite slot.</p>
256    pub fn sub_slot_setting(mut self, input: crate::types::SubSlotSetting) -> Self {
257        self.sub_slot_setting = ::std::option::Option::Some(input);
258        self
259    }
260    /// <p>Specifications for the constituent sub slots and the expression for the composite slot.</p>
261    pub fn set_sub_slot_setting(mut self, input: ::std::option::Option<crate::types::SubSlotSetting>) -> Self {
262        self.sub_slot_setting = input;
263        self
264    }
265    /// <p>Specifications for the constituent sub slots and the expression for the composite slot.</p>
266    pub fn get_sub_slot_setting(&self) -> &::std::option::Option<crate::types::SubSlotSetting> {
267        &self.sub_slot_setting
268    }
269    /// Consumes the builder and constructs a [`CreateSlotInput`](crate::operation::create_slot::CreateSlotInput).
270    pub fn build(self) -> ::std::result::Result<crate::operation::create_slot::CreateSlotInput, ::aws_smithy_types::error::operation::BuildError> {
271        ::std::result::Result::Ok(crate::operation::create_slot::CreateSlotInput {
272            slot_name: self.slot_name,
273            description: self.description,
274            slot_type_id: self.slot_type_id,
275            value_elicitation_setting: self.value_elicitation_setting,
276            obfuscation_setting: self.obfuscation_setting,
277            bot_id: self.bot_id,
278            bot_version: self.bot_version,
279            locale_id: self.locale_id,
280            intent_id: self.intent_id,
281            multiple_values_setting: self.multiple_values_setting,
282            sub_slot_setting: self.sub_slot_setting,
283        })
284    }
285}