/** * Get complex types with array property while server doesn't provide a response payload. * * @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 getNotProvidedAsync(final ServiceCallback<ArrayWrapper> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } Call<ResponseBody> call = service.getNotProvided(); final ServiceCall serviceCall = new ServiceCall(call); call.enqueue( new ServiceResponseCallback<ArrayWrapper>(serviceCallback) { @Override public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) { try { serviceCallback.success(getNotProvidedDelegate(response)); } catch (ErrorException | IOException exception) { serviceCallback.failure(exception); } } }); return serviceCall; }
/** * Get complex types with array property while server doesn't provide a response payload. * * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the ArrayWrapper object wrapped in {@link ServiceResponse} if successful. */ public ServiceResponse<ArrayWrapper> getNotProvided() throws ErrorException, IOException { Call<ResponseBody> call = service.getNotProvided(); return getNotProvidedDelegate(call.execute()); }