getBotChannelAssociations method
Returns a list of all of the channels associated with the specified bot.
The GetBotChannelAssociations
operation requires permissions
for the lex:GetBotChannelAssociations
action.
May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException.
Parameter botAlias
:
An alias pointing to the specific version of the Amazon Lex bot to which
this association is being made.
Parameter botName
:
The name of the Amazon Lex bot in the association.
Parameter maxResults
:
The maximum number of associations to return in the response. The default
is 50.
Parameter nameContains
:
Substring to match in channel association names. An association will be
returned if any part of its name matches the substring. For example, "xyz"
matches both "xyzabc" and "abcxyz." To return all bot channel
associations, use a hyphen ("-") as the nameContains
parameter.
Parameter nextToken
:
A pagination token for fetching the next page of associations. If the
response to this call is truncated, Amazon Lex returns a pagination token
in the response. To fetch the next page of associations, specify the
pagination token in the next request.
Implementation
Future<GetBotChannelAssociationsResponse> getBotChannelAssociations({
required String botAlias,
required String botName,
int? maxResults,
String? nameContains,
String? nextToken,
}) async {
ArgumentError.checkNotNull(botAlias, 'botAlias');
_s.validateStringLength(
'botAlias',
botAlias,
1,
100,
isRequired: true,
);
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/${Uri.encodeComponent(botAlias)}/channels/',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetBotChannelAssociationsResponse.fromJson(response);
}