Exemplo n.º 1
0
 /**
  * GET method with api-version modeled in global settings.
  *
  * @throws ServiceException the exception wrapped in ServiceException if failed.
  */
 public void getPathGlobalValid() throws ServiceException {
   if (this.client.getApiVersion() == null) {
     throw new ServiceException(
         new IllegalArgumentException(
             "Parameter this.client.getApiVersion() is required and cannot be null."));
   }
   try {
     Call<ResponseBody> call =
         service.getPathGlobalValid(this.client.getApiVersion(), this.client.getAcceptLanguage());
     ServiceResponse<Void> response = getPathGlobalValidDelegate(call.execute(), null);
     response.getBody();
   } catch (ServiceException ex) {
     throw ex;
   } catch (Exception ex) {
     throw new ServiceException(ex);
   }
 }
Exemplo n.º 2
0
 /**
  * GET method with api-version modeled in global settings.
  *
  * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
  */
 public Call<ResponseBody> getMethodGlobalValidAsync(final ServiceCallback<Void> serviceCallback) {
   if (this.client.getApiVersion() == null) {
     serviceCallback.failure(
         new ServiceException(
             new IllegalArgumentException(
                 "Parameter this.client.getApiVersion() is required and cannot be null.")));
   }
   Call<ResponseBody> call =
       service.getMethodGlobalValid(this.client.getApiVersion(), this.client.getAcceptLanguage());
   call.enqueue(
       new ServiceResponseCallback<Void>(serviceCallback) {
         @Override
         public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
           try {
             serviceCallback.success(getMethodGlobalValidDelegate(response, retrofit));
           } catch (ServiceException exception) {
             serviceCallback.failure(exception);
           }
         }
       });
   return call;
 }