aws_sdk_lexmodelbuilding/operation/put_intent/_put_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 PutIntentInput {
6 /// <p>The name of the intent. The name is <i>not</i> case sensitive.</p>
7 /// <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p>
8 /// <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>A description of the intent.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>An array of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. For more information, see <code>how-it-works</code>.</p>
13 pub slots: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>,
14 /// <p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".</p>
15 /// <p>In each utterance, a slot name is enclosed in curly braces.</p>
16 pub sample_utterances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
17 /// <p>Prompts the user to confirm the intent. This question should have a yes or no answer.</p>
18 /// <p>Amazon Lex uses this prompt to ensure that the user acknowledges that the intent is ready for fulfillment. For example, with the <code>OrderPizza</code> intent, you might want to confirm that the order is correct before placing it. For other intents, such as intents that simply respond to user questions, you might not need to ask the user for confirmation before providing the information.</p><note>
19 /// <p>You you must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
20 /// </note>
21 pub confirmation_prompt: ::std::option::Option<crate::types::Prompt>,
22 /// <p>When the user answers "no" to the question defined in <code>confirmationPrompt</code>, Amazon Lex responds with this statement to acknowledge that the intent was canceled.</p><note>
23 /// <p>You must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
24 /// </note>
25 pub rejection_statement: ::std::option::Option<crate::types::Statement>,
26 /// <p>Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the <code>OrderPizza</code> intent is fulfilled, you might prompt the user to order a drink.</p>
27 /// <p>The action that Amazon Lex takes depends on the user's response, as follows:</p>
28 /// <ul>
29 /// <li>
30 /// <p>If the user says "Yes" it responds with the clarification prompt that is configured for the bot.</p></li>
31 /// <li>
32 /// <p>if the user says "Yes" and continues with an utterance that triggers an intent it starts a conversation for the intent.</p></li>
33 /// <li>
34 /// <p>If the user says "No" it responds with the rejection statement configured for the the follow-up prompt.</p></li>
35 /// <li>
36 /// <p>If it doesn't recognize the utterance it repeats the follow-up prompt again.</p></li>
37 /// </ul>
38 /// <p>The <code>followUpPrompt</code> field and the <code>conclusionStatement</code> field are mutually exclusive. You can specify only one.</p>
39 pub follow_up_prompt: ::std::option::Option<crate::types::FollowUpPrompt>,
40 /// <p>The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function.</p>
41 /// <p>This element is relevant only if you provide a Lambda function in the <code>fulfillmentActivity</code>. If you return the intent to the client application, you can't specify this element.</p><note>
42 /// <p>The <code>followUpPrompt</code> and <code>conclusionStatement</code> are mutually exclusive. You can specify only one.</p>
43 /// </note>
44 pub conclusion_statement: ::std::option::Option<crate::types::Statement>,
45 /// <p>Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction.</p>
46 /// <p>For example, suppose your bot determines that the user is John. Your 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 true. You might find John's phone number and set the corresponding session attribute.</p>
47 pub dialog_code_hook: ::std::option::Option<crate::types::CodeHook>,
48 /// <p>Required. Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, <code>fulfillmentActivity</code> defines how the bot places an order with a local pizza store.</p>
49 /// <p>You might configure Amazon Lex to return all of the intent information to the client application, or direct it to invoke a Lambda function that can process the intent (for example, place an order with a pizzeria).</p>
50 pub fulfillment_activity: ::std::option::Option<crate::types::FulfillmentActivity>,
51 /// <p>A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
52 pub parent_intent_signature: ::std::option::Option<::std::string::String>,
53 /// <p>Identifies a specific revision of the <code>$LATEST</code> version.</p>
54 /// <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p>
55 /// <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
56 pub checksum: ::std::option::Option<::std::string::String>,
57 /// <p>When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.</p>
58 pub create_version: ::std::option::Option<bool>,
59 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. For more information, see <a href="http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html"> AMAZON.KendraSearchIntent</a>.</p>
60 pub kendra_configuration: ::std::option::Option<crate::types::KendraConfiguration>,
61 /// <p>An array of <code>InputContext</code> objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.</p>
62 pub input_contexts: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>,
63 /// <p>An array of <code>OutputContext</code> objects that lists the contexts that the intent activates when the intent is fulfilled.</p>
64 pub output_contexts: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>,
65}
66impl PutIntentInput {
67 /// <p>The name of the intent. The name is <i>not</i> case sensitive.</p>
68 /// <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p>
69 /// <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
70 pub fn name(&self) -> ::std::option::Option<&str> {
71 self.name.as_deref()
72 }
73 /// <p>A description of the intent.</p>
74 pub fn description(&self) -> ::std::option::Option<&str> {
75 self.description.as_deref()
76 }
77 /// <p>An array of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. For more information, see <code>how-it-works</code>.</p>
78 ///
79 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.slots.is_none()`.
80 pub fn slots(&self) -> &[crate::types::Slot] {
81 self.slots.as_deref().unwrap_or_default()
82 }
83 /// <p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".</p>
84 /// <p>In each utterance, a slot name is enclosed in curly braces.</p>
85 ///
86 /// 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()`.
87 pub fn sample_utterances(&self) -> &[::std::string::String] {
88 self.sample_utterances.as_deref().unwrap_or_default()
89 }
90 /// <p>Prompts the user to confirm the intent. This question should have a yes or no answer.</p>
91 /// <p>Amazon Lex uses this prompt to ensure that the user acknowledges that the intent is ready for fulfillment. For example, with the <code>OrderPizza</code> intent, you might want to confirm that the order is correct before placing it. For other intents, such as intents that simply respond to user questions, you might not need to ask the user for confirmation before providing the information.</p><note>
92 /// <p>You you must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
93 /// </note>
94 pub fn confirmation_prompt(&self) -> ::std::option::Option<&crate::types::Prompt> {
95 self.confirmation_prompt.as_ref()
96 }
97 /// <p>When the user answers "no" to the question defined in <code>confirmationPrompt</code>, Amazon Lex responds with this statement to acknowledge that the intent was canceled.</p><note>
98 /// <p>You must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
99 /// </note>
100 pub fn rejection_statement(&self) -> ::std::option::Option<&crate::types::Statement> {
101 self.rejection_statement.as_ref()
102 }
103 /// <p>Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the <code>OrderPizza</code> intent is fulfilled, you might prompt the user to order a drink.</p>
104 /// <p>The action that Amazon Lex takes depends on the user's response, as follows:</p>
105 /// <ul>
106 /// <li>
107 /// <p>If the user says "Yes" it responds with the clarification prompt that is configured for the bot.</p></li>
108 /// <li>
109 /// <p>if the user says "Yes" and continues with an utterance that triggers an intent it starts a conversation for the intent.</p></li>
110 /// <li>
111 /// <p>If the user says "No" it responds with the rejection statement configured for the the follow-up prompt.</p></li>
112 /// <li>
113 /// <p>If it doesn't recognize the utterance it repeats the follow-up prompt again.</p></li>
114 /// </ul>
115 /// <p>The <code>followUpPrompt</code> field and the <code>conclusionStatement</code> field are mutually exclusive. You can specify only one.</p>
116 pub fn follow_up_prompt(&self) -> ::std::option::Option<&crate::types::FollowUpPrompt> {
117 self.follow_up_prompt.as_ref()
118 }
119 /// <p>The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function.</p>
120 /// <p>This element is relevant only if you provide a Lambda function in the <code>fulfillmentActivity</code>. If you return the intent to the client application, you can't specify this element.</p><note>
121 /// <p>The <code>followUpPrompt</code> and <code>conclusionStatement</code> are mutually exclusive. You can specify only one.</p>
122 /// </note>
123 pub fn conclusion_statement(&self) -> ::std::option::Option<&crate::types::Statement> {
124 self.conclusion_statement.as_ref()
125 }
126 /// <p>Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction.</p>
127 /// <p>For example, suppose your bot determines that the user is John. Your 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 true. You might find John's phone number and set the corresponding session attribute.</p>
128 pub fn dialog_code_hook(&self) -> ::std::option::Option<&crate::types::CodeHook> {
129 self.dialog_code_hook.as_ref()
130 }
131 /// <p>Required. Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, <code>fulfillmentActivity</code> defines how the bot places an order with a local pizza store.</p>
132 /// <p>You might configure Amazon Lex to return all of the intent information to the client application, or direct it to invoke a Lambda function that can process the intent (for example, place an order with a pizzeria).</p>
133 pub fn fulfillment_activity(&self) -> ::std::option::Option<&crate::types::FulfillmentActivity> {
134 self.fulfillment_activity.as_ref()
135 }
136 /// <p>A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
137 pub fn parent_intent_signature(&self) -> ::std::option::Option<&str> {
138 self.parent_intent_signature.as_deref()
139 }
140 /// <p>Identifies a specific revision of the <code>$LATEST</code> version.</p>
141 /// <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p>
142 /// <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
143 pub fn checksum(&self) -> ::std::option::Option<&str> {
144 self.checksum.as_deref()
145 }
146 /// <p>When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.</p>
147 pub fn create_version(&self) -> ::std::option::Option<bool> {
148 self.create_version
149 }
150 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. For more information, see <a href="http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html"> AMAZON.KendraSearchIntent</a>.</p>
151 pub fn kendra_configuration(&self) -> ::std::option::Option<&crate::types::KendraConfiguration> {
152 self.kendra_configuration.as_ref()
153 }
154 /// <p>An array of <code>InputContext</code> objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.</p>
155 ///
156 /// 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()`.
157 pub fn input_contexts(&self) -> &[crate::types::InputContext] {
158 self.input_contexts.as_deref().unwrap_or_default()
159 }
160 /// <p>An array of <code>OutputContext</code> objects that lists the contexts that the intent activates when the intent is fulfilled.</p>
161 ///
162 /// 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()`.
163 pub fn output_contexts(&self) -> &[crate::types::OutputContext] {
164 self.output_contexts.as_deref().unwrap_or_default()
165 }
166}
167impl PutIntentInput {
168 /// Creates a new builder-style object to manufacture [`PutIntentInput`](crate::operation::put_intent::PutIntentInput).
169 pub fn builder() -> crate::operation::put_intent::builders::PutIntentInputBuilder {
170 crate::operation::put_intent::builders::PutIntentInputBuilder::default()
171 }
172}
173
174/// A builder for [`PutIntentInput`](crate::operation::put_intent::PutIntentInput).
175#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
176#[non_exhaustive]
177pub struct PutIntentInputBuilder {
178 pub(crate) name: ::std::option::Option<::std::string::String>,
179 pub(crate) description: ::std::option::Option<::std::string::String>,
180 pub(crate) slots: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>,
181 pub(crate) sample_utterances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
182 pub(crate) confirmation_prompt: ::std::option::Option<crate::types::Prompt>,
183 pub(crate) rejection_statement: ::std::option::Option<crate::types::Statement>,
184 pub(crate) follow_up_prompt: ::std::option::Option<crate::types::FollowUpPrompt>,
185 pub(crate) conclusion_statement: ::std::option::Option<crate::types::Statement>,
186 pub(crate) dialog_code_hook: ::std::option::Option<crate::types::CodeHook>,
187 pub(crate) fulfillment_activity: ::std::option::Option<crate::types::FulfillmentActivity>,
188 pub(crate) parent_intent_signature: ::std::option::Option<::std::string::String>,
189 pub(crate) checksum: ::std::option::Option<::std::string::String>,
190 pub(crate) create_version: ::std::option::Option<bool>,
191 pub(crate) kendra_configuration: ::std::option::Option<crate::types::KendraConfiguration>,
192 pub(crate) input_contexts: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>,
193 pub(crate) output_contexts: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>,
194}
195impl PutIntentInputBuilder {
196 /// <p>The name of the intent. The name is <i>not</i> case sensitive.</p>
197 /// <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p>
198 /// <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
199 /// This field is required.
200 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201 self.name = ::std::option::Option::Some(input.into());
202 self
203 }
204 /// <p>The name of the intent. The name is <i>not</i> case sensitive.</p>
205 /// <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p>
206 /// <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
207 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208 self.name = input;
209 self
210 }
211 /// <p>The name of the intent. The name is <i>not</i> case sensitive.</p>
212 /// <p>The name can't match a built-in intent name, or a built-in intent name with "AMAZON." removed. For example, because there is a built-in intent called <code>AMAZON.HelpIntent</code>, you can't create a custom intent called <code>HelpIntent</code>.</p>
213 /// <p>For a list of built-in intents, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
214 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
215 &self.name
216 }
217 /// <p>A description of the intent.</p>
218 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219 self.description = ::std::option::Option::Some(input.into());
220 self
221 }
222 /// <p>A description of the intent.</p>
223 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.description = input;
225 self
226 }
227 /// <p>A description of the intent.</p>
228 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
229 &self.description
230 }
231 /// Appends an item to `slots`.
232 ///
233 /// To override the contents of this collection use [`set_slots`](Self::set_slots).
234 ///
235 /// <p>An array of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. For more information, see <code>how-it-works</code>.</p>
236 pub fn slots(mut self, input: crate::types::Slot) -> Self {
237 let mut v = self.slots.unwrap_or_default();
238 v.push(input);
239 self.slots = ::std::option::Option::Some(v);
240 self
241 }
242 /// <p>An array of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. For more information, see <code>how-it-works</code>.</p>
243 pub fn set_slots(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Slot>>) -> Self {
244 self.slots = input;
245 self
246 }
247 /// <p>An array of intent slots. At runtime, Amazon Lex elicits required slot values from the user using prompts defined in the slots. For more information, see <code>how-it-works</code>.</p>
248 pub fn get_slots(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Slot>> {
249 &self.slots
250 }
251 /// Appends an item to `sample_utterances`.
252 ///
253 /// To override the contents of this collection use [`set_sample_utterances`](Self::set_sample_utterances).
254 ///
255 /// <p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".</p>
256 /// <p>In each utterance, a slot name is enclosed in curly braces.</p>
257 pub fn sample_utterances(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 let mut v = self.sample_utterances.unwrap_or_default();
259 v.push(input.into());
260 self.sample_utterances = ::std::option::Option::Some(v);
261 self
262 }
263 /// <p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".</p>
264 /// <p>In each utterance, a slot name is enclosed in curly braces.</p>
265 pub fn set_sample_utterances(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
266 self.sample_utterances = input;
267 self
268 }
269 /// <p>An array of utterances (strings) that a user might say to signal the intent. For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".</p>
270 /// <p>In each utterance, a slot name is enclosed in curly braces.</p>
271 pub fn get_sample_utterances(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
272 &self.sample_utterances
273 }
274 /// <p>Prompts the user to confirm the intent. This question should have a yes or no answer.</p>
275 /// <p>Amazon Lex uses this prompt to ensure that the user acknowledges that the intent is ready for fulfillment. For example, with the <code>OrderPizza</code> intent, you might want to confirm that the order is correct before placing it. For other intents, such as intents that simply respond to user questions, you might not need to ask the user for confirmation before providing the information.</p><note>
276 /// <p>You you must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
277 /// </note>
278 pub fn confirmation_prompt(mut self, input: crate::types::Prompt) -> Self {
279 self.confirmation_prompt = ::std::option::Option::Some(input);
280 self
281 }
282 /// <p>Prompts the user to confirm the intent. This question should have a yes or no answer.</p>
283 /// <p>Amazon Lex uses this prompt to ensure that the user acknowledges that the intent is ready for fulfillment. For example, with the <code>OrderPizza</code> intent, you might want to confirm that the order is correct before placing it. For other intents, such as intents that simply respond to user questions, you might not need to ask the user for confirmation before providing the information.</p><note>
284 /// <p>You you must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
285 /// </note>
286 pub fn set_confirmation_prompt(mut self, input: ::std::option::Option<crate::types::Prompt>) -> Self {
287 self.confirmation_prompt = input;
288 self
289 }
290 /// <p>Prompts the user to confirm the intent. This question should have a yes or no answer.</p>
291 /// <p>Amazon Lex uses this prompt to ensure that the user acknowledges that the intent is ready for fulfillment. For example, with the <code>OrderPizza</code> intent, you might want to confirm that the order is correct before placing it. For other intents, such as intents that simply respond to user questions, you might not need to ask the user for confirmation before providing the information.</p><note>
292 /// <p>You you must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
293 /// </note>
294 pub fn get_confirmation_prompt(&self) -> &::std::option::Option<crate::types::Prompt> {
295 &self.confirmation_prompt
296 }
297 /// <p>When the user answers "no" to the question defined in <code>confirmationPrompt</code>, Amazon Lex responds with this statement to acknowledge that the intent was canceled.</p><note>
298 /// <p>You must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
299 /// </note>
300 pub fn rejection_statement(mut self, input: crate::types::Statement) -> Self {
301 self.rejection_statement = ::std::option::Option::Some(input);
302 self
303 }
304 /// <p>When the user answers "no" to the question defined in <code>confirmationPrompt</code>, Amazon Lex responds with this statement to acknowledge that the intent was canceled.</p><note>
305 /// <p>You must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
306 /// </note>
307 pub fn set_rejection_statement(mut self, input: ::std::option::Option<crate::types::Statement>) -> Self {
308 self.rejection_statement = input;
309 self
310 }
311 /// <p>When the user answers "no" to the question defined in <code>confirmationPrompt</code>, Amazon Lex responds with this statement to acknowledge that the intent was canceled.</p><note>
312 /// <p>You must provide both the <code>rejectionStatement</code> and the <code>confirmationPrompt</code>, or neither.</p>
313 /// </note>
314 pub fn get_rejection_statement(&self) -> &::std::option::Option<crate::types::Statement> {
315 &self.rejection_statement
316 }
317 /// <p>Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the <code>OrderPizza</code> intent is fulfilled, you might prompt the user to order a drink.</p>
318 /// <p>The action that Amazon Lex takes depends on the user's response, as follows:</p>
319 /// <ul>
320 /// <li>
321 /// <p>If the user says "Yes" it responds with the clarification prompt that is configured for the bot.</p></li>
322 /// <li>
323 /// <p>if the user says "Yes" and continues with an utterance that triggers an intent it starts a conversation for the intent.</p></li>
324 /// <li>
325 /// <p>If the user says "No" it responds with the rejection statement configured for the the follow-up prompt.</p></li>
326 /// <li>
327 /// <p>If it doesn't recognize the utterance it repeats the follow-up prompt again.</p></li>
328 /// </ul>
329 /// <p>The <code>followUpPrompt</code> field and the <code>conclusionStatement</code> field are mutually exclusive. You can specify only one.</p>
330 pub fn follow_up_prompt(mut self, input: crate::types::FollowUpPrompt) -> Self {
331 self.follow_up_prompt = ::std::option::Option::Some(input);
332 self
333 }
334 /// <p>Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the <code>OrderPizza</code> intent is fulfilled, you might prompt the user to order a drink.</p>
335 /// <p>The action that Amazon Lex takes depends on the user's response, as follows:</p>
336 /// <ul>
337 /// <li>
338 /// <p>If the user says "Yes" it responds with the clarification prompt that is configured for the bot.</p></li>
339 /// <li>
340 /// <p>if the user says "Yes" and continues with an utterance that triggers an intent it starts a conversation for the intent.</p></li>
341 /// <li>
342 /// <p>If the user says "No" it responds with the rejection statement configured for the the follow-up prompt.</p></li>
343 /// <li>
344 /// <p>If it doesn't recognize the utterance it repeats the follow-up prompt again.</p></li>
345 /// </ul>
346 /// <p>The <code>followUpPrompt</code> field and the <code>conclusionStatement</code> field are mutually exclusive. You can specify only one.</p>
347 pub fn set_follow_up_prompt(mut self, input: ::std::option::Option<crate::types::FollowUpPrompt>) -> Self {
348 self.follow_up_prompt = input;
349 self
350 }
351 /// <p>Amazon Lex uses this prompt to solicit additional activity after fulfilling an intent. For example, after the <code>OrderPizza</code> intent is fulfilled, you might prompt the user to order a drink.</p>
352 /// <p>The action that Amazon Lex takes depends on the user's response, as follows:</p>
353 /// <ul>
354 /// <li>
355 /// <p>If the user says "Yes" it responds with the clarification prompt that is configured for the bot.</p></li>
356 /// <li>
357 /// <p>if the user says "Yes" and continues with an utterance that triggers an intent it starts a conversation for the intent.</p></li>
358 /// <li>
359 /// <p>If the user says "No" it responds with the rejection statement configured for the the follow-up prompt.</p></li>
360 /// <li>
361 /// <p>If it doesn't recognize the utterance it repeats the follow-up prompt again.</p></li>
362 /// </ul>
363 /// <p>The <code>followUpPrompt</code> field and the <code>conclusionStatement</code> field are mutually exclusive. You can specify only one.</p>
364 pub fn get_follow_up_prompt(&self) -> &::std::option::Option<crate::types::FollowUpPrompt> {
365 &self.follow_up_prompt
366 }
367 /// <p>The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function.</p>
368 /// <p>This element is relevant only if you provide a Lambda function in the <code>fulfillmentActivity</code>. If you return the intent to the client application, you can't specify this element.</p><note>
369 /// <p>The <code>followUpPrompt</code> and <code>conclusionStatement</code> are mutually exclusive. You can specify only one.</p>
370 /// </note>
371 pub fn conclusion_statement(mut self, input: crate::types::Statement) -> Self {
372 self.conclusion_statement = ::std::option::Option::Some(input);
373 self
374 }
375 /// <p>The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function.</p>
376 /// <p>This element is relevant only if you provide a Lambda function in the <code>fulfillmentActivity</code>. If you return the intent to the client application, you can't specify this element.</p><note>
377 /// <p>The <code>followUpPrompt</code> and <code>conclusionStatement</code> are mutually exclusive. You can specify only one.</p>
378 /// </note>
379 pub fn set_conclusion_statement(mut self, input: ::std::option::Option<crate::types::Statement>) -> Self {
380 self.conclusion_statement = input;
381 self
382 }
383 /// <p>The statement that you want Amazon Lex to convey to the user after the intent is successfully fulfilled by the Lambda function.</p>
384 /// <p>This element is relevant only if you provide a Lambda function in the <code>fulfillmentActivity</code>. If you return the intent to the client application, you can't specify this element.</p><note>
385 /// <p>The <code>followUpPrompt</code> and <code>conclusionStatement</code> are mutually exclusive. You can specify only one.</p>
386 /// </note>
387 pub fn get_conclusion_statement(&self) -> &::std::option::Option<crate::types::Statement> {
388 &self.conclusion_statement
389 }
390 /// <p>Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction.</p>
391 /// <p>For example, suppose your bot determines that the user is John. Your 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 true. You might find John's phone number and set the corresponding session attribute.</p>
392 pub fn dialog_code_hook(mut self, input: crate::types::CodeHook) -> Self {
393 self.dialog_code_hook = ::std::option::Option::Some(input);
394 self
395 }
396 /// <p>Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction.</p>
397 /// <p>For example, suppose your bot determines that the user is John. Your 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 true. You might find John's phone number and set the corresponding session attribute.</p>
398 pub fn set_dialog_code_hook(mut self, input: ::std::option::Option<crate::types::CodeHook>) -> Self {
399 self.dialog_code_hook = input;
400 self
401 }
402 /// <p>Specifies a Lambda function to invoke for each user input. You can invoke this Lambda function to personalize user interaction.</p>
403 /// <p>For example, suppose your bot determines that the user is John. Your 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 true. You might find John's phone number and set the corresponding session attribute.</p>
404 pub fn get_dialog_code_hook(&self) -> &::std::option::Option<crate::types::CodeHook> {
405 &self.dialog_code_hook
406 }
407 /// <p>Required. Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, <code>fulfillmentActivity</code> defines how the bot places an order with a local pizza store.</p>
408 /// <p>You might configure Amazon Lex to return all of the intent information to the client application, or direct it to invoke a Lambda function that can process the intent (for example, place an order with a pizzeria).</p>
409 pub fn fulfillment_activity(mut self, input: crate::types::FulfillmentActivity) -> Self {
410 self.fulfillment_activity = ::std::option::Option::Some(input);
411 self
412 }
413 /// <p>Required. Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, <code>fulfillmentActivity</code> defines how the bot places an order with a local pizza store.</p>
414 /// <p>You might configure Amazon Lex to return all of the intent information to the client application, or direct it to invoke a Lambda function that can process the intent (for example, place an order with a pizzeria).</p>
415 pub fn set_fulfillment_activity(mut self, input: ::std::option::Option<crate::types::FulfillmentActivity>) -> Self {
416 self.fulfillment_activity = input;
417 self
418 }
419 /// <p>Required. Describes how the intent is fulfilled. For example, after a user provides all of the information for a pizza order, <code>fulfillmentActivity</code> defines how the bot places an order with a local pizza store.</p>
420 /// <p>You might configure Amazon Lex to return all of the intent information to the client application, or direct it to invoke a Lambda function that can process the intent (for example, place an order with a pizzeria).</p>
421 pub fn get_fulfillment_activity(&self) -> &::std::option::Option<crate::types::FulfillmentActivity> {
422 &self.fulfillment_activity
423 }
424 /// <p>A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
425 pub fn parent_intent_signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
426 self.parent_intent_signature = ::std::option::Option::Some(input.into());
427 self
428 }
429 /// <p>A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
430 pub fn set_parent_intent_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
431 self.parent_intent_signature = input;
432 self
433 }
434 /// <p>A unique identifier for the built-in intent to base this intent on. To find the signature for an intent, see <a href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents">Standard Built-in Intents</a> in the <i>Alexa Skills Kit</i>.</p>
435 pub fn get_parent_intent_signature(&self) -> &::std::option::Option<::std::string::String> {
436 &self.parent_intent_signature
437 }
438 /// <p>Identifies a specific revision of the <code>$LATEST</code> version.</p>
439 /// <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p>
440 /// <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
441 pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
442 self.checksum = ::std::option::Option::Some(input.into());
443 self
444 }
445 /// <p>Identifies a specific revision of the <code>$LATEST</code> version.</p>
446 /// <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p>
447 /// <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
448 pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
449 self.checksum = input;
450 self
451 }
452 /// <p>Identifies a specific revision of the <code>$LATEST</code> version.</p>
453 /// <p>When you create a new intent, leave the <code>checksum</code> field blank. If you specify a checksum you get a <code>BadRequestException</code> exception.</p>
454 /// <p>When you want to update a intent, set the <code>checksum</code> field to the checksum of the most recent revision of the <code>$LATEST</code> version. If you don't specify the <code> checksum</code> field, or if the checksum does not match the <code>$LATEST</code> version, you get a <code>PreconditionFailedException</code> exception.</p>
455 pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
456 &self.checksum
457 }
458 /// <p>When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.</p>
459 pub fn create_version(mut self, input: bool) -> Self {
460 self.create_version = ::std::option::Option::Some(input);
461 self
462 }
463 /// <p>When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.</p>
464 pub fn set_create_version(mut self, input: ::std::option::Option<bool>) -> Self {
465 self.create_version = input;
466 self
467 }
468 /// <p>When set to <code>true</code> a new numbered version of the intent is created. This is the same as calling the <code>CreateIntentVersion</code> operation. If you do not specify <code>createVersion</code>, the default is <code>false</code>.</p>
469 pub fn get_create_version(&self) -> &::std::option::Option<bool> {
470 &self.create_version
471 }
472 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. For more information, see <a href="http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html"> AMAZON.KendraSearchIntent</a>.</p>
473 pub fn kendra_configuration(mut self, input: crate::types::KendraConfiguration) -> Self {
474 self.kendra_configuration = ::std::option::Option::Some(input);
475 self
476 }
477 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. For more information, see <a href="http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html"> AMAZON.KendraSearchIntent</a>.</p>
478 pub fn set_kendra_configuration(mut self, input: ::std::option::Option<crate::types::KendraConfiguration>) -> Self {
479 self.kendra_configuration = input;
480 self
481 }
482 /// <p>Configuration information required to use the <code>AMAZON.KendraSearchIntent</code> intent to connect to an Amazon Kendra index. For more information, see <a href="http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html"> AMAZON.KendraSearchIntent</a>.</p>
483 pub fn get_kendra_configuration(&self) -> &::std::option::Option<crate::types::KendraConfiguration> {
484 &self.kendra_configuration
485 }
486 /// Appends an item to `input_contexts`.
487 ///
488 /// To override the contents of this collection use [`set_input_contexts`](Self::set_input_contexts).
489 ///
490 /// <p>An array of <code>InputContext</code> objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.</p>
491 pub fn input_contexts(mut self, input: crate::types::InputContext) -> Self {
492 let mut v = self.input_contexts.unwrap_or_default();
493 v.push(input);
494 self.input_contexts = ::std::option::Option::Some(v);
495 self
496 }
497 /// <p>An array of <code>InputContext</code> objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.</p>
498 pub fn set_input_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>) -> Self {
499 self.input_contexts = input;
500 self
501 }
502 /// <p>An array of <code>InputContext</code> objects that lists the contexts that must be active for Amazon Lex to choose the intent in a conversation with the user.</p>
503 pub fn get_input_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InputContext>> {
504 &self.input_contexts
505 }
506 /// Appends an item to `output_contexts`.
507 ///
508 /// To override the contents of this collection use [`set_output_contexts`](Self::set_output_contexts).
509 ///
510 /// <p>An array of <code>OutputContext</code> objects that lists the contexts that the intent activates when the intent is fulfilled.</p>
511 pub fn output_contexts(mut self, input: crate::types::OutputContext) -> Self {
512 let mut v = self.output_contexts.unwrap_or_default();
513 v.push(input);
514 self.output_contexts = ::std::option::Option::Some(v);
515 self
516 }
517 /// <p>An array of <code>OutputContext</code> objects that lists the contexts that the intent activates when the intent is fulfilled.</p>
518 pub fn set_output_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>) -> Self {
519 self.output_contexts = input;
520 self
521 }
522 /// <p>An array of <code>OutputContext</code> objects that lists the contexts that the intent activates when the intent is fulfilled.</p>
523 pub fn get_output_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OutputContext>> {
524 &self.output_contexts
525 }
526 /// Consumes the builder and constructs a [`PutIntentInput`](crate::operation::put_intent::PutIntentInput).
527 pub fn build(self) -> ::std::result::Result<crate::operation::put_intent::PutIntentInput, ::aws_smithy_types::error::operation::BuildError> {
528 ::std::result::Result::Ok(crate::operation::put_intent::PutIntentInput {
529 name: self.name,
530 description: self.description,
531 slots: self.slots,
532 sample_utterances: self.sample_utterances,
533 confirmation_prompt: self.confirmation_prompt,
534 rejection_statement: self.rejection_statement,
535 follow_up_prompt: self.follow_up_prompt,
536 conclusion_statement: self.conclusion_statement,
537 dialog_code_hook: self.dialog_code_hook,
538 fulfillment_activity: self.fulfillment_activity,
539 parent_intent_signature: self.parent_intent_signature,
540 checksum: self.checksum,
541 create_version: self.create_version,
542 kendra_configuration: self.kendra_configuration,
543 input_contexts: self.input_contexts,
544 output_contexts: self.output_contexts,
545 })
546 }
547}