listSubChannels method
Lists all the SubChannels in an elastic channel when given a channel ID. Available only to the app instance admins and channel moderators of elastic channels.
May throw BadRequestException.
May throw ForbiddenException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter channelArn :
The ARN of elastic channel.
Parameter chimeBearer :
The AppInstanceUserArn of the user making the API call.
Parameter maxResults :
The maximum number of sub-channels that you want to return.
Parameter nextToken :
The token passed by previous API calls until all requested sub-channels
are returned.
Implementation
Future<ListSubChannelsResponse> listSubChannels({
required String channelArn,
required String chimeBearer,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
50,
);
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $query = <String, List<String>>{
if (maxResults != null) 'max-results': [maxResults.toString()],
if (nextToken != null) 'next-token': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/channels/${Uri.encodeComponent(channelArn)}/subchannels',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ListSubChannelsResponse.fromJson(response);
}