createChannelModerator method

Future<CreateChannelModeratorResponse> createChannelModerator({
  1. required String channelArn,
  2. required String channelModeratorArn,
  3. required String chimeBearer,
})

Creates a new ChannelModerator. A channel moderator can:

  • Add and remove other members of the channel.
  • Add and remove other moderators of the channel.
  • Add and remove user bans for the channel.
  • Redact messages in the channel.
  • List messages in the channel.

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

Parameter channelArn : The ARN of the channel.

Parameter channelModeratorArn : The AppInstanceUserArn of the moderator.

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

Implementation

Future<CreateChannelModeratorResponse> createChannelModerator({
  required String channelArn,
  required String channelModeratorArn,
  required String chimeBearer,
}) async {
  final headers = <String, String>{
    'x-amz-chime-bearer': chimeBearer.toString(),
  };
  final $payload = <String, dynamic>{
    'ChannelModeratorArn': channelModeratorArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/channels/${Uri.encodeComponent(channelArn)}/moderators',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelModeratorResponse.fromJson(response);
}