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