updateIntent method
- required String botId,
- required String botVersion,
- required String intentId,
- required String intentName,
- required String localeId,
- String? description,
- DialogCodeHookSettings? dialogCodeHook,
- FulfillmentCodeHookSettings? fulfillmentCodeHook,
- InitialResponseSetting? initialResponseSetting,
- List<
InputContext> ? inputContexts, - IntentClosingSetting? intentClosingSetting,
- IntentConfirmationSetting? intentConfirmationSetting,
- String? intentDisplayName,
- KendraConfiguration? kendraConfiguration,
- List<
OutputContext> ? outputContexts, - String? parentIntentSignature,
- QInConnectIntentConfiguration? qInConnectIntentConfiguration,
- QnAIntentConfiguration? qnAIntentConfiguration,
- List<
SampleUtterance> ? sampleUtterances, - List<
SlotPriority> ? slotPriorities,
Updates the settings for an intent.
May throw ConflictException.
May throw InternalServerException.
May throw PreconditionFailedException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The identifier of the bot that contains the intent.
Parameter botVersion :
The version of the bot that contains the intent. Must be
DRAFT.
Parameter intentId :
The unique identifier of the intent to update.
Parameter intentName :
The new name for the intent.
Parameter localeId :
The identifier of the language and locale where this intent is used. The
string must match one of the supported locales. For more information, see
Supported
languages.
Parameter description :
The new description of the intent.
Parameter dialogCodeHook :
The new Lambda function to use between each turn of the conversation with
the bot.
Parameter fulfillmentCodeHook :
The new Lambda function to call when all of the intents required slots are
provided and the intent is ready for fulfillment.
Parameter initialResponseSetting :
Configuration settings for a response sent to the user before Amazon Lex
starts eliciting slots.
Parameter inputContexts :
A new list of contexts that must be active in order for Amazon Lex to
consider the intent.
Parameter intentClosingSetting :
The new response that Amazon Lex sends the user when the intent is closed.
Parameter intentConfirmationSetting :
New prompts that Amazon Lex sends to the user to confirm the completion of
an intent.
Parameter intentDisplayName :
The new display name for the intent.
Parameter kendraConfiguration :
New configuration settings for connecting to an Amazon Kendra index.
Parameter outputContexts :
A new list of contexts that Amazon Lex activates when the intent is
fulfilled.
Parameter parentIntentSignature :
The signature of the new built-in intent to use as the parent of this
intent.
Parameter qInConnectIntentConfiguration :
Qinconnect intent configuration details for the update intent request.
Parameter qnAIntentConfiguration :
Specifies the configuration of the built-in Amazon.QnAIntent.
The AMAZON.QnAIntent intent is called when Amazon Lex can't
determine another intent to invoke. If you specify this field, you can't
specify the kendraConfiguration field.
Parameter sampleUtterances :
New utterances used to invoke the intent.
Parameter slotPriorities :
A new list of slots and their priorities that are contained by the intent.
Implementation
Future<UpdateIntentResponse> updateIntent({
required String botId,
required String botVersion,
required String intentId,
required String intentName,
required String localeId,
String? description,
DialogCodeHookSettings? dialogCodeHook,
FulfillmentCodeHookSettings? fulfillmentCodeHook,
InitialResponseSetting? initialResponseSetting,
List<InputContext>? inputContexts,
IntentClosingSetting? intentClosingSetting,
IntentConfirmationSetting? intentConfirmationSetting,
String? intentDisplayName,
KendraConfiguration? kendraConfiguration,
List<OutputContext>? outputContexts,
String? parentIntentSignature,
QInConnectIntentConfiguration? qInConnectIntentConfiguration,
QnAIntentConfiguration? qnAIntentConfiguration,
List<SampleUtterance>? sampleUtterances,
List<SlotPriority>? slotPriorities,
}) async {
final $payload = <String, dynamic>{
'intentName': intentName,
if (description != null) 'description': description,
if (dialogCodeHook != null) 'dialogCodeHook': dialogCodeHook,
if (fulfillmentCodeHook != null)
'fulfillmentCodeHook': fulfillmentCodeHook,
if (initialResponseSetting != null)
'initialResponseSetting': initialResponseSetting,
if (inputContexts != null) 'inputContexts': inputContexts,
if (intentClosingSetting != null)
'intentClosingSetting': intentClosingSetting,
if (intentConfirmationSetting != null)
'intentConfirmationSetting': intentConfirmationSetting,
if (intentDisplayName != null) 'intentDisplayName': intentDisplayName,
if (kendraConfiguration != null)
'kendraConfiguration': kendraConfiguration,
if (outputContexts != null) 'outputContexts': outputContexts,
if (parentIntentSignature != null)
'parentIntentSignature': parentIntentSignature,
if (qInConnectIntentConfiguration != null)
'qInConnectIntentConfiguration': qInConnectIntentConfiguration,
if (qnAIntentConfiguration != null)
'qnAIntentConfiguration': qnAIntentConfiguration,
if (sampleUtterances != null) 'sampleUtterances': sampleUtterances,
if (slotPriorities != null) 'slotPriorities': slotPriorities,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/bots/${Uri.encodeComponent(botId)}/botversions/${Uri.encodeComponent(botVersion)}/botlocales/${Uri.encodeComponent(localeId)}/intents/${Uri.encodeComponent(intentId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateIntentResponse.fromJson(response);
}