code: public Observable<ServiceResponse<ValidateResponseInner>> validateWithServiceResponseAsync(String resourceGroupName, ValidateRequest validateRequest) {
          if (resourceGroupName == null) {
              throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
          }
          if (this.subscriptionId() == null) {
              throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
          }
          if (validateRequest == null) {
              throw new IllegalArgumentException("Parameter validateRequest is required and cannot be null.");
          }
          if (this.apiVersion() == null) {
              throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
          }
          Validator.validate(validateRequest);
          return service.validate(resourceGroupName, this.subscriptionId(), validateRequest, this.apiVersion(), this.acceptLanguage(), this.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ValidateResponseInner>>>() {
                  @Override
                  public Observable<ServiceResponse<ValidateResponseInner>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<ValidateResponseInner> clientResponse = validateDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Validate if a resource can be created.
  Validate if a resource can be created.
  
  @param resourceGroupName Name of the resource group to which the resource belongs.
  @param validateRequest Request with the resources to validate.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the observable to the ValidateResponseInner object