updateSlot method
- required String botId,
- required String botVersion,
- required String intentId,
- required String localeId,
- required String slotId,
- required String slotName,
- required SlotValueElicitationSetting valueElicitationSetting,
- String? description,
- MultipleValuesSetting? multipleValuesSetting,
- ObfuscationSetting? obfuscationSetting,
- String? slotTypeId,
- SubSlotSetting? subSlotSetting,
Updates the settings for a slot.
May throw ConflictException.
May throw InternalServerException.
May throw PreconditionFailedException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The unique identifier of the bot that contains the slot.
Parameter botVersion :
The version of the bot that contains the slot. Must always be
DRAFT.
Parameter intentId :
The identifier of the intent that contains the slot.
Parameter localeId :
The identifier of the language and locale that contains the slot. The
string must match one of the supported locales. For more information, see
Supported
languages.
Parameter slotId :
The unique identifier for the slot to update.
Parameter slotName :
The new name for the slot.
Parameter valueElicitationSetting :
A new set of prompts that Amazon Lex sends to the user to elicit a
response the provides a value for the slot.
Parameter description :
The new description for the slot.
Parameter multipleValuesSetting :
Determines whether the slot accepts multiple values in one response.
Multiple value slots are only available in the en-US locale. If you set
this value to true in any other locale, Amazon Lex throws a
ValidationException.
If the multipleValuesSetting is not set, the default value is
false.
Parameter obfuscationSetting :
New settings that determine how slot values are formatted in Amazon
CloudWatch logs.
Parameter slotTypeId :
The unique identifier of the new slot type to associate with this slot.
Parameter subSlotSetting :
Specifications for the constituent sub slots and the expression for the
composite slot.
Implementation
Future<UpdateSlotResponse> updateSlot({
required String botId,
required String botVersion,
required String intentId,
required String localeId,
required String slotId,
required String slotName,
required SlotValueElicitationSetting valueElicitationSetting,
String? description,
MultipleValuesSetting? multipleValuesSetting,
ObfuscationSetting? obfuscationSetting,
String? slotTypeId,
SubSlotSetting? subSlotSetting,
}) async {
final $payload = <String, dynamic>{
'slotName': slotName,
'valueElicitationSetting': valueElicitationSetting,
if (description != null) 'description': description,
if (multipleValuesSetting != null)
'multipleValuesSetting': multipleValuesSetting,
if (obfuscationSetting != null) 'obfuscationSetting': obfuscationSetting,
if (slotTypeId != null) 'slotTypeId': slotTypeId,
if (subSlotSetting != null) 'subSlotSetting': subSlotSetting,
};
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)}/slots/${Uri.encodeComponent(slotId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateSlotResponse.fromJson(response);
}