updateContact method
Update current client instance's contact
Implementation
@override
Future<RuutContact> updateContact(update) async {
try {
final updateResponse = await _dio.patch(
"/public/api/v1/inboxes/${RuutChatClientApiInterceptor.INTERCEPTOR_INBOX_IDENTIFIER_PLACEHOLDER}/contacts/${RuutChatClientApiInterceptor.INTERCEPTOR_CONTACT_IDENTIFIER_PLACEHOLDER}",
data: update);
if ((updateResponse.statusCode ?? 0).isBetween(199, 300)) {
return RuutContact.fromJson(updateResponse.data);
} else {
throw RuutClientException(
updateResponse.statusMessage ?? "unknown error",
RuutClientExceptionType.UPDATE_CONTACT_FAILED);
}
} on DioException catch (e) {
throw RuutClientException(
e.message ?? '', RuutClientExceptionType.UPDATE_CONTACT_FAILED);
}
}