getBotAliases method

Future<GetBotAliasesResponse> getBotAliases({
  1. required String botName,
  2. int? maxResults,
  3. String? nameContains,
  4. String? nextToken,
})

Returns a list of aliases for a specified Amazon Lex bot.

This operation requires permissions for the lex:GetBotAliases action.

May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException.

Parameter botName : The name of the bot.

Parameter maxResults : The maximum number of aliases to return in the response. The default is 50. .

Parameter nameContains : Substring to match in bot alias names. An alias will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."

Parameter nextToken : A pagination token for fetching the next page of aliases. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of aliases, specify the pagination token in the next request.

Implementation

Future<GetBotAliasesResponse> getBotAliases({
  required String botName,
  int? maxResults,
  String? nameContains,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(botName, 'botName');
  _s.validateStringLength(
    'botName',
    botName,
    2,
    50,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nameContains != null) 'nameContains': [nameContains],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/bots/${Uri.encodeComponent(botName)}/aliases/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetBotAliasesResponse.fromJson(response);
}