String payload = marshall(entity);
request.setRequestPayload(payload);
PutResponse response = resolveApitraryClient().send(request);
if (HttpStatus.No_Content.ordinal() != response.getStatusCode()) {
if (HttpStatus.Not_Found.ordinal() == response.getStatusCode()) {
throw new ApitraryOrmUpdateException("Cannot update object: object with given id does not exist.");
} else {
String statusMessage = (String) new PutResponseUnmarshaller().unMarshall(response, entity);
throw new ApitraryOrmUpdateException(statusMessage);
}