/** * Put complex types with array property which is empty. * * @param complexBody Please put an empty array * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if callback is null * @return the {@link Call} object */ public ServiceCall putEmptyAsync( ArrayWrapper complexBody, final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (complexBody == null) { serviceCallback.failure( new IllegalArgumentException("Parameter complexBody is required and cannot be null.")); return null; } Validator.validate(complexBody, serviceCallback); Call<ResponseBody> call = service.putEmpty(complexBody); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue( new ServiceResponseCallback<Void>(serviceCallback) { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { try { serviceCallback.success(putEmptyDelegate(response)); } catch (ErrorException | IOException exception) { serviceCallback.failure(exception); } } }); return serviceCall; }
/** * Put complex types with array property which is empty. * * @param complexBody Please put an empty array * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @return the {@link ServiceResponse} object if successful. */ public ServiceResponse<Void> putEmpty(ArrayWrapper complexBody) throws ErrorException, IOException, IllegalArgumentException { if (complexBody == null) { throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); } Validator.validate(complexBody); Call<ResponseBody> call = service.putEmpty(complexBody); return putEmptyDelegate(call.execute()); }