aws_sdk_lexmodelsv2/operation/create_intent/_create_intent_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 CreateIntentInput {
6 /// <p>The name of the intent. Intent names must be unique in the locale that contains the intent and cannot match the name of any built-in intent.</p>
7 pub intent_name: ::std::option::Option<::std::string::String>,
8 /// <p>A description of the intent. Use the description to help identify the intent in lists.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>A unique identifier for the built-in intent to base this intent on.</p>
11 pub parent_intent_signature: ::std::option::Option<::std::string::String>,
12 /// <p>An array of strings that a user might say to signal the intent. For example, "I want a pizza", or "I want a {PizzaSize} pizza".</p>
13 /// <p>In an utterance, slot names are enclosed in curly braces ("{", "}") to indicate where they should be displayed in the utterance shown to the user..</p>
14 pub sample_utterances: ::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>>,
15 /// <p>Specifies that Amazon Lex invokes the alias Lambda function for each user input. You can invoke this Lambda function to personalize user interaction.</p>
16 /// <p>For example, suppose that your bot determines that the user's name is John. You Lambda function might retrieve John's information from a backend database and prepopulate some of the values. For example, if you find that John is gluten intolerant, you might set the corresponding intent slot, <code>glutenIntolerant</code> to <code>true</code>. You might find John's phone number and set the corresponding session attribute.</p>
17 pub dialog_code_hook: ::std::option::Option<crate::types::DialogCodeHookSettings>,
18 /// <p>Specifies that Amazon Lex invokes the alias Lambda function when the intent is ready for fulfillment. You can invoke this function to complete the bot's transaction with the user.</p>
19 /// <p>For example, in a pizza ordering bot, the Lambda function can look up the closest pizza restaurant to the customer's location and then place an order on the customer's behalf.</p>
20 pub fulfillment_code_hook: ::std::option::Option<crate::types::FulfillmentCodeHookSettings>,
21 /// <p>Provides prompts that Amazon Lex sends to the user to confirm the completion of an intent. If the user answers "no," the settings contain a statement that is sent to the user to end the intent.</p>
22 pub intent_confirmation_setting: ::std::option::Option<crate::types::IntentConfirmationSetting>,
23 /// <p>Sets the response that Amazon Lex sends to the user when the intent is closed.</p>
24 pub intent_closing_setting: ::std::option::Option<crate::types::IntentClosingSetting>,
25 /// <p>A list of contexts that must be active for this intent to be considered by Amazon Lex.</p>
26 /// <p>When an intent has an input context list, Amazon Lex only considers using the intent in an interaction with the user when the specified contexts are included in the active context list for the session. If the contexts are not active, then Amazon Lex will not use the intent.</p>
27 /// <p>A context can be automatically activated using the <code>outputContexts</code> property or it can be set at runtime.</p>
28 /// <p>For example, if there are two intents with different input contexts that respond to the same utterances, only the intent with the active context will respond.</p>
29 /// <p>An intent may have up to 5 input contexts. If an intent has multiple input contexts, all of the contexts must be active to consider the intent.</p>
30 pub input_contexts: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>,
31 /// <p>A lists of contexts that the intent activates when it is fulfilled.</p>
32 /// <p>You can use an output context to indicate the intents that Amazon Lex should consider for the next turn of the conversation with a customer.</p>
33 /// <p>When you use the <code>outputContextsList</code> property, all of the contexts specified in the list are activated when the intent is fulfilled. You can set up to 10 output contexts. You can also set the number of conversation turns that the context should be active, or the length of time that the context should be active.</p>
34 pub output_contexts: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>,
35 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. The <code>AMAZON.KendraSearchIntent</code> intent is called when Amazon Lex can't determine another intent to invoke.</p>
36 pub kendra_configuration: ::std::option::Option<crate::types::KendraConfiguration>,
37 /// <p>The identifier of the bot associated with this intent.</p>
38 pub bot_id: ::std::option::Option<::std::string::String>,
39 /// <p>The version of the bot associated with this intent.</p>
40 pub bot_version: ::std::option::Option<::std::string::String>,
41 /// <p>The identifier of the language and locale where this intent is used. All of the bots, slot types, and slots used by the intent 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>
42 pub locale_id: ::std::option::Option<::std::string::String>,
43 /// <p>Configuration settings for the response that is sent to the user at the beginning of a conversation, before eliciting slot values.</p>
44 pub initial_response_setting: ::std::option::Option<crate::types::InitialResponseSetting>,
45 /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
46 pub qn_a_intent_configuration: ::std::option::Option<crate::types::QnAIntentConfiguration>,
47}
48impl CreateIntentInput {
49 /// <p>The name of the intent. Intent names must be unique in the locale that contains the intent and cannot match the name of any built-in intent.</p>
50 pub fn intent_name(&self) -> ::std::option::Option<&str> {
51 self.intent_name.as_deref()
52 }
53 /// <p>A description of the intent. Use the description to help identify the intent in lists.</p>
54 pub fn description(&self) -> ::std::option::Option<&str> {
55 self.description.as_deref()
56 }
57 /// <p>A unique identifier for the built-in intent to base this intent on.</p>
58 pub fn parent_intent_signature(&self) -> ::std::option::Option<&str> {
59 self.parent_intent_signature.as_deref()
60 }
61 /// <p>An array of strings that a user might say to signal the intent. For example, "I want a pizza", or "I want a {PizzaSize} pizza".</p>
62 /// <p>In an utterance, slot names are enclosed in curly braces ("{", "}") to indicate where they should be displayed in the utterance shown to the user..</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 `.sample_utterances.is_none()`.
65 pub fn sample_utterances(&self) -> &[crate::types::SampleUtterance] {
66 self.sample_utterances.as_deref().unwrap_or_default()
67 }
68 /// <p>Specifies that Amazon Lex invokes the alias Lambda function for each user input. You can invoke this Lambda function to personalize user interaction.</p>
69 /// <p>For example, suppose that your bot determines that the user's name is John. You Lambda function might retrieve John's information from a backend database and prepopulate some of the values. For example, if you find that John is gluten intolerant, you might set the corresponding intent slot, <code>glutenIntolerant</code> to <code>true</code>. You might find John's phone number and set the corresponding session attribute.</p>
70 pub fn dialog_code_hook(&self) -> ::std::option::Option<&crate::types::DialogCodeHookSettings> {
71 self.dialog_code_hook.as_ref()
72 }
73 /// <p>Specifies that Amazon Lex invokes the alias Lambda function when the intent is ready for fulfillment. You can invoke this function to complete the bot's transaction with the user.</p>
74 /// <p>For example, in a pizza ordering bot, the Lambda function can look up the closest pizza restaurant to the customer's location and then place an order on the customer's behalf.</p>
75 pub fn fulfillment_code_hook(&self) -> ::std::option::Option<&crate::types::FulfillmentCodeHookSettings> {
76 self.fulfillment_code_hook.as_ref()
77 }
78 /// <p>Provides prompts that Amazon Lex sends to the user to confirm the completion of an intent. If the user answers "no," the settings contain a statement that is sent to the user to end the intent.</p>
79 pub fn intent_confirmation_setting(&self) -> ::std::option::Option<&crate::types::IntentConfirmationSetting> {
80 self.intent_confirmation_setting.as_ref()
81 }
82 /// <p>Sets the response that Amazon Lex sends to the user when the intent is closed.</p>
83 pub fn intent_closing_setting(&self) -> ::std::option::Option<&crate::types::IntentClosingSetting> {
84 self.intent_closing_setting.as_ref()
85 }
86 /// <p>A list of contexts that must be active for this intent to be considered by Amazon Lex.</p>
87 /// <p>When an intent has an input context list, Amazon Lex only considers using the intent in an interaction with the user when the specified contexts are included in the active context list for the session. If the contexts are not active, then Amazon Lex will not use the intent.</p>
88 /// <p>A context can be automatically activated using the <code>outputContexts</code> property or it can be set at runtime.</p>
89 /// <p>For example, if there are two intents with different input contexts that respond to the same utterances, only the intent with the active context will respond.</p>
90 /// <p>An intent may have up to 5 input contexts. If an intent has multiple input contexts, all of the contexts must be active to consider the intent.</p>
91 ///
92 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.input_contexts.is_none()`.
93 pub fn input_contexts(&self) -> &[crate::types::InputContext] {
94 self.input_contexts.as_deref().unwrap_or_default()
95 }
96 /// <p>A lists of contexts that the intent activates when it is fulfilled.</p>
97 /// <p>You can use an output context to indicate the intents that Amazon Lex should consider for the next turn of the conversation with a customer.</p>
98 /// <p>When you use the <code>outputContextsList</code> property, all of the contexts specified in the list are activated when the intent is fulfilled. You can set up to 10 output contexts. You can also set the number of conversation turns that the context should be active, or the length of time that the context should be active.</p>
99 ///
100 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.output_contexts.is_none()`.
101 pub fn output_contexts(&self) -> &[crate::types::OutputContext] {
102 self.output_contexts.as_deref().unwrap_or_default()
103 }
104 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. The <code>AMAZON.KendraSearchIntent</code> intent is called when Amazon Lex can't determine another intent to invoke.</p>
105 pub fn kendra_configuration(&self) -> ::std::option::Option<&crate::types::KendraConfiguration> {
106 self.kendra_configuration.as_ref()
107 }
108 /// <p>The identifier of the bot associated with this intent.</p>
109 pub fn bot_id(&self) -> ::std::option::Option<&str> {
110 self.bot_id.as_deref()
111 }
112 /// <p>The version of the bot associated with this intent.</p>
113 pub fn bot_version(&self) -> ::std::option::Option<&str> {
114 self.bot_version.as_deref()
115 }
116 /// <p>The identifier of the language and locale where this intent is used. All of the bots, slot types, and slots used by the intent 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>
117 pub fn locale_id(&self) -> ::std::option::Option<&str> {
118 self.locale_id.as_deref()
119 }
120 /// <p>Configuration settings for the response that is sent to the user at the beginning of a conversation, before eliciting slot values.</p>
121 pub fn initial_response_setting(&self) -> ::std::option::Option<&crate::types::InitialResponseSetting> {
122 self.initial_response_setting.as_ref()
123 }
124 /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
125 pub fn qn_a_intent_configuration(&self) -> ::std::option::Option<&crate::types::QnAIntentConfiguration> {
126 self.qn_a_intent_configuration.as_ref()
127 }
128}
129impl CreateIntentInput {
130 /// Creates a new builder-style object to manufacture [`CreateIntentInput`](crate::operation::create_intent::CreateIntentInput).
131 pub fn builder() -> crate::operation::create_intent::builders::CreateIntentInputBuilder {
132 crate::operation::create_intent::builders::CreateIntentInputBuilder::default()
133 }
134}
135
136/// A builder for [`CreateIntentInput`](crate::operation::create_intent::CreateIntentInput).
137#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
138#[non_exhaustive]
139pub struct CreateIntentInputBuilder {
140 pub(crate) intent_name: ::std::option::Option<::std::string::String>,
141 pub(crate) description: ::std::option::Option<::std::string::String>,
142 pub(crate) parent_intent_signature: ::std::option::Option<::std::string::String>,
143 pub(crate) sample_utterances: ::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>>,
144 pub(crate) dialog_code_hook: ::std::option::Option<crate::types::DialogCodeHookSettings>,
145 pub(crate) fulfillment_code_hook: ::std::option::Option<crate::types::FulfillmentCodeHookSettings>,
146 pub(crate) intent_confirmation_setting: ::std::option::Option<crate::types::IntentConfirmationSetting>,
147 pub(crate) intent_closing_setting: ::std::option::Option<crate::types::IntentClosingSetting>,
148 pub(crate) input_contexts: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>,
149 pub(crate) output_contexts: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>,
150 pub(crate) kendra_configuration: ::std::option::Option<crate::types::KendraConfiguration>,
151 pub(crate) bot_id: ::std::option::Option<::std::string::String>,
152 pub(crate) bot_version: ::std::option::Option<::std::string::String>,
153 pub(crate) locale_id: ::std::option::Option<::std::string::String>,
154 pub(crate) initial_response_setting: ::std::option::Option<crate::types::InitialResponseSetting>,
155 pub(crate) qn_a_intent_configuration: ::std::option::Option<crate::types::QnAIntentConfiguration>,
156}
157impl CreateIntentInputBuilder {
158 /// <p>The name of the intent. Intent names must be unique in the locale that contains the intent and cannot match the name of any built-in intent.</p>
159 /// This field is required.
160 pub fn intent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.intent_name = ::std::option::Option::Some(input.into());
162 self
163 }
164 /// <p>The name of the intent. Intent names must be unique in the locale that contains the intent and cannot match the name of any built-in intent.</p>
165 pub fn set_intent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.intent_name = input;
167 self
168 }
169 /// <p>The name of the intent. Intent names must be unique in the locale that contains the intent and cannot match the name of any built-in intent.</p>
170 pub fn get_intent_name(&self) -> &::std::option::Option<::std::string::String> {
171 &self.intent_name
172 }
173 /// <p>A description of the intent. Use the description to help identify the intent in lists.</p>
174 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.description = ::std::option::Option::Some(input.into());
176 self
177 }
178 /// <p>A description of the intent. Use the description to help identify the intent in lists.</p>
179 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.description = input;
181 self
182 }
183 /// <p>A description of the intent. Use the description to help identify the intent in lists.</p>
184 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
185 &self.description
186 }
187 /// <p>A unique identifier for the built-in intent to base this intent on.</p>
188 pub fn parent_intent_signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.parent_intent_signature = ::std::option::Option::Some(input.into());
190 self
191 }
192 /// <p>A unique identifier for the built-in intent to base this intent on.</p>
193 pub fn set_parent_intent_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.parent_intent_signature = input;
195 self
196 }
197 /// <p>A unique identifier for the built-in intent to base this intent on.</p>
198 pub fn get_parent_intent_signature(&self) -> &::std::option::Option<::std::string::String> {
199 &self.parent_intent_signature
200 }
201 /// Appends an item to `sample_utterances`.
202 ///
203 /// To override the contents of this collection use [`set_sample_utterances`](Self::set_sample_utterances).
204 ///
205 /// <p>An array of strings that a user might say to signal the intent. For example, "I want a pizza", or "I want a {PizzaSize} pizza".</p>
206 /// <p>In an utterance, slot names are enclosed in curly braces ("{", "}") to indicate where they should be displayed in the utterance shown to the user..</p>
207 pub fn sample_utterances(mut self, input: crate::types::SampleUtterance) -> Self {
208 let mut v = self.sample_utterances.unwrap_or_default();
209 v.push(input);
210 self.sample_utterances = ::std::option::Option::Some(v);
211 self
212 }
213 /// <p>An array of strings that a user might say to signal the intent. For example, "I want a pizza", or "I want a {PizzaSize} pizza".</p>
214 /// <p>In an utterance, slot names are enclosed in curly braces ("{", "}") to indicate where they should be displayed in the utterance shown to the user..</p>
215 pub fn set_sample_utterances(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>>) -> Self {
216 self.sample_utterances = input;
217 self
218 }
219 /// <p>An array of strings that a user might say to signal the intent. For example, "I want a pizza", or "I want a {PizzaSize} pizza".</p>
220 /// <p>In an utterance, slot names are enclosed in curly braces ("{", "}") to indicate where they should be displayed in the utterance shown to the user..</p>
221 pub fn get_sample_utterances(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>> {
222 &self.sample_utterances
223 }
224 /// <p>Specifies that Amazon Lex invokes the alias Lambda function for each user input. You can invoke this Lambda function to personalize user interaction.</p>
225 /// <p>For example, suppose that your bot determines that the user's name is John. You Lambda function might retrieve John's information from a backend database and prepopulate some of the values. For example, if you find that John is gluten intolerant, you might set the corresponding intent slot, <code>glutenIntolerant</code> to <code>true</code>. You might find John's phone number and set the corresponding session attribute.</p>
226 pub fn dialog_code_hook(mut self, input: crate::types::DialogCodeHookSettings) -> Self {
227 self.dialog_code_hook = ::std::option::Option::Some(input);
228 self
229 }
230 /// <p>Specifies that Amazon Lex invokes the alias Lambda function for each user input. You can invoke this Lambda function to personalize user interaction.</p>
231 /// <p>For example, suppose that your bot determines that the user's name is John. You Lambda function might retrieve John's information from a backend database and prepopulate some of the values. For example, if you find that John is gluten intolerant, you might set the corresponding intent slot, <code>glutenIntolerant</code> to <code>true</code>. You might find John's phone number and set the corresponding session attribute.</p>
232 pub fn set_dialog_code_hook(mut self, input: ::std::option::Option<crate::types::DialogCodeHookSettings>) -> Self {
233 self.dialog_code_hook = input;
234 self
235 }
236 /// <p>Specifies that Amazon Lex invokes the alias Lambda function for each user input. You can invoke this Lambda function to personalize user interaction.</p>
237 /// <p>For example, suppose that your bot determines that the user's name is John. You Lambda function might retrieve John's information from a backend database and prepopulate some of the values. For example, if you find that John is gluten intolerant, you might set the corresponding intent slot, <code>glutenIntolerant</code> to <code>true</code>. You might find John's phone number and set the corresponding session attribute.</p>
238 pub fn get_dialog_code_hook(&self) -> &::std::option::Option<crate::types::DialogCodeHookSettings> {
239 &self.dialog_code_hook
240 }
241 /// <p>Specifies that Amazon Lex invokes the alias Lambda function when the intent is ready for fulfillment. You can invoke this function to complete the bot's transaction with the user.</p>
242 /// <p>For example, in a pizza ordering bot, the Lambda function can look up the closest pizza restaurant to the customer's location and then place an order on the customer's behalf.</p>
243 pub fn fulfillment_code_hook(mut self, input: crate::types::FulfillmentCodeHookSettings) -> Self {
244 self.fulfillment_code_hook = ::std::option::Option::Some(input);
245 self
246 }
247 /// <p>Specifies that Amazon Lex invokes the alias Lambda function when the intent is ready for fulfillment. You can invoke this function to complete the bot's transaction with the user.</p>
248 /// <p>For example, in a pizza ordering bot, the Lambda function can look up the closest pizza restaurant to the customer's location and then place an order on the customer's behalf.</p>
249 pub fn set_fulfillment_code_hook(mut self, input: ::std::option::Option<crate::types::FulfillmentCodeHookSettings>) -> Self {
250 self.fulfillment_code_hook = input;
251 self
252 }
253 /// <p>Specifies that Amazon Lex invokes the alias Lambda function when the intent is ready for fulfillment. You can invoke this function to complete the bot's transaction with the user.</p>
254 /// <p>For example, in a pizza ordering bot, the Lambda function can look up the closest pizza restaurant to the customer's location and then place an order on the customer's behalf.</p>
255 pub fn get_fulfillment_code_hook(&self) -> &::std::option::Option<crate::types::FulfillmentCodeHookSettings> {
256 &self.fulfillment_code_hook
257 }
258 /// <p>Provides prompts that Amazon Lex sends to the user to confirm the completion of an intent. If the user answers "no," the settings contain a statement that is sent to the user to end the intent.</p>
259 pub fn intent_confirmation_setting(mut self, input: crate::types::IntentConfirmationSetting) -> Self {
260 self.intent_confirmation_setting = ::std::option::Option::Some(input);
261 self
262 }
263 /// <p>Provides prompts that Amazon Lex sends to the user to confirm the completion of an intent. If the user answers "no," the settings contain a statement that is sent to the user to end the intent.</p>
264 pub fn set_intent_confirmation_setting(mut self, input: ::std::option::Option<crate::types::IntentConfirmationSetting>) -> Self {
265 self.intent_confirmation_setting = input;
266 self
267 }
268 /// <p>Provides prompts that Amazon Lex sends to the user to confirm the completion of an intent. If the user answers "no," the settings contain a statement that is sent to the user to end the intent.</p>
269 pub fn get_intent_confirmation_setting(&self) -> &::std::option::Option<crate::types::IntentConfirmationSetting> {
270 &self.intent_confirmation_setting
271 }
272 /// <p>Sets the response that Amazon Lex sends to the user when the intent is closed.</p>
273 pub fn intent_closing_setting(mut self, input: crate::types::IntentClosingSetting) -> Self {
274 self.intent_closing_setting = ::std::option::Option::Some(input);
275 self
276 }
277 /// <p>Sets the response that Amazon Lex sends to the user when the intent is closed.</p>
278 pub fn set_intent_closing_setting(mut self, input: ::std::option::Option<crate::types::IntentClosingSetting>) -> Self {
279 self.intent_closing_setting = input;
280 self
281 }
282 /// <p>Sets the response that Amazon Lex sends to the user when the intent is closed.</p>
283 pub fn get_intent_closing_setting(&self) -> &::std::option::Option<crate::types::IntentClosingSetting> {
284 &self.intent_closing_setting
285 }
286 /// Appends an item to `input_contexts`.
287 ///
288 /// To override the contents of this collection use [`set_input_contexts`](Self::set_input_contexts).
289 ///
290 /// <p>A list of contexts that must be active for this intent to be considered by Amazon Lex.</p>
291 /// <p>When an intent has an input context list, Amazon Lex only considers using the intent in an interaction with the user when the specified contexts are included in the active context list for the session. If the contexts are not active, then Amazon Lex will not use the intent.</p>
292 /// <p>A context can be automatically activated using the <code>outputContexts</code> property or it can be set at runtime.</p>
293 /// <p>For example, if there are two intents with different input contexts that respond to the same utterances, only the intent with the active context will respond.</p>
294 /// <p>An intent may have up to 5 input contexts. If an intent has multiple input contexts, all of the contexts must be active to consider the intent.</p>
295 pub fn input_contexts(mut self, input: crate::types::InputContext) -> Self {
296 let mut v = self.input_contexts.unwrap_or_default();
297 v.push(input);
298 self.input_contexts = ::std::option::Option::Some(v);
299 self
300 }
301 /// <p>A list of contexts that must be active for this intent to be considered by Amazon Lex.</p>
302 /// <p>When an intent has an input context list, Amazon Lex only considers using the intent in an interaction with the user when the specified contexts are included in the active context list for the session. If the contexts are not active, then Amazon Lex will not use the intent.</p>
303 /// <p>A context can be automatically activated using the <code>outputContexts</code> property or it can be set at runtime.</p>
304 /// <p>For example, if there are two intents with different input contexts that respond to the same utterances, only the intent with the active context will respond.</p>
305 /// <p>An intent may have up to 5 input contexts. If an intent has multiple input contexts, all of the contexts must be active to consider the intent.</p>
306 pub fn set_input_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>) -> Self {
307 self.input_contexts = input;
308 self
309 }
310 /// <p>A list of contexts that must be active for this intent to be considered by Amazon Lex.</p>
311 /// <p>When an intent has an input context list, Amazon Lex only considers using the intent in an interaction with the user when the specified contexts are included in the active context list for the session. If the contexts are not active, then Amazon Lex will not use the intent.</p>
312 /// <p>A context can be automatically activated using the <code>outputContexts</code> property or it can be set at runtime.</p>
313 /// <p>For example, if there are two intents with different input contexts that respond to the same utterances, only the intent with the active context will respond.</p>
314 /// <p>An intent may have up to 5 input contexts. If an intent has multiple input contexts, all of the contexts must be active to consider the intent.</p>
315 pub fn get_input_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InputContext>> {
316 &self.input_contexts
317 }
318 /// Appends an item to `output_contexts`.
319 ///
320 /// To override the contents of this collection use [`set_output_contexts`](Self::set_output_contexts).
321 ///
322 /// <p>A lists of contexts that the intent activates when it is fulfilled.</p>
323 /// <p>You can use an output context to indicate the intents that Amazon Lex should consider for the next turn of the conversation with a customer.</p>
324 /// <p>When you use the <code>outputContextsList</code> property, all of the contexts specified in the list are activated when the intent is fulfilled. You can set up to 10 output contexts. You can also set the number of conversation turns that the context should be active, or the length of time that the context should be active.</p>
325 pub fn output_contexts(mut self, input: crate::types::OutputContext) -> Self {
326 let mut v = self.output_contexts.unwrap_or_default();
327 v.push(input);
328 self.output_contexts = ::std::option::Option::Some(v);
329 self
330 }
331 /// <p>A lists of contexts that the intent activates when it is fulfilled.</p>
332 /// <p>You can use an output context to indicate the intents that Amazon Lex should consider for the next turn of the conversation with a customer.</p>
333 /// <p>When you use the <code>outputContextsList</code> property, all of the contexts specified in the list are activated when the intent is fulfilled. You can set up to 10 output contexts. You can also set the number of conversation turns that the context should be active, or the length of time that the context should be active.</p>
334 pub fn set_output_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>) -> Self {
335 self.output_contexts = input;
336 self
337 }
338 /// <p>A lists of contexts that the intent activates when it is fulfilled.</p>
339 /// <p>You can use an output context to indicate the intents that Amazon Lex should consider for the next turn of the conversation with a customer.</p>
340 /// <p>When you use the <code>outputContextsList</code> property, all of the contexts specified in the list are activated when the intent is fulfilled. You can set up to 10 output contexts. You can also set the number of conversation turns that the context should be active, or the length of time that the context should be active.</p>
341 pub fn get_output_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OutputContext>> {
342 &self.output_contexts
343 }
344 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. The <code>AMAZON.KendraSearchIntent</code> intent is called when Amazon Lex can't determine another intent to invoke.</p>
345 pub fn kendra_configuration(mut self, input: crate::types::KendraConfiguration) -> Self {
346 self.kendra_configuration = ::std::option::Option::Some(input);
347 self
348 }
349 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. The <code>AMAZON.KendraSearchIntent</code> intent is called when Amazon Lex can't determine another intent to invoke.</p>
350 pub fn set_kendra_configuration(mut self, input: ::std::option::Option<crate::types::KendraConfiguration>) -> Self {
351 self.kendra_configuration = input;
352 self
353 }
354 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. The <code>AMAZON.KendraSearchIntent</code> intent is called when Amazon Lex can't determine another intent to invoke.</p>
355 pub fn get_kendra_configuration(&self) -> &::std::option::Option<crate::types::KendraConfiguration> {
356 &self.kendra_configuration
357 }
358 /// <p>The identifier of the bot associated with this intent.</p>
359 /// This field is required.
360 pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361 self.bot_id = ::std::option::Option::Some(input.into());
362 self
363 }
364 /// <p>The identifier of the bot associated with this intent.</p>
365 pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
366 self.bot_id = input;
367 self
368 }
369 /// <p>The identifier of the bot associated with this intent.</p>
370 pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
371 &self.bot_id
372 }
373 /// <p>The version of the bot associated with this intent.</p>
374 /// This field is required.
375 pub fn bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
376 self.bot_version = ::std::option::Option::Some(input.into());
377 self
378 }
379 /// <p>The version of the bot associated with this intent.</p>
380 pub fn set_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
381 self.bot_version = input;
382 self
383 }
384 /// <p>The version of the bot associated with this intent.</p>
385 pub fn get_bot_version(&self) -> &::std::option::Option<::std::string::String> {
386 &self.bot_version
387 }
388 /// <p>The identifier of the language and locale where this intent is used. All of the bots, slot types, and slots used by the intent 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>
389 /// This field is required.
390 pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
391 self.locale_id = ::std::option::Option::Some(input.into());
392 self
393 }
394 /// <p>The identifier of the language and locale where this intent is used. All of the bots, slot types, and slots used by the intent 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>
395 pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
396 self.locale_id = input;
397 self
398 }
399 /// <p>The identifier of the language and locale where this intent is used. All of the bots, slot types, and slots used by the intent 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>
400 pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
401 &self.locale_id
402 }
403 /// <p>Configuration settings for the response that is sent to the user at the beginning of a conversation, before eliciting slot values.</p>
404 pub fn initial_response_setting(mut self, input: crate::types::InitialResponseSetting) -> Self {
405 self.initial_response_setting = ::std::option::Option::Some(input);
406 self
407 }
408 /// <p>Configuration settings for the response that is sent to the user at the beginning of a conversation, before eliciting slot values.</p>
409 pub fn set_initial_response_setting(mut self, input: ::std::option::Option<crate::types::InitialResponseSetting>) -> Self {
410 self.initial_response_setting = input;
411 self
412 }
413 /// <p>Configuration settings for the response that is sent to the user at the beginning of a conversation, before eliciting slot values.</p>
414 pub fn get_initial_response_setting(&self) -> &::std::option::Option<crate::types::InitialResponseSetting> {
415 &self.initial_response_setting
416 }
417 /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
418 pub fn qn_a_intent_configuration(mut self, input: crate::types::QnAIntentConfiguration) -> Self {
419 self.qn_a_intent_configuration = ::std::option::Option::Some(input);
420 self
421 }
422 /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
423 pub fn set_qn_a_intent_configuration(mut self, input: ::std::option::Option<crate::types::QnAIntentConfiguration>) -> Self {
424 self.qn_a_intent_configuration = input;
425 self
426 }
427 /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
428 pub fn get_qn_a_intent_configuration(&self) -> &::std::option::Option<crate::types::QnAIntentConfiguration> {
429 &self.qn_a_intent_configuration
430 }
431 /// Consumes the builder and constructs a [`CreateIntentInput`](crate::operation::create_intent::CreateIntentInput).
432 pub fn build(
433 self,
434 ) -> ::std::result::Result<crate::operation::create_intent::CreateIntentInput, ::aws_smithy_types::error::operation::BuildError> {
435 ::std::result::Result::Ok(crate::operation::create_intent::CreateIntentInput {
436 intent_name: self.intent_name,
437 description: self.description,
438 parent_intent_signature: self.parent_intent_signature,
439 sample_utterances: self.sample_utterances,
440 dialog_code_hook: self.dialog_code_hook,
441 fulfillment_code_hook: self.fulfillment_code_hook,
442 intent_confirmation_setting: self.intent_confirmation_setting,
443 intent_closing_setting: self.intent_closing_setting,
444 input_contexts: self.input_contexts,
445 output_contexts: self.output_contexts,
446 kendra_configuration: self.kendra_configuration,
447 bot_id: self.bot_id,
448 bot_version: self.bot_version,
449 locale_id: self.locale_id,
450 initial_response_setting: self.initial_response_setting,
451 qn_a_intent_configuration: self.qn_a_intent_configuration,
452 })
453 }
454}