/** * Test implicitly optional header parameter * * @param queryParameter the String value * @throws ServiceException the exception wrapped in ServiceException if failed. */ public void putOptionalHeader(String queryParameter) throws ServiceException { try { Call<ResponseBody> call = service.putOptionalHeader(queryParameter); ServiceResponse<Void> response = putOptionalHeaderDelegate(call.execute(), null); response.getBody(); } catch (ServiceException ex) { throw ex; } catch (Exception ex) { throw new ServiceException(ex); } }
/** * Test implicitly optional header parameter. * * @param queryParameter the String value * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link Call} object */ public Call<ResponseBody> putOptionalHeaderAsync( String queryParameter, final ServiceCallback<Void> serviceCallback) { Call<ResponseBody> call = service.putOptionalHeader(queryParameter); call.enqueue( new ServiceResponseCallback<Void>(serviceCallback) { @Override public void onResponse(Response<ResponseBody> response, Retrofit retrofit) { try { serviceCallback.success(putOptionalHeaderDelegate(response, retrofit)); } catch (ErrorException | IOException exception) { serviceCallback.failure(exception); } } }); return call; }
/** * Test implicitly optional header parameter. * * @param queryParameter the String value * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the {@link ServiceResponse} object if successful. */ public ServiceResponse<Void> putOptionalHeader(String queryParameter) throws ErrorException, IOException { Call<ResponseBody> call = service.putOptionalHeader(queryParameter); return putOptionalHeaderDelegate(call.execute(), null); }