code: public Observable<ServiceResponse<Void>> publishWithServiceResponseAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
          if (this.client.subscriptionId() == null) {
              throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
          }
          if (resourceGroupName == null) {
              throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
          }
          if (labAccountName == null) {
              throw new IllegalArgumentException("Parameter labAccountName is required and cannot be null.");
          }
          if (labName == null) {
              throw new IllegalArgumentException("Parameter labName is required and cannot be null.");
          }
          if (environmentSettingName == null) {
              throw new IllegalArgumentException("Parameter environmentSettingName is required and cannot be null.");
          }
          if (this.client.apiVersion() == null) {
              throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
          }
          final Boolean useExistingImage = null;
          PublishPayload publishPayload = new PublishPayload();
          publishPayload.withUseExistingImage(null);
          return service.publish(this.client.subscriptionId(), resourceGroupName, labAccountName, labName, environmentSettingName, this.client.apiVersion(), this.client.acceptLanguage(), publishPayload, this.client.userAgent())
              .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                  @Override
                  public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                      try {
                          ServiceResponse<Void> clientResponse = publishDelegate(response);
                          return Observable.just(clientResponse);
                      } catch (Throwable t) {
                          return Observable.error(t);
                      }
                  }
              });
      }
docs: Provisions/deprovisions required resources for an environment setting based on current state of the lab/environment setting.
  
  @param resourceGroupName The name of the resource group.
  @param labAccountName The name of the lab Account.
  @param labName The name of the lab.
  @param environmentSettingName The name of the environment Setting.
  @throws IllegalArgumentException thrown if parameters fail the validation
  @return the {@link ServiceResponse} object if successful.