batchUpdateCustomVocabularyItem method
Update a batch of custom vocabulary items for a given bot locale's custom vocabulary.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The identifier of the bot associated with this custom vocabulary
Parameter botVersion :
The identifier of the version of the bot associated with this custom
vocabulary.
Parameter customVocabularyItemList :
A list of custom vocabulary items with updated fields. Each entry must
contain a phrase and can optionally contain a displayAs and/or a weight.
Parameter localeId :
The identifier of the language and locale where this custom vocabulary is
used. The string must match one of the supported locales. For more
information, see
Supported Languages .
Implementation
Future<BatchUpdateCustomVocabularyItemResponse>
batchUpdateCustomVocabularyItem({
required String botId,
required String botVersion,
required List<CustomVocabularyItem> customVocabularyItemList,
required String localeId,
}) async {
final $payload = <String, dynamic>{
'customVocabularyItemList': customVocabularyItemList,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/bots/${Uri.encodeComponent(botId)}/botversions/${Uri.encodeComponent(botVersion)}/botlocales/${Uri.encodeComponent(localeId)}/customvocabulary/DEFAULT/batchupdate',
exceptionFnMap: _exceptionFns,
);
return BatchUpdateCustomVocabularyItemResponse.fromJson(response);
}