deleteChannelMessage method
Deletes a channel message. Only admins can perform this action. Deletion
makes messages inaccessible immediately. A background process deletes any
revisions created by UpdateChannelMessage.
May throw BadRequestException.
May throw ForbiddenException.
May throw ServiceFailureException.
May throw ServiceUnavailableException.
May throw ThrottledClientException.
May throw UnauthorizedClientException.
Parameter channelArn :
The ARN of the channel.
Parameter chimeBearer :
The ARN of the AppInstanceUser or AppInstanceBot
that makes the API call.
Parameter messageId :
The ID of the message being deleted.
Parameter subChannelId :
The ID of the SubChannel in the request.
Implementation
Future<void> deleteChannelMessage({
required String channelArn,
required String chimeBearer,
required String messageId,
String? subChannelId,
}) async {
final headers = <String, String>{
'x-amz-chime-bearer': chimeBearer.toString(),
};
final $query = <String, List<String>>{
if (subChannelId != null) 'sub-channel-id': [subChannelId],
};
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
}