createChannelModerator method

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

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 ForbiddenException. May throw UnauthorizedClientException. May throw ConflictException. May throw ResourceLimitExceededException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.

Parameter channelArn : The ARN of the channel.

Parameter channelModeratorArn : The ARN of the moderator.

Implementation

Future<CreateChannelModeratorResponse> createChannelModerator({
  required String channelArn,
  required String channelModeratorArn,
}) async {
  ArgumentError.checkNotNull(channelArn, 'channelArn');
  _s.validateStringLength(
    'channelArn',
    channelArn,
    5,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(channelModeratorArn, 'channelModeratorArn');
  _s.validateStringLength(
    'channelModeratorArn',
    channelModeratorArn,
    5,
    1600,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'ChannelModeratorArn': channelModeratorArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/channels/${Uri.encodeComponent(channelArn)}/moderators',
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelModeratorResponse.fromJson(response);
}