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 UnauthorizedClientException. May throw ThrottledClientException. May throw ServiceUnavailableException. May throw ServiceFailureException.
Parameter channelArn
:
The ARN of the channel.
Parameter messageId
:
The ID of the message being deleted.
Implementation
Future<void> deleteChannelMessage({
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,
);
await _protocol.send(
payload: null,
method: 'DELETE',
requestUri:
'/channels/${Uri.encodeComponent(channelArn)}/messages/${Uri.encodeComponent(messageId)}',
exceptionFnMap: _exceptionFns,
);
}