updateMessage method
Update message with id messageIdentifier
with contents of update
Implementation
@override
Future<SquadweMessage> updateMessage(
String messageIdentifier, update) async {
try {
final updateResponse = await _dio.patch(
"/public/api/v1/inboxes/${SquadweClientApiInterceptor.INTERCEPTOR_INBOX_IDENTIFIER_PLACEHOLDER}/contacts/${SquadweClientApiInterceptor.INTERCEPTOR_CONTACT_IDENTIFIER_PLACEHOLDER}/conversations/${SquadweClientApiInterceptor.INTERCEPTOR_CONVERSATION_IDENTIFIER_PLACEHOLDER}/messages/$messageIdentifier",
data: update);
if ((updateResponse.statusCode ?? 0).isBetween(199, 300)) {
return SquadweMessage.fromJson(updateResponse.data);
} else {
throw SquadweClientException(
updateResponse.statusMessage ?? "unknown error",
SquadweClientExceptionType.UPDATE_MESSAGE_FAILED);
}
} on DioError catch (e) {
throw SquadweClientException(
e.message, SquadweClientExceptionType.UPDATE_MESSAGE_FAILED);
}
}