redactChannelMessage method

Future<RedactChannelMessageResponse> redactChannelMessage({
  1. required String channelArn,
  2. required String messageId,
})

Redacts message content, but not metadata. The message exists in the back end, but the action returns null content, and the state shows as redacted.

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 containing the messages that you want to redact.

Parameter messageId : The ID of the message being redacted.

Implementation

Future<RedactChannelMessageResponse> redactChannelMessage({
  required String channelArn,
  required String messageId,
}) async {
  ArgumentError.checkNotNull(channelArn, 'channelArn');
  _s.validateStringLength(
    'channelArn',
    channelArn,
    5,
    1600,
    isRequired: true,
  );
  ArgumentError.checkNotNull(messageId, 'messageId');
  _s.validateStringLength(
    'messageId',
    messageId,
    1,
    128,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'POST',
    requestUri:
        '/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}?operation=redact',
    exceptionFnMap: _exceptionFns,
  );
  return RedactChannelMessageResponse.fromJson(response);
}