listChannelModerators method

Future<ListChannelModeratorsResponse> listChannelModerators({
  1. required String channelArn,
  2. required String chimeBearer,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all the moderators for a channel.

May throw BadRequestException. May throw ForbiddenException. May throw ServiceFailureException. May throw ServiceUnavailableException. May throw ThrottledClientException. May throw UnauthorizedClientException.

Parameter channelArn : The ARN of the channel.

Parameter chimeBearer : The ARN of the AppInstanceUser or AppInstanceBot that makes the API call.

Parameter maxResults : The maximum number of moderators that you want returned.

Parameter nextToken : The token passed by previous API calls until all requested moderators are returned.

Implementation

Future<ListChannelModeratorsResponse> listChannelModerators({
  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)}/moderators',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ListChannelModeratorsResponse.fromJson(response);
}