redactChannelMessage method
Redacts message content and 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 ConflictException.
May throw ForbiddenException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter channelArn :
The ARN of the channel containing the messages that you want to redact.
Parameter chimeBearer :
The ARN of the AppInstanceUser or AppInstanceBot
that makes the API call.
Parameter messageId :
The ID of the message being redacted.
Parameter subChannelId :
The ID of the SubChannel in the request.
Implementation
Future<RedactChannelMessageResponse> redactChannelMessage({
required String channelArn,
required String chimeBearer,
required String messageId,
String? subChannelId,
}) async {
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $payload = <String, dynamic>{
if (subChannelId != null) 'SubChannelId': subChannelId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}?operation=redact',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return RedactChannelMessageResponse.fromJson(response);
}