1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Identifies the version of a specific slot.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Slot {
/// <p>The name of the slot.</p>
pub name: ::std::string::String,
/// <p>A description of the slot.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>Specifies whether the slot is required or optional.</p>
pub slot_constraint: crate::types::SlotConstraint,
/// <p>The type of the slot, either a custom slot type that you defined or one of the built-in slot types.</p>
pub slot_type: ::std::option::Option<::std::string::String>,
/// <p>The version of the slot type.</p>
pub slot_type_version: ::std::option::Option<::std::string::String>,
/// <p>The prompt that Amazon Lex uses to elicit the slot value from the user.</p>
pub value_elicitation_prompt: ::std::option::Option<crate::types::Prompt>,
/// <p>Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.</p>
/// <p>If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.</p>
pub priority: ::std::option::Option<i32>,
/// <p>If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.</p>
pub sample_utterances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.</p>
pub response_card: ::std::option::Option<::std::string::String>,
/// <p>Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html"> Slot Obfuscation </a>.</p>
pub obfuscation_setting: ::std::option::Option<crate::types::ObfuscationSetting>,
/// <p>A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.</p>
pub default_value_spec: ::std::option::Option<crate::types::SlotDefaultValueSpec>,
}
impl Slot {
/// <p>The name of the slot.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>A description of the slot.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>Specifies whether the slot is required or optional.</p>
pub fn slot_constraint(&self) -> &crate::types::SlotConstraint {
&self.slot_constraint
}
/// <p>The type of the slot, either a custom slot type that you defined or one of the built-in slot types.</p>
pub fn slot_type(&self) -> ::std::option::Option<&str> {
self.slot_type.as_deref()
}
/// <p>The version of the slot type.</p>
pub fn slot_type_version(&self) -> ::std::option::Option<&str> {
self.slot_type_version.as_deref()
}
/// <p>The prompt that Amazon Lex uses to elicit the slot value from the user.</p>
pub fn value_elicitation_prompt(&self) -> ::std::option::Option<&crate::types::Prompt> {
self.value_elicitation_prompt.as_ref()
}
/// <p>Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.</p>
/// <p>If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.</p>
pub fn priority(&self) -> ::std::option::Option<i32> {
self.priority
}
/// <p>If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sample_utterances.is_none()`.
pub fn sample_utterances(&self) -> &[::std::string::String] {
self.sample_utterances.as_deref().unwrap_or_default()
}
/// <p>A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.</p>
pub fn response_card(&self) -> ::std::option::Option<&str> {
self.response_card.as_deref()
}
/// <p>Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html"> Slot Obfuscation </a>.</p>
pub fn obfuscation_setting(&self) -> ::std::option::Option<&crate::types::ObfuscationSetting> {
self.obfuscation_setting.as_ref()
}
/// <p>A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.</p>
pub fn default_value_spec(&self) -> ::std::option::Option<&crate::types::SlotDefaultValueSpec> {
self.default_value_spec.as_ref()
}
}
impl Slot {
/// Creates a new builder-style object to manufacture [`Slot`](crate::types::Slot).
pub fn builder() -> crate::types::builders::SlotBuilder {
crate::types::builders::SlotBuilder::default()
}
}
/// A builder for [`Slot`](crate::types::Slot).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SlotBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) slot_constraint: ::std::option::Option<crate::types::SlotConstraint>,
pub(crate) slot_type: ::std::option::Option<::std::string::String>,
pub(crate) slot_type_version: ::std::option::Option<::std::string::String>,
pub(crate) value_elicitation_prompt: ::std::option::Option<crate::types::Prompt>,
pub(crate) priority: ::std::option::Option<i32>,
pub(crate) sample_utterances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) response_card: ::std::option::Option<::std::string::String>,
pub(crate) obfuscation_setting: ::std::option::Option<crate::types::ObfuscationSetting>,
pub(crate) default_value_spec: ::std::option::Option<crate::types::SlotDefaultValueSpec>,
}
impl SlotBuilder {
/// <p>The name of the slot.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the slot.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the slot.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>A description of the slot.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the slot.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the slot.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>Specifies whether the slot is required or optional.</p>
/// This field is required.
pub fn slot_constraint(mut self, input: crate::types::SlotConstraint) -> Self {
self.slot_constraint = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether the slot is required or optional.</p>
pub fn set_slot_constraint(mut self, input: ::std::option::Option<crate::types::SlotConstraint>) -> Self {
self.slot_constraint = input;
self
}
/// <p>Specifies whether the slot is required or optional.</p>
pub fn get_slot_constraint(&self) -> &::std::option::Option<crate::types::SlotConstraint> {
&self.slot_constraint
}
/// <p>The type of the slot, either a custom slot type that you defined or one of the built-in slot types.</p>
pub fn slot_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.slot_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of the slot, either a custom slot type that you defined or one of the built-in slot types.</p>
pub fn set_slot_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.slot_type = input;
self
}
/// <p>The type of the slot, either a custom slot type that you defined or one of the built-in slot types.</p>
pub fn get_slot_type(&self) -> &::std::option::Option<::std::string::String> {
&self.slot_type
}
/// <p>The version of the slot type.</p>
pub fn slot_type_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.slot_type_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version of the slot type.</p>
pub fn set_slot_type_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.slot_type_version = input;
self
}
/// <p>The version of the slot type.</p>
pub fn get_slot_type_version(&self) -> &::std::option::Option<::std::string::String> {
&self.slot_type_version
}
/// <p>The prompt that Amazon Lex uses to elicit the slot value from the user.</p>
pub fn value_elicitation_prompt(mut self, input: crate::types::Prompt) -> Self {
self.value_elicitation_prompt = ::std::option::Option::Some(input);
self
}
/// <p>The prompt that Amazon Lex uses to elicit the slot value from the user.</p>
pub fn set_value_elicitation_prompt(mut self, input: ::std::option::Option<crate::types::Prompt>) -> Self {
self.value_elicitation_prompt = input;
self
}
/// <p>The prompt that Amazon Lex uses to elicit the slot value from the user.</p>
pub fn get_value_elicitation_prompt(&self) -> &::std::option::Option<crate::types::Prompt> {
&self.value_elicitation_prompt
}
/// <p>Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.</p>
/// <p>If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.</p>
pub fn priority(mut self, input: i32) -> Self {
self.priority = ::std::option::Option::Some(input);
self
}
/// <p>Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.</p>
/// <p>If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.</p>
pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
self.priority = input;
self
}
/// <p>Directs Amazon Lex the order in which to elicit this slot value from the user. For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex first elicits a value for the slot with priority 1.</p>
/// <p>If multiple slots share the same priority, the order in which Amazon Lex elicits values is arbitrary.</p>
pub fn get_priority(&self) -> &::std::option::Option<i32> {
&self.priority
}
/// Appends an item to `sample_utterances`.
///
/// To override the contents of this collection use [`set_sample_utterances`](Self::set_sample_utterances).
///
/// <p>If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.</p>
pub fn sample_utterances(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.sample_utterances.unwrap_or_default();
v.push(input.into());
self.sample_utterances = ::std::option::Option::Some(v);
self
}
/// <p>If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.</p>
pub fn set_sample_utterances(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.sample_utterances = input;
self
}
/// <p>If you know a specific pattern with which users might respond to an Amazon Lex request for a slot value, you can provide those utterances to improve accuracy. This is optional. In most cases, Amazon Lex is capable of understanding user utterances.</p>
pub fn get_sample_utterances(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.sample_utterances
}
/// <p>A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.</p>
pub fn response_card(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.response_card = ::std::option::Option::Some(input.into());
self
}
/// <p>A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.</p>
pub fn set_response_card(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.response_card = input;
self
}
/// <p>A set of possible responses for the slot type used by text-based clients. A user chooses an option from the response card, instead of using text to reply.</p>
pub fn get_response_card(&self) -> &::std::option::Option<::std::string::String> {
&self.response_card
}
/// <p>Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html"> Slot Obfuscation </a>.</p>
pub fn obfuscation_setting(mut self, input: crate::types::ObfuscationSetting) -> Self {
self.obfuscation_setting = ::std::option::Option::Some(input);
self
}
/// <p>Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html"> Slot Obfuscation </a>.</p>
pub fn set_obfuscation_setting(mut self, input: ::std::option::Option<crate::types::ObfuscationSetting>) -> Self {
self.obfuscation_setting = input;
self
}
/// <p>Determines whether a slot is obfuscated in conversation logs and stored utterances. When you obfuscate a slot, the value is replaced by the slot name in curly braces ({}). For example, if the slot name is "full_name", obfuscated values are replaced with "{full_name}". For more information, see <a href="https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html"> Slot Obfuscation </a>.</p>
pub fn get_obfuscation_setting(&self) -> &::std::option::Option<crate::types::ObfuscationSetting> {
&self.obfuscation_setting
}
/// <p>A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.</p>
pub fn default_value_spec(mut self, input: crate::types::SlotDefaultValueSpec) -> Self {
self.default_value_spec = ::std::option::Option::Some(input);
self
}
/// <p>A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.</p>
pub fn set_default_value_spec(mut self, input: ::std::option::Option<crate::types::SlotDefaultValueSpec>) -> Self {
self.default_value_spec = input;
self
}
/// <p>A list of default values for the slot. Default values are used when Amazon Lex hasn't determined a value for a slot. You can specify default values from context variables, session attributes, and defined values.</p>
pub fn get_default_value_spec(&self) -> &::std::option::Option<crate::types::SlotDefaultValueSpec> {
&self.default_value_spec
}
/// Consumes the builder and constructs a [`Slot`](crate::types::Slot).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::SlotBuilder::name)
/// - [`slot_constraint`](crate::types::builders::SlotBuilder::slot_constraint)
pub fn build(self) -> ::std::result::Result<crate::types::Slot, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Slot {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Slot",
)
})?,
description: self.description,
slot_constraint: self.slot_constraint.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"slot_constraint",
"slot_constraint was not specified but it is required when building Slot",
)
})?,
slot_type: self.slot_type,
slot_type_version: self.slot_type_version,
value_elicitation_prompt: self.value_elicitation_prompt,
priority: self.priority,
sample_utterances: self.sample_utterances,
response_card: self.response_card,
obfuscation_setting: self.obfuscation_setting,
default_value_spec: self.default_value_spec,
})
}
}