/** * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to * '1234-5678-9012-3456' to succeed. * * @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 postSwaggerGlobalValidAsync(final ServiceCallback<Void> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException("ServiceCallback is required for async calls."); } if (this.client.getSubscriptionId() == null) { serviceCallback.failure( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); return null; } Call<ResponseBody> call = service.postSwaggerGlobalValid( this.client.getSubscriptionId(), this.client.getAcceptLanguage()); 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(postSwaggerGlobalValidDelegate(response)); } catch (ErrorException | IOException exception) { serviceCallback.failure(exception); } } }); return serviceCall; }
/** * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to * '1234-5678-9012-3456' to succeed. * * @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> postSwaggerGlobalValid() throws ErrorException, IOException, IllegalArgumentException { if (this.client.getSubscriptionId() == null) { throw new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null."); } Call<ResponseBody> call = service.postSwaggerGlobalValid( this.client.getSubscriptionId(), this.client.getAcceptLanguage()); return postSwaggerGlobalValidDelegate(call.execute()); }