getBots method
Returns bot information as follows:
-
If you provide the
nameContains
field, the response includes information for the$LATEST
version of all bots whose name contains the specified string. -
If you don't specify the
nameContains
field, the operation returns information about the$LATEST
version of all of your bots.
lex:GetBots
action.
May throw NotFoundException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException.
Parameter maxResults
:
The maximum number of bots to return in the response that the request will
return. The default is 10.
Parameter nameContains
:
Substring to match in bot names. A bot 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 that fetches the next page of bots. If the response to
this call is truncated, Amazon Lex returns a pagination token in the
response. To fetch the next page of bots, specify the pagination token in
the next request.
Implementation
Future<GetBotsResponse> getBots({
int? maxResults,
String? nameContains,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
50,
);
_s.validateStringLength(
'nameContains',
nameContains,
2,
50,
);
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/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetBotsResponse.fromJson(response);
}