listChannelModerators method

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

Lists all the moderators for a channel.

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

Parameter channelArn : The ARN of the channel.

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,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(channelArn, 'channelArn');
  _s.validateStringLength(
    'channelArn',
    channelArn,
    5,
    1600,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  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,
    exceptionFnMap: _exceptionFns,
  );
  return ListChannelModeratorsResponse.fromJson(response);
}