code: public Observable<ServiceResponse<ProjectTaskInner>> cancelWithServiceResponseAsync(String groupName, String serviceName, String projectName, String taskName) {
          if (this.client.subscriptionId() == null) {
              throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
          }
          if (groupName == null) {
              throw new IllegalArgumentException("Parameter groupName is required and cannot be null.");
          }
          if (serviceName == null) {
              throw new IllegalArgumentException("Parameter serviceName is required and cannot be null.");
          }
          if (projectName == null) {
              throw new IllegalArgumentException("Parameter projectName is required and cannot be null.");
          }
          if (taskName == null) {
              throw new IllegalArgumentException("Parameter taskName is required and cannot be null.");
          }
          if (this.client.apiVersion() == null) {
              throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
          }
          return service.cancel(this.client.subscriptionId(), groupName, serviceName, projectName, taskName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ProjectTaskInner>>>() {
                  @Override
                  public Observable<ServiceResponse<ProjectTaskInner>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<ProjectTaskInner> clientResponse = cancelDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Cancel a task.
  The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method cancels a task if it's currently queued or running.
  
  @param groupName Name of the resource group
  @param serviceName Name of the service
  @param projectName Name of the project
  @param taskName Name of the Task
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the ProjectTaskInner object