deleteMessage method
Future<DynamiteResponse<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders> >
deleteMessage({
- required String token,
- required int messageId,
- ChatDeleteMessageApiVersion? apiVersion,
- bool? oCSAPIRequest,
Delete a chat message.
Returns a Future containing a DynamiteResponse
with the status code, deserialized body and headers.
Throws a DynamiteApiException
if the API call does not return an expected status code.
Parameters:
apiVersion
Defaults to"v1"
.token
messageId
ID of the message.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: Message deleted successfully
- 202: Message deleted successfully, but a bot or Matterbridge is configured, so the information can be replicated elsewhere
- 400: Deleting message is not possible
- 403: Missing permissions to delete message
- 404: Message not found
- 405: Deleting this message type is not allowed
See:
- $deleteMessage_Request for the request send by this method.
- $deleteMessage_Serializer for a converter to parse the
Response
from an executed request.
Implementation
Future<_i1.DynamiteResponse<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders>> deleteMessage({
required String token,
required int messageId,
ChatDeleteMessageApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final _request = $deleteMessage_Request(
token: token,
messageId: messageId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
final _streamedResponse = await _rootClient.httpClient.send(_request);
final _response = await _i3.Response.fromStream(_streamedResponse);
final _serializer = $deleteMessage_Serializer();
return _i1.ResponseConverter<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders>(_serializer)
.convert(_response);
}