/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.dialogflow.v2beta1;

/**
 * Service definition for Dialogflow (v2beta1).
 *
 * <p>
 * Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://cloud.google.com/dialogflow-enterprise/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link DialogflowRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Dialogflow extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {

  // Note: Leave this static initializer at the top of the file.
  static {
    com.google.api.client.util.Preconditions.checkState(
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
        com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.15 of google-api-client to run version " +
        "1.27.0 of the Dialogflow API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
  }

  /**
   * The default encoded root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_ROOT_URL = "https://dialogflow.googleapis.com/";

  /**
   * The default encoded service path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_SERVICE_PATH = "";

  /**
   * The default encoded batch path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.23
   */
  public static final String DEFAULT_BATCH_PATH = "batch";

  /**
   * The default encoded base URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   */
  public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;

  /**
   * Constructor.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport HTTP transport, which should normally be:
   *        <ul>
   *        <li>Google App Engine:
   *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
   *        <li>Android: {@code newCompatibleTransport} from
   *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
   *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
   *        </li>
   *        </ul>
   * @param jsonFactory JSON factory, which may be:
   *        <ul>
   *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
   *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
   *        <li>Android Honeycomb or higher:
   *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
   *        </ul>
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Dialogflow(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
      com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
    this(new Builder(transport, jsonFactory, httpRequestInitializer));
  }

  /**
   * @param builder builder
   */
  Dialogflow(Builder builder) {
    super(builder);
  }

  @Override
  protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
    super.initialize(httpClientRequest);
  }

  /**
   * An accessor for creating requests from the Projects collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Dialogflow dialogflow = new Dialogflow(...);}
   *   {@code Dialogflow.Projects.List request = dialogflow.projects().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Projects projects() {
    return new Projects();
  }

  /**
   * The "projects" collection of methods.
   */
  public class Projects {

    /**
     * Retrieves the specified agent.
     *
     * Create a request for the method "projects.getAgent".
     *
     * This request holds the parameters needed by the dialogflow server.  After setting any optional
     * parameters, call the {@link GetAgent#execute()} method to invoke the remote operation.
     *
     * @param parent Required. The project that the agent to fetch is associated with.
    Format: `projects/`.
     * @return the request
     */
    public GetAgent getAgent(java.lang.String parent) throws java.io.IOException {
      GetAgent result = new GetAgent(parent);
      initialize(result);
      return result;
    }

    public class GetAgent extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Agent> {

      private static final String REST_PATH = "v2beta1/{+parent}/agent";

      private final java.util.regex.Pattern PARENT_PATTERN =
          java.util.regex.Pattern.compile("^projects/[^/]+$");

      /**
       * Retrieves the specified agent.
       *
       * Create a request for the method "projects.getAgent".
       *
       * This request holds the parameters needed by the the dialogflow server.  After setting any
       * optional parameters, call the {@link GetAgent#execute()} method to invoke the remote operation.
       * <p> {@link
       * GetAgent#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
       * must be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param parent Required. The project that the agent to fetch is associated with.
    Format: `projects/`.
       * @since 1.13
       */
      protected GetAgent(java.lang.String parent) {
        super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Agent.class);
        this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
              "Parameter parent must conform to the pattern " +
              "^projects/[^/]+$");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public GetAgent set$Xgafv(java.lang.String $Xgafv) {
        return (GetAgent) super.set$Xgafv($Xgafv);
      }

      @Override
      public GetAgent setAccessToken(java.lang.String accessToken) {
        return (GetAgent) super.setAccessToken(accessToken);
      }

      @Override
      public GetAgent setAlt(java.lang.String alt) {
        return (GetAgent) super.setAlt(alt);
      }

      @Override
      public GetAgent setCallback(java.lang.String callback) {
        return (GetAgent) super.setCallback(callback);
      }

      @Override
      public GetAgent setFields(java.lang.String fields) {
        return (GetAgent) super.setFields(fields);
      }

      @Override
      public GetAgent setKey(java.lang.String key) {
        return (GetAgent) super.setKey(key);
      }

      @Override
      public GetAgent setOauthToken(java.lang.String oauthToken) {
        return (GetAgent) super.setOauthToken(oauthToken);
      }

      @Override
      public GetAgent setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (GetAgent) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public GetAgent setQuotaUser(java.lang.String quotaUser) {
        return (GetAgent) super.setQuotaUser(quotaUser);
      }

      @Override
      public GetAgent setUploadType(java.lang.String uploadType) {
        return (GetAgent) super.setUploadType(uploadType);
      }

      @Override
      public GetAgent setUploadProtocol(java.lang.String uploadProtocol) {
        return (GetAgent) super.setUploadProtocol(uploadProtocol);
      }

      /**
       * Required. The project that the agent to fetch is associated with. Format: `projects/`.
       */
      @com.google.api.client.util.Key
      private java.lang.String parent;

      /** Required. The project that the agent to fetch is associated with. Format: `projects/`.
       */
      public java.lang.String getParent() {
        return parent;
      }

      /**
       * Required. The project that the agent to fetch is associated with. Format: `projects/`.
       */
      public GetAgent setParent(java.lang.String parent) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
              "Parameter parent must conform to the pattern " +
              "^projects/[^/]+$");
        }
        this.parent = parent;
        return this;
      }

      @Override
      public GetAgent set(String parameterName, Object value) {
        return (GetAgent) super.set(parameterName, value);
      }
    }

    /**
     * An accessor for creating requests from the Agent collection.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code Dialogflow dialogflow = new Dialogflow(...);}
     *   {@code Dialogflow.Agent.List request = dialogflow.agent().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public Agent agent() {
      return new Agent();
    }

    /**
     * The "agent" collection of methods.
     */
    public class Agent {

      /**
       * Exports the specified agent to a ZIP file.
       *
       * Operation
       *
       * Create a request for the method "agent.export".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Export#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project that the agent to export is associated with.
      Format: `projects/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ExportAgentRequest}
       * @return the request
       */
      public Export export(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ExportAgentRequest content) throws java.io.IOException {
        Export result = new Export(parent, content);
        initialize(result);
        return result;
      }

      public class Export extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

        private static final String REST_PATH = "v2beta1/{+parent}/agent:export";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Exports the specified agent to a ZIP file.
         *
         * Operation
         *
         * Create a request for the method "agent.export".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Export#execute()} method to invoke the remote operation.
         * <p> {@link
         * Export#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project that the agent to export is associated with.
      Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ExportAgentRequest}
         * @since 1.13
         */
        protected Export(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ExportAgentRequest content) {
          super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public Export set$Xgafv(java.lang.String $Xgafv) {
          return (Export) super.set$Xgafv($Xgafv);
        }

        @Override
        public Export setAccessToken(java.lang.String accessToken) {
          return (Export) super.setAccessToken(accessToken);
        }

        @Override
        public Export setAlt(java.lang.String alt) {
          return (Export) super.setAlt(alt);
        }

        @Override
        public Export setCallback(java.lang.String callback) {
          return (Export) super.setCallback(callback);
        }

        @Override
        public Export setFields(java.lang.String fields) {
          return (Export) super.setFields(fields);
        }

        @Override
        public Export setKey(java.lang.String key) {
          return (Export) super.setKey(key);
        }

        @Override
        public Export setOauthToken(java.lang.String oauthToken) {
          return (Export) super.setOauthToken(oauthToken);
        }

        @Override
        public Export setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Export) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Export setQuotaUser(java.lang.String quotaUser) {
          return (Export) super.setQuotaUser(quotaUser);
        }

        @Override
        public Export setUploadType(java.lang.String uploadType) {
          return (Export) super.setUploadType(uploadType);
        }

        @Override
        public Export setUploadProtocol(java.lang.String uploadProtocol) {
          return (Export) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project that the agent to export is associated with. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project that the agent to export is associated with. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project that the agent to export is associated with. Format: `projects/`.
         */
        public Export setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public Export set(String parameterName, Object value) {
          return (Export) super.set(parameterName, value);
        }
      }
      /**
       * Imports the specified agent from a ZIP file.
       *
       * Uploads new intents and entity types without deleting the existing ones. Intents and entity types
       * with the same name are replaced with the new versions from ImportAgentRequest.
       *
       * Operation
       *
       * Create a request for the method "agent.import".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link DialogflowImport#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project that the agent to import is associated with.
      Format: `projects/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ImportAgentRequest}
       * @return the request
       */
      public DialogflowImport dialogflowImport(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ImportAgentRequest content) throws java.io.IOException {
        DialogflowImport result = new DialogflowImport(parent, content);
        initialize(result);
        return result;
      }

      public class DialogflowImport extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

        private static final String REST_PATH = "v2beta1/{+parent}/agent:import";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Imports the specified agent from a ZIP file.
         *
         * Uploads new intents and entity types without deleting the existing ones. Intents and entity
         * types with the same name are replaced with the new versions from ImportAgentRequest.
         *
         * Operation
         *
         * Create a request for the method "agent.import".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link DialogflowImport#execute()} method to invoke the remote
         * operation. <p> {@link DialogflowImport#initialize(com.google.api.client.googleapis.services.Abs
         * tractGoogleClientRequest)} must be called to initialize this instance immediately after
         * invoking the constructor. </p>
         *
         * @param parent Required. The project that the agent to import is associated with.
      Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ImportAgentRequest}
         * @since 1.13
         */
        protected DialogflowImport(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ImportAgentRequest content) {
          super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public DialogflowImport set$Xgafv(java.lang.String $Xgafv) {
          return (DialogflowImport) super.set$Xgafv($Xgafv);
        }

        @Override
        public DialogflowImport setAccessToken(java.lang.String accessToken) {
          return (DialogflowImport) super.setAccessToken(accessToken);
        }

        @Override
        public DialogflowImport setAlt(java.lang.String alt) {
          return (DialogflowImport) super.setAlt(alt);
        }

        @Override
        public DialogflowImport setCallback(java.lang.String callback) {
          return (DialogflowImport) super.setCallback(callback);
        }

        @Override
        public DialogflowImport setFields(java.lang.String fields) {
          return (DialogflowImport) super.setFields(fields);
        }

        @Override
        public DialogflowImport setKey(java.lang.String key) {
          return (DialogflowImport) super.setKey(key);
        }

        @Override
        public DialogflowImport setOauthToken(java.lang.String oauthToken) {
          return (DialogflowImport) super.setOauthToken(oauthToken);
        }

        @Override
        public DialogflowImport setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (DialogflowImport) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public DialogflowImport setQuotaUser(java.lang.String quotaUser) {
          return (DialogflowImport) super.setQuotaUser(quotaUser);
        }

        @Override
        public DialogflowImport setUploadType(java.lang.String uploadType) {
          return (DialogflowImport) super.setUploadType(uploadType);
        }

        @Override
        public DialogflowImport setUploadProtocol(java.lang.String uploadProtocol) {
          return (DialogflowImport) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project that the agent to import is associated with. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project that the agent to import is associated with. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project that the agent to import is associated with. Format: `projects/`.
         */
        public DialogflowImport setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public DialogflowImport set(String parameterName, Object value) {
          return (DialogflowImport) super.set(parameterName, value);
        }
      }
      /**
       * Restores the specified agent from a ZIP file.
       *
       * Replaces the current agent version with a new one. All the intents and entity types in the older
       * version are deleted.
       *
       * Operation
       *
       * Create a request for the method "agent.restore".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Restore#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project that the agent to restore is associated with.
      Format: `projects/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1RestoreAgentRequest}
       * @return the request
       */
      public Restore restore(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1RestoreAgentRequest content) throws java.io.IOException {
        Restore result = new Restore(parent, content);
        initialize(result);
        return result;
      }

      public class Restore extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

        private static final String REST_PATH = "v2beta1/{+parent}/agent:restore";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Restores the specified agent from a ZIP file.
         *
         * Replaces the current agent version with a new one. All the intents and entity types in the
         * older version are deleted.
         *
         * Operation
         *
         * Create a request for the method "agent.restore".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Restore#execute()} method to invoke the remote operation.
         * <p> {@link
         * Restore#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project that the agent to restore is associated with.
      Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1RestoreAgentRequest}
         * @since 1.13
         */
        protected Restore(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1RestoreAgentRequest content) {
          super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public Restore set$Xgafv(java.lang.String $Xgafv) {
          return (Restore) super.set$Xgafv($Xgafv);
        }

        @Override
        public Restore setAccessToken(java.lang.String accessToken) {
          return (Restore) super.setAccessToken(accessToken);
        }

        @Override
        public Restore setAlt(java.lang.String alt) {
          return (Restore) super.setAlt(alt);
        }

        @Override
        public Restore setCallback(java.lang.String callback) {
          return (Restore) super.setCallback(callback);
        }

        @Override
        public Restore setFields(java.lang.String fields) {
          return (Restore) super.setFields(fields);
        }

        @Override
        public Restore setKey(java.lang.String key) {
          return (Restore) super.setKey(key);
        }

        @Override
        public Restore setOauthToken(java.lang.String oauthToken) {
          return (Restore) super.setOauthToken(oauthToken);
        }

        @Override
        public Restore setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Restore) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Restore setQuotaUser(java.lang.String quotaUser) {
          return (Restore) super.setQuotaUser(quotaUser);
        }

        @Override
        public Restore setUploadType(java.lang.String uploadType) {
          return (Restore) super.setUploadType(uploadType);
        }

        @Override
        public Restore setUploadProtocol(java.lang.String uploadProtocol) {
          return (Restore) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project that the agent to restore is associated with. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project that the agent to restore is associated with. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project that the agent to restore is associated with. Format: `projects/`.
         */
        public Restore setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public Restore set(String parameterName, Object value) {
          return (Restore) super.set(parameterName, value);
        }
      }
      /**
       * Returns the list of agents.
       *
       * Since there is at most one conversational agent per project, this method is useful primarily for
       * listing all agents across projects the caller has access to. One can achieve that with a wildcard
       * project collection id "-". Refer to [List Sub-
       * Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
       *
       * Create a request for the method "agent.search".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Search#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project to list agents from.
      Format: `projects/`.
       * @return the request
       */
      public Search search(java.lang.String parent) throws java.io.IOException {
        Search result = new Search(parent);
        initialize(result);
        return result;
      }

      public class Search extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SearchAgentsResponse> {

        private static final String REST_PATH = "v2beta1/{+parent}/agent:search";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Returns the list of agents.
         *
         * Since there is at most one conversational agent per project, this method is useful primarily
         * for listing all agents across projects the caller has access to. One can achieve that with a
         * wildcard project collection id "-". Refer to [List Sub-
         * Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).
         *
         * Create a request for the method "agent.search".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Search#execute()} method to invoke the remote operation.
         * <p> {@link
         * Search#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project to list agents from.
      Format: `projects/`.
         * @since 1.13
         */
        protected Search(java.lang.String parent) {
          super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SearchAgentsResponse.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public Search set$Xgafv(java.lang.String $Xgafv) {
          return (Search) super.set$Xgafv($Xgafv);
        }

        @Override
        public Search setAccessToken(java.lang.String accessToken) {
          return (Search) super.setAccessToken(accessToken);
        }

        @Override
        public Search setAlt(java.lang.String alt) {
          return (Search) super.setAlt(alt);
        }

        @Override
        public Search setCallback(java.lang.String callback) {
          return (Search) super.setCallback(callback);
        }

        @Override
        public Search setFields(java.lang.String fields) {
          return (Search) super.setFields(fields);
        }

        @Override
        public Search setKey(java.lang.String key) {
          return (Search) super.setKey(key);
        }

        @Override
        public Search setOauthToken(java.lang.String oauthToken) {
          return (Search) super.setOauthToken(oauthToken);
        }

        @Override
        public Search setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Search) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Search setQuotaUser(java.lang.String quotaUser) {
          return (Search) super.setQuotaUser(quotaUser);
        }

        @Override
        public Search setUploadType(java.lang.String uploadType) {
          return (Search) super.setUploadType(uploadType);
        }

        @Override
        public Search setUploadProtocol(java.lang.String uploadProtocol) {
          return (Search) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project to list agents from. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project to list agents from. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project to list agents from. Format: `projects/`.
         */
        public Search setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /**
         * Optional. The maximum number of items to return in a single page. By default 100 and at
         * most 1000.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * Optional. The maximum number of items to return in a single page. By default 100 and at
         * most 1000.
         */
        public Search setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /** Optional. The next_page_token value returned from a previous list request. */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** Optional. The next_page_token value returned from a previous list request.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /** Optional. The next_page_token value returned from a previous list request. */
        public Search setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        @Override
        public Search set(String parameterName, Object value) {
          return (Search) super.set(parameterName, value);
        }
      }
      /**
       * Trains the specified agent.
       *
       * Operation
       *
       * Create a request for the method "agent.train".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Train#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project that the agent to train is associated with.
      Format: `projects/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1TrainAgentRequest}
       * @return the request
       */
      public Train train(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1TrainAgentRequest content) throws java.io.IOException {
        Train result = new Train(parent, content);
        initialize(result);
        return result;
      }

      public class Train extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

        private static final String REST_PATH = "v2beta1/{+parent}/agent:train";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Trains the specified agent.
         *
         * Operation
         *
         * Create a request for the method "agent.train".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Train#execute()} method to invoke the remote operation.
         * <p> {@link
         * Train#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project that the agent to train is associated with.
      Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1TrainAgentRequest}
         * @since 1.13
         */
        protected Train(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1TrainAgentRequest content) {
          super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public Train set$Xgafv(java.lang.String $Xgafv) {
          return (Train) super.set$Xgafv($Xgafv);
        }

        @Override
        public Train setAccessToken(java.lang.String accessToken) {
          return (Train) super.setAccessToken(accessToken);
        }

        @Override
        public Train setAlt(java.lang.String alt) {
          return (Train) super.setAlt(alt);
        }

        @Override
        public Train setCallback(java.lang.String callback) {
          return (Train) super.setCallback(callback);
        }

        @Override
        public Train setFields(java.lang.String fields) {
          return (Train) super.setFields(fields);
        }

        @Override
        public Train setKey(java.lang.String key) {
          return (Train) super.setKey(key);
        }

        @Override
        public Train setOauthToken(java.lang.String oauthToken) {
          return (Train) super.setOauthToken(oauthToken);
        }

        @Override
        public Train setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Train) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Train setQuotaUser(java.lang.String quotaUser) {
          return (Train) super.setQuotaUser(quotaUser);
        }

        @Override
        public Train setUploadType(java.lang.String uploadType) {
          return (Train) super.setUploadType(uploadType);
        }

        @Override
        public Train setUploadProtocol(java.lang.String uploadProtocol) {
          return (Train) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project that the agent to train is associated with. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project that the agent to train is associated with. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project that the agent to train is associated with. Format: `projects/`.
         */
        public Train setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public Train set(String parameterName, Object value) {
          return (Train) super.set(parameterName, value);
        }
      }

      /**
       * An accessor for creating requests from the EntityTypes collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.EntityTypes.List request = dialogflow.entityTypes().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public EntityTypes entityTypes() {
        return new EntityTypes();
      }

      /**
       * The "entityTypes" collection of methods.
       */
      public class EntityTypes {

        /**
         * Deletes entity types in the specified agent.
         *
         * Operation
         *
         * Create a request for the method "entityTypes.batchDelete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link BatchDelete#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The name of the agent to delete all entities types for. Format:
        `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest}
         * @return the request
         */
        public BatchDelete batchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest content) throws java.io.IOException {
          BatchDelete result = new BatchDelete(parent, content);
          initialize(result);
          return result;
        }

        public class BatchDelete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+parent}/entityTypes:batchDelete";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Deletes entity types in the specified agent.
           *
           * Operation
           *
           * Create a request for the method "entityTypes.batchDelete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link BatchDelete#execute()} method to invoke the remote
           * operation. <p> {@link
           * BatchDelete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The name of the agent to delete all entities types for. Format:
        `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest}
           * @since 1.13
           */
          protected BatchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public BatchDelete set$Xgafv(java.lang.String $Xgafv) {
            return (BatchDelete) super.set$Xgafv($Xgafv);
          }

          @Override
          public BatchDelete setAccessToken(java.lang.String accessToken) {
            return (BatchDelete) super.setAccessToken(accessToken);
          }

          @Override
          public BatchDelete setAlt(java.lang.String alt) {
            return (BatchDelete) super.setAlt(alt);
          }

          @Override
          public BatchDelete setCallback(java.lang.String callback) {
            return (BatchDelete) super.setCallback(callback);
          }

          @Override
          public BatchDelete setFields(java.lang.String fields) {
            return (BatchDelete) super.setFields(fields);
          }

          @Override
          public BatchDelete setKey(java.lang.String key) {
            return (BatchDelete) super.setKey(key);
          }

          @Override
          public BatchDelete setOauthToken(java.lang.String oauthToken) {
            return (BatchDelete) super.setOauthToken(oauthToken);
          }

          @Override
          public BatchDelete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (BatchDelete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public BatchDelete setQuotaUser(java.lang.String quotaUser) {
            return (BatchDelete) super.setQuotaUser(quotaUser);
          }

          @Override
          public BatchDelete setUploadType(java.lang.String uploadType) {
            return (BatchDelete) super.setUploadType(uploadType);
          }

          @Override
          public BatchDelete setUploadProtocol(java.lang.String uploadProtocol) {
            return (BatchDelete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the agent to delete all entities types for. Format:
           * `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The name of the agent to delete all entities types for. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The name of the agent to delete all entities types for. Format:
           * `projects//agent`.
           */
          public BatchDelete setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public BatchDelete set(String parameterName, Object value) {
            return (BatchDelete) super.set(parameterName, value);
          }
        }
        /**
         * Updates/Creates multiple entity types in the specified agent.
         *
         * Operation
         *
         * Create a request for the method "entityTypes.batchUpdate".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link BatchUpdate#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The name of the agent to update or create entity types in.
        Format: `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest}
         * @return the request
         */
        public BatchUpdate batchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest content) throws java.io.IOException {
          BatchUpdate result = new BatchUpdate(parent, content);
          initialize(result);
          return result;
        }

        public class BatchUpdate extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+parent}/entityTypes:batchUpdate";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Updates/Creates multiple entity types in the specified agent.
           *
           * Operation
           *
           * Create a request for the method "entityTypes.batchUpdate".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link BatchUpdate#execute()} method to invoke the remote
           * operation. <p> {@link
           * BatchUpdate#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The name of the agent to update or create entity types in.
        Format: `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest}
           * @since 1.13
           */
          protected BatchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public BatchUpdate set$Xgafv(java.lang.String $Xgafv) {
            return (BatchUpdate) super.set$Xgafv($Xgafv);
          }

          @Override
          public BatchUpdate setAccessToken(java.lang.String accessToken) {
            return (BatchUpdate) super.setAccessToken(accessToken);
          }

          @Override
          public BatchUpdate setAlt(java.lang.String alt) {
            return (BatchUpdate) super.setAlt(alt);
          }

          @Override
          public BatchUpdate setCallback(java.lang.String callback) {
            return (BatchUpdate) super.setCallback(callback);
          }

          @Override
          public BatchUpdate setFields(java.lang.String fields) {
            return (BatchUpdate) super.setFields(fields);
          }

          @Override
          public BatchUpdate setKey(java.lang.String key) {
            return (BatchUpdate) super.setKey(key);
          }

          @Override
          public BatchUpdate setOauthToken(java.lang.String oauthToken) {
            return (BatchUpdate) super.setOauthToken(oauthToken);
          }

          @Override
          public BatchUpdate setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (BatchUpdate) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public BatchUpdate setQuotaUser(java.lang.String quotaUser) {
            return (BatchUpdate) super.setQuotaUser(quotaUser);
          }

          @Override
          public BatchUpdate setUploadType(java.lang.String uploadType) {
            return (BatchUpdate) super.setUploadType(uploadType);
          }

          @Override
          public BatchUpdate setUploadProtocol(java.lang.String uploadProtocol) {
            return (BatchUpdate) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the agent to update or create entity types in. Format:
           * `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The name of the agent to update or create entity types in. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The name of the agent to update or create entity types in. Format:
           * `projects//agent`.
           */
          public BatchUpdate setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public BatchUpdate set(String parameterName, Object value) {
            return (BatchUpdate) super.set(parameterName, value);
          }
        }
        /**
         * Creates an entity type in the specified agent.
         *
         * Create a request for the method "entityTypes.create".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The agent to create a entity type for.
        Format: `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType> {

          private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Creates an entity type in the specified agent.
           *
           * Create a request for the method "entityTypes.create".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           * <p> {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The agent to create a entity type for.
        Format: `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public Create set$Xgafv(java.lang.String $Xgafv) {
            return (Create) super.set$Xgafv($Xgafv);
          }

          @Override
          public Create setAccessToken(java.lang.String accessToken) {
            return (Create) super.setAccessToken(accessToken);
          }

          @Override
          public Create setAlt(java.lang.String alt) {
            return (Create) super.setAlt(alt);
          }

          @Override
          public Create setCallback(java.lang.String callback) {
            return (Create) super.setCallback(callback);
          }

          @Override
          public Create setFields(java.lang.String fields) {
            return (Create) super.setFields(fields);
          }

          @Override
          public Create setKey(java.lang.String key) {
            return (Create) super.setKey(key);
          }

          @Override
          public Create setOauthToken(java.lang.String oauthToken) {
            return (Create) super.setOauthToken(oauthToken);
          }

          @Override
          public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Create) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Create setQuotaUser(java.lang.String quotaUser) {
            return (Create) super.setQuotaUser(quotaUser);
          }

          @Override
          public Create setUploadType(java.lang.String uploadType) {
            return (Create) super.setUploadType(uploadType);
          }

          @Override
          public Create setUploadProtocol(java.lang.String uploadProtocol) {
            return (Create) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The agent to create a entity type for. Format: `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The agent to create a entity type for. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The agent to create a entity type for. Format: `projects//agent`.
           */
          public Create setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * Optional. The language of entity synonyms defined in `entity_type`. If not specified,
           * the agent's default language is used. [Many languages](https://cloud.google.com
           * /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be
           * enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's
         default language is used. [Many languages](https://cloud.google.com/dialogflow-
         enterprise/docs/reference/language) are supported. Note: languages must be enabled in the agent
         before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language of entity synonyms defined in `entity_type`. If not specified,
           * the agent's default language is used. [Many languages](https://cloud.google.com
           * /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be
           * enabled in the agent before they can be used.
           */
          public Create setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          @Override
          public Create set(String parameterName, Object value) {
            return (Create) super.set(parameterName, value);
          }
        }
        /**
         * Deletes the specified entity type.
         *
         * Create a request for the method "entityTypes.delete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the entity type to delete.
        Format: `projects//agent/entityTypes/`.
         * @return the request
         */
        public Delete delete(java.lang.String name) throws java.io.IOException {
          Delete result = new Delete(name);
          initialize(result);
          return result;
        }

        public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

          /**
           * Deletes the specified entity type.
           *
           * Create a request for the method "entityTypes.delete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           * <p> {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the entity type to delete.
        Format: `projects//agent/entityTypes/`.
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
          }

          @Override
          public Delete set$Xgafv(java.lang.String $Xgafv) {
            return (Delete) super.set$Xgafv($Xgafv);
          }

          @Override
          public Delete setAccessToken(java.lang.String accessToken) {
            return (Delete) super.setAccessToken(accessToken);
          }

          @Override
          public Delete setAlt(java.lang.String alt) {
            return (Delete) super.setAlt(alt);
          }

          @Override
          public Delete setCallback(java.lang.String callback) {
            return (Delete) super.setCallback(callback);
          }

          @Override
          public Delete setFields(java.lang.String fields) {
            return (Delete) super.setFields(fields);
          }

          @Override
          public Delete setKey(java.lang.String key) {
            return (Delete) super.setKey(key);
          }

          @Override
          public Delete setOauthToken(java.lang.String oauthToken) {
            return (Delete) super.setOauthToken(oauthToken);
          }

          @Override
          public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Delete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Delete setQuotaUser(java.lang.String quotaUser) {
            return (Delete) super.setQuotaUser(quotaUser);
          }

          @Override
          public Delete setUploadType(java.lang.String uploadType) {
            return (Delete) super.setUploadType(uploadType);
          }

          @Override
          public Delete setUploadProtocol(java.lang.String uploadProtocol) {
            return (Delete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the entity type to delete. Format:
           * `projects//agent/entityTypes/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the entity type to delete. Format: `projects//agent/entityTypes/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the entity type to delete. Format:
           * `projects//agent/entityTypes/`.
           */
          public Delete setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Retrieves the specified entity type.
         *
         * Create a request for the method "entityTypes.get".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the entity type.
        Format: `projects//agent/entityTypes/`.
         * @return the request
         */
        public Get get(java.lang.String name) throws java.io.IOException {
          Get result = new Get(name);
          initialize(result);
          return result;
        }

        public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

          /**
           * Retrieves the specified entity type.
           *
           * Create a request for the method "entityTypes.get".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the entity type.
        Format: `projects//agent/entityTypes/`.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public Get set$Xgafv(java.lang.String $Xgafv) {
            return (Get) super.set$Xgafv($Xgafv);
          }

          @Override
          public Get setAccessToken(java.lang.String accessToken) {
            return (Get) super.setAccessToken(accessToken);
          }

          @Override
          public Get setAlt(java.lang.String alt) {
            return (Get) super.setAlt(alt);
          }

          @Override
          public Get setCallback(java.lang.String callback) {
            return (Get) super.setCallback(callback);
          }

          @Override
          public Get setFields(java.lang.String fields) {
            return (Get) super.setFields(fields);
          }

          @Override
          public Get setKey(java.lang.String key) {
            return (Get) super.setKey(key);
          }

          @Override
          public Get setOauthToken(java.lang.String oauthToken) {
            return (Get) super.setOauthToken(oauthToken);
          }

          @Override
          public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Get) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Get setQuotaUser(java.lang.String quotaUser) {
            return (Get) super.setQuotaUser(quotaUser);
          }

          @Override
          public Get setUploadType(java.lang.String uploadType) {
            return (Get) super.setUploadType(uploadType);
          }

          @Override
          public Get setUploadProtocol(java.lang.String uploadProtocol) {
            return (Get) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the entity type. Format: `projects//agent/entityTypes/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the entity type. Format: `projects//agent/entityTypes/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the entity type. Format: `projects//agent/entityTypes/`.
           */
          public Get setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. The language to retrieve entity synonyms for. If not specified, the agent's
           * default language is used. [Many languages](https://cloud.google.com/dialogflow-
           * enterprise/docs/reference/language) are supported. Note: languages must be enabled in
           * the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language to retrieve entity synonyms for. If not specified, the agent's default
         language is used. [Many languages](https://cloud.google.com/dialogflow-
         enterprise/docs/reference/language) are supported. Note: languages must be enabled in the agent
         before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language to retrieve entity synonyms for. If not specified, the agent's
           * default language is used. [Many languages](https://cloud.google.com/dialogflow-
           * enterprise/docs/reference/language) are supported. Note: languages must be enabled in
           * the agent before they can be used.
           */
          public Get setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Returns the list of all entity types in the specified agent.
         *
         * Create a request for the method "entityTypes.list".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The agent to list all entity types from.
        Format: `projects//agent`.
         * @return the request
         */
        public List list(java.lang.String parent) throws java.io.IOException {
          List result = new List(parent);
          initialize(result);
          return result;
        }

        public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListEntityTypesResponse> {

          private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Returns the list of all entity types in the specified agent.
           *
           * Create a request for the method "entityTypes.list".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The agent to list all entity types from.
        Format: `projects//agent`.
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListEntityTypesResponse.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public List set$Xgafv(java.lang.String $Xgafv) {
            return (List) super.set$Xgafv($Xgafv);
          }

          @Override
          public List setAccessToken(java.lang.String accessToken) {
            return (List) super.setAccessToken(accessToken);
          }

          @Override
          public List setAlt(java.lang.String alt) {
            return (List) super.setAlt(alt);
          }

          @Override
          public List setCallback(java.lang.String callback) {
            return (List) super.setCallback(callback);
          }

          @Override
          public List setFields(java.lang.String fields) {
            return (List) super.setFields(fields);
          }

          @Override
          public List setKey(java.lang.String key) {
            return (List) super.setKey(key);
          }

          @Override
          public List setOauthToken(java.lang.String oauthToken) {
            return (List) super.setOauthToken(oauthToken);
          }

          @Override
          public List setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (List) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public List setQuotaUser(java.lang.String quotaUser) {
            return (List) super.setQuotaUser(quotaUser);
          }

          @Override
          public List setUploadType(java.lang.String uploadType) {
            return (List) super.setUploadType(uploadType);
          }

          @Override
          public List setUploadProtocol(java.lang.String uploadProtocol) {
            return (List) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The agent to list all entity types from. Format: `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The agent to list all entity types from. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The agent to list all entity types from. Format: `projects//agent`.
           */
          public List setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * Optional. The language to list entity synonyms for. If not specified, the agent's
           * default language is used. [Many languages](https://cloud.google.com/dialogflow-
           * enterprise/docs/reference/language) are supported. Note: languages must be enabled in
           * the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language to list entity synonyms for. If not specified, the agent's default language
         is used. [Many languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language)
         are supported. Note: languages must be enabled in the agent before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language to list entity synonyms for. If not specified, the agent's
           * default language is used. [Many languages](https://cloud.google.com/dialogflow-
           * enterprise/docs/reference/language) are supported. Note: languages must be enabled in
           * the agent before they can be used.
           */
          public List setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 100 and at
           * most 1000.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 100 and at
           * most 1000.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** Optional. The next_page_token value returned from a previous list request.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          public List setPageToken(java.lang.String pageToken) {
            this.pageToken = pageToken;
            return this;
          }

          @Override
          public List set(String parameterName, Object value) {
            return (List) super.set(parameterName, value);
          }
        }
        /**
         * Updates the specified entity type.
         *
         * Create a request for the method "entityTypes.patch".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         *
         * @param name The unique identifier of the entity type.
        Required for EntityTypes.UpdateEntityType and
         *        EntityTypes.BatchUpdateEntityTypes methods.
        Format: `projects//agent/entityTypes/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType}
         * @return the request
         */
        public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType content) throws java.io.IOException {
          Patch result = new Patch(name, content);
          initialize(result);
          return result;
        }

        public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

          /**
           * Updates the specified entity type.
           *
           * Create a request for the method "entityTypes.patch".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           * <p> {@link
           * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The unique identifier of the entity type.
        Required for EntityTypes.UpdateEntityType and
         *        EntityTypes.BatchUpdateEntityTypes methods.
        Format: `projects//agent/entityTypes/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType}
           * @since 1.13
           */
          protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType content) {
            super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1EntityType.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
          }

          @Override
          public Patch set$Xgafv(java.lang.String $Xgafv) {
            return (Patch) super.set$Xgafv($Xgafv);
          }

          @Override
          public Patch setAccessToken(java.lang.String accessToken) {
            return (Patch) super.setAccessToken(accessToken);
          }

          @Override
          public Patch setAlt(java.lang.String alt) {
            return (Patch) super.setAlt(alt);
          }

          @Override
          public Patch setCallback(java.lang.String callback) {
            return (Patch) super.setCallback(callback);
          }

          @Override
          public Patch setFields(java.lang.String fields) {
            return (Patch) super.setFields(fields);
          }

          @Override
          public Patch setKey(java.lang.String key) {
            return (Patch) super.setKey(key);
          }

          @Override
          public Patch setOauthToken(java.lang.String oauthToken) {
            return (Patch) super.setOauthToken(oauthToken);
          }

          @Override
          public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Patch) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Patch setQuotaUser(java.lang.String quotaUser) {
            return (Patch) super.setQuotaUser(quotaUser);
          }

          @Override
          public Patch setUploadType(java.lang.String uploadType) {
            return (Patch) super.setUploadType(uploadType);
          }

          @Override
          public Patch setUploadProtocol(java.lang.String uploadProtocol) {
            return (Patch) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and
           * EntityTypes.BatchUpdateEntityTypes methods. Format: `projects//agent/entityTypes/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and
         EntityTypes.BatchUpdateEntityTypes methods. Format: `projects//agent/entityTypes/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and
           * EntityTypes.BatchUpdateEntityTypes methods. Format: `projects//agent/entityTypes/`.
           */
          public Patch setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/entityTypes/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. The language of entity synonyms defined in `entity_type`. If not specified,
           * the agent's default language is used. [Many languages](https://cloud.google.com
           * /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be
           * enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's
         default language is used. [Many languages](https://cloud.google.com/dialogflow-
         enterprise/docs/reference/language) are supported. Note: languages must be enabled in the agent
         before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language of entity synonyms defined in `entity_type`. If not specified,
           * the agent's default language is used. [Many languages](https://cloud.google.com
           * /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be
           * enabled in the agent before they can be used.
           */
          public Patch setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          /** Optional. The mask to control which fields get updated. */
          @com.google.api.client.util.Key
          private String updateMask;

          /** Optional. The mask to control which fields get updated.
           */
          public String getUpdateMask() {
            return updateMask;
          }

          /** Optional. The mask to control which fields get updated. */
          public Patch setUpdateMask(String updateMask) {
            this.updateMask = updateMask;
            return this;
          }

          @Override
          public Patch set(String parameterName, Object value) {
            return (Patch) super.set(parameterName, value);
          }
        }

        /**
         * An accessor for creating requests from the Entities collection.
         *
         * <p>The typical use is:</p>
         * <pre>
         *   {@code Dialogflow dialogflow = new Dialogflow(...);}
         *   {@code Dialogflow.Entities.List request = dialogflow.entities().list(parameters ...)}
         * </pre>
         *
         * @return the resource collection
         */
        public Entities entities() {
          return new Entities();
        }

        /**
         * The "entities" collection of methods.
         */
        public class Entities {

          /**
           * Creates multiple new entities in the specified entity type.
           *
           * Operation
           *
           * Create a request for the method "entities.batchCreate".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link BatchCreate#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The name of the entity type to create entities in. Format:
          `projects//agent/entityTypes/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest}
           * @return the request
           */
          public BatchCreate batchCreate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest content) throws java.io.IOException {
            BatchCreate result = new BatchCreate(parent, content);
            initialize(result);
            return result;
          }

          public class BatchCreate extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+parent}/entities:batchCreate";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

            /**
             * Creates multiple new entities in the specified entity type.
             *
             * Operation
             *
             * Create a request for the method "entities.batchCreate".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link BatchCreate#execute()} method to invoke the remote
             * operation. <p> {@link
             * BatchCreate#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The name of the entity type to create entities in. Format:
          `projects//agent/entityTypes/`.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest}
             * @since 1.13
             */
            protected BatchCreate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
            }

            @Override
            public BatchCreate set$Xgafv(java.lang.String $Xgafv) {
              return (BatchCreate) super.set$Xgafv($Xgafv);
            }

            @Override
            public BatchCreate setAccessToken(java.lang.String accessToken) {
              return (BatchCreate) super.setAccessToken(accessToken);
            }

            @Override
            public BatchCreate setAlt(java.lang.String alt) {
              return (BatchCreate) super.setAlt(alt);
            }

            @Override
            public BatchCreate setCallback(java.lang.String callback) {
              return (BatchCreate) super.setCallback(callback);
            }

            @Override
            public BatchCreate setFields(java.lang.String fields) {
              return (BatchCreate) super.setFields(fields);
            }

            @Override
            public BatchCreate setKey(java.lang.String key) {
              return (BatchCreate) super.setKey(key);
            }

            @Override
            public BatchCreate setOauthToken(java.lang.String oauthToken) {
              return (BatchCreate) super.setOauthToken(oauthToken);
            }

            @Override
            public BatchCreate setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (BatchCreate) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public BatchCreate setQuotaUser(java.lang.String quotaUser) {
              return (BatchCreate) super.setQuotaUser(quotaUser);
            }

            @Override
            public BatchCreate setUploadType(java.lang.String uploadType) {
              return (BatchCreate) super.setUploadType(uploadType);
            }

            @Override
            public BatchCreate setUploadProtocol(java.lang.String uploadProtocol) {
              return (BatchCreate) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the entity type to create entities in. Format:
             * `projects//agent/entityTypes/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The name of the entity type to create entities in. Format:
           `projects//agent/entityTypes/`.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The name of the entity type to create entities in. Format:
             * `projects//agent/entityTypes/`.
             */
            public BatchCreate setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public BatchCreate set(String parameterName, Object value) {
              return (BatchCreate) super.set(parameterName, value);
            }
          }
          /**
           * Deletes entities in the specified entity type.
           *
           * Operation
           *
           * Create a request for the method "entities.batchDelete".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link BatchDelete#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The name of the entity type to delete entries for. Format:
          `projects//agent/entityTypes/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest}
           * @return the request
           */
          public BatchDelete batchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest content) throws java.io.IOException {
            BatchDelete result = new BatchDelete(parent, content);
            initialize(result);
            return result;
          }

          public class BatchDelete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+parent}/entities:batchDelete";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

            /**
             * Deletes entities in the specified entity type.
             *
             * Operation
             *
             * Create a request for the method "entities.batchDelete".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link BatchDelete#execute()} method to invoke the remote
             * operation. <p> {@link
             * BatchDelete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The name of the entity type to delete entries for. Format:
          `projects//agent/entityTypes/`.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest}
             * @since 1.13
             */
            protected BatchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
            }

            @Override
            public BatchDelete set$Xgafv(java.lang.String $Xgafv) {
              return (BatchDelete) super.set$Xgafv($Xgafv);
            }

            @Override
            public BatchDelete setAccessToken(java.lang.String accessToken) {
              return (BatchDelete) super.setAccessToken(accessToken);
            }

            @Override
            public BatchDelete setAlt(java.lang.String alt) {
              return (BatchDelete) super.setAlt(alt);
            }

            @Override
            public BatchDelete setCallback(java.lang.String callback) {
              return (BatchDelete) super.setCallback(callback);
            }

            @Override
            public BatchDelete setFields(java.lang.String fields) {
              return (BatchDelete) super.setFields(fields);
            }

            @Override
            public BatchDelete setKey(java.lang.String key) {
              return (BatchDelete) super.setKey(key);
            }

            @Override
            public BatchDelete setOauthToken(java.lang.String oauthToken) {
              return (BatchDelete) super.setOauthToken(oauthToken);
            }

            @Override
            public BatchDelete setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (BatchDelete) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public BatchDelete setQuotaUser(java.lang.String quotaUser) {
              return (BatchDelete) super.setQuotaUser(quotaUser);
            }

            @Override
            public BatchDelete setUploadType(java.lang.String uploadType) {
              return (BatchDelete) super.setUploadType(uploadType);
            }

            @Override
            public BatchDelete setUploadProtocol(java.lang.String uploadProtocol) {
              return (BatchDelete) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the entity type to delete entries for. Format:
             * `projects//agent/entityTypes/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The name of the entity type to delete entries for. Format:
           `projects//agent/entityTypes/`.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The name of the entity type to delete entries for. Format:
             * `projects//agent/entityTypes/`.
             */
            public BatchDelete setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public BatchDelete set(String parameterName, Object value) {
              return (BatchDelete) super.set(parameterName, value);
            }
          }
          /**
           * Updates or creates multiple entities in the specified entity type. This method does not affect
           * entities in the entity type that aren't explicitly specified in the request.
           *
           * Operation
           *
           * Create a request for the method "entities.batchUpdate".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link BatchUpdate#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The name of the entity type to update or create entities in.
          Format:
           *        `projects//agent/entityTypes/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest}
           * @return the request
           */
          public BatchUpdate batchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest content) throws java.io.IOException {
            BatchUpdate result = new BatchUpdate(parent, content);
            initialize(result);
            return result;
          }

          public class BatchUpdate extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+parent}/entities:batchUpdate";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/entityTypes/[^/]+$");

            /**
             * Updates or creates multiple entities in the specified entity type. This method does not affect
             * entities in the entity type that aren't explicitly specified in the request.
             *
             * Operation
             *
             * Create a request for the method "entities.batchUpdate".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link BatchUpdate#execute()} method to invoke the remote
             * operation. <p> {@link
             * BatchUpdate#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The name of the entity type to update or create entities in.
          Format:
           *        `projects//agent/entityTypes/`.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest}
             * @since 1.13
             */
            protected BatchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
            }

            @Override
            public BatchUpdate set$Xgafv(java.lang.String $Xgafv) {
              return (BatchUpdate) super.set$Xgafv($Xgafv);
            }

            @Override
            public BatchUpdate setAccessToken(java.lang.String accessToken) {
              return (BatchUpdate) super.setAccessToken(accessToken);
            }

            @Override
            public BatchUpdate setAlt(java.lang.String alt) {
              return (BatchUpdate) super.setAlt(alt);
            }

            @Override
            public BatchUpdate setCallback(java.lang.String callback) {
              return (BatchUpdate) super.setCallback(callback);
            }

            @Override
            public BatchUpdate setFields(java.lang.String fields) {
              return (BatchUpdate) super.setFields(fields);
            }

            @Override
            public BatchUpdate setKey(java.lang.String key) {
              return (BatchUpdate) super.setKey(key);
            }

            @Override
            public BatchUpdate setOauthToken(java.lang.String oauthToken) {
              return (BatchUpdate) super.setOauthToken(oauthToken);
            }

            @Override
            public BatchUpdate setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (BatchUpdate) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public BatchUpdate setQuotaUser(java.lang.String quotaUser) {
              return (BatchUpdate) super.setQuotaUser(quotaUser);
            }

            @Override
            public BatchUpdate setUploadType(java.lang.String uploadType) {
              return (BatchUpdate) super.setUploadType(uploadType);
            }

            @Override
            public BatchUpdate setUploadProtocol(java.lang.String uploadProtocol) {
              return (BatchUpdate) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the entity type to update or create entities in. Format:
             * `projects//agent/entityTypes/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The name of the entity type to update or create entities in. Format:
           `projects//agent/entityTypes/`.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The name of the entity type to update or create entities in. Format:
             * `projects//agent/entityTypes/`.
             */
            public BatchUpdate setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/entityTypes/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public BatchUpdate set(String parameterName, Object value) {
              return (BatchUpdate) super.set(parameterName, value);
            }
          }

        }
      }
      /**
       * An accessor for creating requests from the Environments collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.Environments.List request = dialogflow.environments().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public Environments environments() {
        return new Environments();
      }

      /**
       * The "environments" collection of methods.
       */
      public class Environments {

        /**
         * An accessor for creating requests from the Users collection.
         *
         * <p>The typical use is:</p>
         * <pre>
         *   {@code Dialogflow dialogflow = new Dialogflow(...);}
         *   {@code Dialogflow.Users.List request = dialogflow.users().list(parameters ...)}
         * </pre>
         *
         * @return the resource collection
         */
        public Users users() {
          return new Users();
        }

        /**
         * The "users" collection of methods.
         */
        public class Users {

          /**
           * An accessor for creating requests from the Sessions collection.
           *
           * <p>The typical use is:</p>
           * <pre>
           *   {@code Dialogflow dialogflow = new Dialogflow(...);}
           *   {@code Dialogflow.Sessions.List request = dialogflow.sessions().list(parameters ...)}
           * </pre>
           *
           * @return the resource collection
           */
          public Sessions sessions() {
            return new Sessions();
          }

          /**
           * The "sessions" collection of methods.
           */
          public class Sessions {

            /**
             * Deletes all active contexts in the specified session.
             *
             * Create a request for the method "sessions.deleteContexts".
             *
             * This request holds the parameters needed by the dialogflow server.  After setting any optional
             * parameters, call the {@link DeleteContexts#execute()} method to invoke the remote operation.
             *
             * @param parent Required. The name of the session to delete all contexts from. Format:
            `projects//agent/sessions/`
             *        or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified
             *        we assume default 'draft'
            environment. If `User ID` is not specified, we assume default
             *        '-' user.
             * @return the request
             */
            public DeleteContexts deleteContexts(java.lang.String parent) throws java.io.IOException {
              DeleteContexts result = new DeleteContexts(parent);
              initialize(result);
              return result;
            }

            public class DeleteContexts extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

              private static final String REST_PATH = "v2beta1/{+parent}/contexts";

              private final java.util.regex.Pattern PARENT_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

              /**
               * Deletes all active contexts in the specified session.
               *
               * Create a request for the method "sessions.deleteContexts".
               *
               * This request holds the parameters needed by the the dialogflow server.  After setting any
               * optional parameters, call the {@link DeleteContexts#execute()} method to invoke the remote
               * operation. <p> {@link DeleteContexts#initialize(com.google.api.client.googleapis.services.Abstr
               * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
               * the constructor. </p>
               *
               * @param parent Required. The name of the session to delete all contexts from. Format:
            `projects//agent/sessions/`
             *        or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified
             *        we assume default 'draft'
            environment. If `User ID` is not specified, we assume default
             *        '-' user.
               * @since 1.13
               */
              protected DeleteContexts(java.lang.String parent) {
                super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
                this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                      "Parameter parent must conform to the pattern " +
                      "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                }
              }

              @Override
              public DeleteContexts set$Xgafv(java.lang.String $Xgafv) {
                return (DeleteContexts) super.set$Xgafv($Xgafv);
              }

              @Override
              public DeleteContexts setAccessToken(java.lang.String accessToken) {
                return (DeleteContexts) super.setAccessToken(accessToken);
              }

              @Override
              public DeleteContexts setAlt(java.lang.String alt) {
                return (DeleteContexts) super.setAlt(alt);
              }

              @Override
              public DeleteContexts setCallback(java.lang.String callback) {
                return (DeleteContexts) super.setCallback(callback);
              }

              @Override
              public DeleteContexts setFields(java.lang.String fields) {
                return (DeleteContexts) super.setFields(fields);
              }

              @Override
              public DeleteContexts setKey(java.lang.String key) {
                return (DeleteContexts) super.setKey(key);
              }

              @Override
              public DeleteContexts setOauthToken(java.lang.String oauthToken) {
                return (DeleteContexts) super.setOauthToken(oauthToken);
              }

              @Override
              public DeleteContexts setPrettyPrint(java.lang.Boolean prettyPrint) {
                return (DeleteContexts) super.setPrettyPrint(prettyPrint);
              }

              @Override
              public DeleteContexts setQuotaUser(java.lang.String quotaUser) {
                return (DeleteContexts) super.setQuotaUser(quotaUser);
              }

              @Override
              public DeleteContexts setUploadType(java.lang.String uploadType) {
                return (DeleteContexts) super.setUploadType(uploadType);
              }

              @Override
              public DeleteContexts setUploadProtocol(java.lang.String uploadProtocol) {
                return (DeleteContexts) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * Required. The name of the session to delete all contexts from. Format:
               * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If
               * `Environment ID` is not specified we assume default 'draft' environment. If `User
               * ID` is not specified, we assume default '-' user.
               */
              @com.google.api.client.util.Key
              private java.lang.String parent;

              /** Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/`
             or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume
             default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
               */
              public java.lang.String getParent() {
                return parent;
              }

              /**
               * Required. The name of the session to delete all contexts from. Format:
               * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If
               * `Environment ID` is not specified we assume default 'draft' environment. If `User
               * ID` is not specified, we assume default '-' user.
               */
              public DeleteContexts setParent(java.lang.String parent) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                      "Parameter parent must conform to the pattern " +
                      "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                }
                this.parent = parent;
                return this;
              }

              @Override
              public DeleteContexts set(String parameterName, Object value) {
                return (DeleteContexts) super.set(parameterName, value);
              }
            }
            /**
             * Processes a natural language query and returns structured, actionable data as a result. This
             * method is not idempotent, because it may cause contexts and session entity types to be updated,
             * which in turn might affect results of future queries.
             *
             * Create a request for the method "sessions.detectIntent".
             *
             * This request holds the parameters needed by the dialogflow server.  After setting any optional
             * parameters, call the {@link DetectIntent#execute()} method to invoke the remote operation.
             *
             * @param session Required. The name of the session this query is sent to. Format:
            `projects//agent/sessions/`, or
             *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
             *        assume
            default 'draft' environment. If `User ID` is not specified, we are using
            "-". It’s
             *        up to the API caller to choose an appropriate `Session ID` and
            `User Id`. They can be a
             *        random numbers or some type of user and session
            identifiers (preferably hashed). The
             *        length of the `Session ID` and
            `User ID` must not exceed 36 characters.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest}
             * @return the request
             */
            public DetectIntent detectIntent(java.lang.String session, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest content) throws java.io.IOException {
              DetectIntent result = new DetectIntent(session, content);
              initialize(result);
              return result;
            }

            public class DetectIntent extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentResponse> {

              private static final String REST_PATH = "v2beta1/{+session}:detectIntent";

              private final java.util.regex.Pattern SESSION_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

              /**
               * Processes a natural language query and returns structured, actionable data as a result. This
               * method is not idempotent, because it may cause contexts and session entity types to be updated,
               * which in turn might affect results of future queries.
               *
               * Create a request for the method "sessions.detectIntent".
               *
               * This request holds the parameters needed by the the dialogflow server.  After setting any
               * optional parameters, call the {@link DetectIntent#execute()} method to invoke the remote
               * operation. <p> {@link
               * DetectIntent#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
               * must be called to initialize this instance immediately after invoking the constructor. </p>
               *
               * @param session Required. The name of the session this query is sent to. Format:
            `projects//agent/sessions/`, or
             *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
             *        assume
            default 'draft' environment. If `User ID` is not specified, we are using
            "-". It’s
             *        up to the API caller to choose an appropriate `Session ID` and
            `User Id`. They can be a
             *        random numbers or some type of user and session
            identifiers (preferably hashed). The
             *        length of the `Session ID` and
            `User ID` must not exceed 36 characters.
               * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest}
               * @since 1.13
               */
              protected DetectIntent(java.lang.String session, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest content) {
                super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentResponse.class);
                this.session = com.google.api.client.util.Preconditions.checkNotNull(session, "Required parameter session must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(SESSION_PATTERN.matcher(session).matches(),
                      "Parameter session must conform to the pattern " +
                      "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                }
              }

              @Override
              public DetectIntent set$Xgafv(java.lang.String $Xgafv) {
                return (DetectIntent) super.set$Xgafv($Xgafv);
              }

              @Override
              public DetectIntent setAccessToken(java.lang.String accessToken) {
                return (DetectIntent) super.setAccessToken(accessToken);
              }

              @Override
              public DetectIntent setAlt(java.lang.String alt) {
                return (DetectIntent) super.setAlt(alt);
              }

              @Override
              public DetectIntent setCallback(java.lang.String callback) {
                return (DetectIntent) super.setCallback(callback);
              }

              @Override
              public DetectIntent setFields(java.lang.String fields) {
                return (DetectIntent) super.setFields(fields);
              }

              @Override
              public DetectIntent setKey(java.lang.String key) {
                return (DetectIntent) super.setKey(key);
              }

              @Override
              public DetectIntent setOauthToken(java.lang.String oauthToken) {
                return (DetectIntent) super.setOauthToken(oauthToken);
              }

              @Override
              public DetectIntent setPrettyPrint(java.lang.Boolean prettyPrint) {
                return (DetectIntent) super.setPrettyPrint(prettyPrint);
              }

              @Override
              public DetectIntent setQuotaUser(java.lang.String quotaUser) {
                return (DetectIntent) super.setQuotaUser(quotaUser);
              }

              @Override
              public DetectIntent setUploadType(java.lang.String uploadType) {
                return (DetectIntent) super.setUploadType(uploadType);
              }

              @Override
              public DetectIntent setUploadProtocol(java.lang.String uploadProtocol) {
                return (DetectIntent) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * Required. The name of the session this query is sent to. Format:
               * `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`.
               * If `Environment ID` is not specified, we assume default 'draft' environment. If
               * `User ID` is not specified, we are using "-". It’s up to the API caller to choose
               * an appropriate `Session ID` and `User Id`. They can be a random numbers or some
               * type of user and session identifiers (preferably hashed). The length of the
               * `Session ID` and `User ID` must not exceed 36 characters.
               */
              @com.google.api.client.util.Key
              private java.lang.String session;

              /** Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or
             `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
             default 'draft' environment. If `User ID` is not specified, we are using "-". It’s up to the API
             caller to choose an appropriate `Session ID` and `User Id`. They can be a random numbers or some
             type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User
             ID` must not exceed 36 characters.
               */
              public java.lang.String getSession() {
                return session;
              }

              /**
               * Required. The name of the session this query is sent to. Format:
               * `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`.
               * If `Environment ID` is not specified, we assume default 'draft' environment. If
               * `User ID` is not specified, we are using "-". It’s up to the API caller to choose
               * an appropriate `Session ID` and `User Id`. They can be a random numbers or some
               * type of user and session identifiers (preferably hashed). The length of the
               * `Session ID` and `User ID` must not exceed 36 characters.
               */
              public DetectIntent setSession(java.lang.String session) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(SESSION_PATTERN.matcher(session).matches(),
                      "Parameter session must conform to the pattern " +
                      "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                }
                this.session = session;
                return this;
              }

              @Override
              public DetectIntent set(String parameterName, Object value) {
                return (DetectIntent) super.set(parameterName, value);
              }
            }

            /**
             * An accessor for creating requests from the Contexts collection.
             *
             * <p>The typical use is:</p>
             * <pre>
             *   {@code Dialogflow dialogflow = new Dialogflow(...);}
             *   {@code Dialogflow.Contexts.List request = dialogflow.contexts().list(parameters ...)}
             * </pre>
             *
             * @return the resource collection
             */
            public Contexts contexts() {
              return new Contexts();
            }

            /**
             * The "contexts" collection of methods.
             */
            public class Contexts {

              /**
               * Creates a context.
               *
               * If the specified context already exists, overrides the context.
               *
               * Create a request for the method "contexts.create".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Create#execute()} method to invoke the remote operation.
               *
               * @param parent Required. The session to create a context for.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
               *        assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default '-'
               *        user.
               * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
               * @return the request
               */
              public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) throws java.io.IOException {
                Create result = new Create(parent, content);
                initialize(result);
                return result;
              }

              public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

                private static final String REST_PATH = "v2beta1/{+parent}/contexts";

                private final java.util.regex.Pattern PARENT_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

                /**
                 * Creates a context.
                 *
                 * If the specified context already exists, overrides the context.
                 *
                 * Create a request for the method "contexts.create".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param parent Required. The session to create a context for.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
               *        assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default '-'
               *        user.
                 * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
                 * @since 1.13
                 */
                protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) {
                  super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
                  this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                }

                @Override
                public Create set$Xgafv(java.lang.String $Xgafv) {
                  return (Create) super.set$Xgafv($Xgafv);
                }

                @Override
                public Create setAccessToken(java.lang.String accessToken) {
                  return (Create) super.setAccessToken(accessToken);
                }

                @Override
                public Create setAlt(java.lang.String alt) {
                  return (Create) super.setAlt(alt);
                }

                @Override
                public Create setCallback(java.lang.String callback) {
                  return (Create) super.setCallback(callback);
                }

                @Override
                public Create setFields(java.lang.String fields) {
                  return (Create) super.setFields(fields);
                }

                @Override
                public Create setKey(java.lang.String key) {
                  return (Create) super.setKey(key);
                }

                @Override
                public Create setOauthToken(java.lang.String oauthToken) {
                  return (Create) super.setOauthToken(oauthToken);
                }

                @Override
                public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Create) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Create setQuotaUser(java.lang.String quotaUser) {
                  return (Create) super.setQuotaUser(quotaUser);
                }

                @Override
                public Create setUploadType(java.lang.String uploadType) {
                  return (Create) super.setUploadType(uploadType);
                }

                @Override
                public Create setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Create) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The session to create a context for. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String parent;

                /** Required. The session to create a context for. Format: `projects//agent/sessions/` or
               `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
               default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getParent() {
                  return parent;
                }

                /**
                 * Required. The session to create a context for. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                public Create setParent(java.lang.String parent) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                  this.parent = parent;
                  return this;
                }

                @Override
                public Create set(String parameterName, Object value) {
                  return (Create) super.set(parameterName, value);
                }
              }
              /**
               * Deletes the specified context.
               *
               * Create a request for the method "contexts.delete".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
               *
               * @param name Required. The name of the context to delete. Format:
              `projects//agent/sessions//contexts/`
              or
               *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
              not
               *        specified, we assume default 'draft' environment. If `User ID` is not
              specified, we assume
               *        default '-' user.
               * @return the request
               */
              public Delete delete(java.lang.String name) throws java.io.IOException {
                Delete result = new Delete(name);
                initialize(result);
                return result;
              }

              public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");

                /**
                 * Deletes the specified context.
                 *
                 * Create a request for the method "contexts.delete".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The name of the context to delete. Format:
              `projects//agent/sessions//contexts/`
              or
               *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
              not
               *        specified, we assume default 'draft' environment. If `User ID` is not
              specified, we assume
               *        default '-' user.
                 * @since 1.13
                 */
                protected Delete(java.lang.String name) {
                  super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                }

                @Override
                public Delete set$Xgafv(java.lang.String $Xgafv) {
                  return (Delete) super.set$Xgafv($Xgafv);
                }

                @Override
                public Delete setAccessToken(java.lang.String accessToken) {
                  return (Delete) super.setAccessToken(accessToken);
                }

                @Override
                public Delete setAlt(java.lang.String alt) {
                  return (Delete) super.setAlt(alt);
                }

                @Override
                public Delete setCallback(java.lang.String callback) {
                  return (Delete) super.setCallback(callback);
                }

                @Override
                public Delete setFields(java.lang.String fields) {
                  return (Delete) super.setFields(fields);
                }

                @Override
                public Delete setKey(java.lang.String key) {
                  return (Delete) super.setKey(key);
                }

                @Override
                public Delete setOauthToken(java.lang.String oauthToken) {
                  return (Delete) super.setOauthToken(oauthToken);
                }

                @Override
                public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Delete) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Delete setQuotaUser(java.lang.String quotaUser) {
                  return (Delete) super.setQuotaUser(quotaUser);
                }

                @Override
                public Delete setUploadType(java.lang.String uploadType) {
                  return (Delete) super.setUploadType(uploadType);
                }

                @Override
                public Delete setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Delete) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The name of the context to delete. Format:
                 * `projects//agent/sessions//contexts/` or
                 * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID`
                 * is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or
               `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is not specified,
               we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The name of the context to delete. Format:
                 * `projects//agent/sessions//contexts/` or
                 * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID`
                 * is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                public Delete setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                @Override
                public Delete set(String parameterName, Object value) {
                  return (Delete) super.set(parameterName, value);
                }
              }
              /**
               * Retrieves the specified context.
               *
               * Create a request for the method "contexts.get".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Get#execute()} method to invoke the remote operation.
               *
               * @param name Required. The name of the context. Format:
              `projects//agent/sessions//contexts/`
              or
               *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
              not
               *        specified, we assume default 'draft' environment. If `User ID` is not
              specified, we assume
               *        default '-' user.
               * @return the request
               */
              public Get get(java.lang.String name) throws java.io.IOException {
                Get result = new Get(name);
                initialize(result);
                return result;
              }

              public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");

                /**
                 * Retrieves the specified context.
                 *
                 * Create a request for the method "contexts.get".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
                 * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
                 * must be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The name of the context. Format:
              `projects//agent/sessions//contexts/`
              or
               *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
              not
               *        specified, we assume default 'draft' environment. If `User ID` is not
              specified, we assume
               *        default '-' user.
                 * @since 1.13
                 */
                protected Get(java.lang.String name) {
                  super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                }

                @Override
                public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
                  return super.executeUsingHead();
                }

                @Override
                public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
                  return super.buildHttpRequestUsingHead();
                }

                @Override
                public Get set$Xgafv(java.lang.String $Xgafv) {
                  return (Get) super.set$Xgafv($Xgafv);
                }

                @Override
                public Get setAccessToken(java.lang.String accessToken) {
                  return (Get) super.setAccessToken(accessToken);
                }

                @Override
                public Get setAlt(java.lang.String alt) {
                  return (Get) super.setAlt(alt);
                }

                @Override
                public Get setCallback(java.lang.String callback) {
                  return (Get) super.setCallback(callback);
                }

                @Override
                public Get setFields(java.lang.String fields) {
                  return (Get) super.setFields(fields);
                }

                @Override
                public Get setKey(java.lang.String key) {
                  return (Get) super.setKey(key);
                }

                @Override
                public Get setOauthToken(java.lang.String oauthToken) {
                  return (Get) super.setOauthToken(oauthToken);
                }

                @Override
                public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Get) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Get setQuotaUser(java.lang.String quotaUser) {
                  return (Get) super.setQuotaUser(quotaUser);
                }

                @Override
                public Get setUploadType(java.lang.String uploadType) {
                  return (Get) super.setUploadType(uploadType);
                }

                @Override
                public Get setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Get) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The name of the context. Format: `projects//agent/sessions//contexts/`
                 * or `projects//agent/environments//users//sessions//contexts/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The name of the context. Format: `projects//agent/sessions//contexts/` or
               `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is not specified,
               we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The name of the context. Format: `projects//agent/sessions//contexts/`
                 * or `projects//agent/environments//users//sessions//contexts/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                public Get setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                @Override
                public Get set(String parameterName, Object value) {
                  return (Get) super.set(parameterName, value);
                }
              }
              /**
               * Returns the list of all contexts in the specified session.
               *
               * Create a request for the method "contexts.list".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link List#execute()} method to invoke the remote operation.
               *
               * @param parent Required. The session to list all contexts from.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
               *        assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default '-'
               *        user.
               * @return the request
               */
              public List list(java.lang.String parent) throws java.io.IOException {
                List result = new List(parent);
                initialize(result);
                return result;
              }

              public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListContextsResponse> {

                private static final String REST_PATH = "v2beta1/{+parent}/contexts";

                private final java.util.regex.Pattern PARENT_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

                /**
                 * Returns the list of all contexts in the specified session.
                 *
                 * Create a request for the method "contexts.list".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
                 * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
                 * must be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param parent Required. The session to list all contexts from.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
               *        assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default '-'
               *        user.
                 * @since 1.13
                 */
                protected List(java.lang.String parent) {
                  super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListContextsResponse.class);
                  this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                }

                @Override
                public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
                  return super.executeUsingHead();
                }

                @Override
                public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
                  return super.buildHttpRequestUsingHead();
                }

                @Override
                public List set$Xgafv(java.lang.String $Xgafv) {
                  return (List) super.set$Xgafv($Xgafv);
                }

                @Override
                public List setAccessToken(java.lang.String accessToken) {
                  return (List) super.setAccessToken(accessToken);
                }

                @Override
                public List setAlt(java.lang.String alt) {
                  return (List) super.setAlt(alt);
                }

                @Override
                public List setCallback(java.lang.String callback) {
                  return (List) super.setCallback(callback);
                }

                @Override
                public List setFields(java.lang.String fields) {
                  return (List) super.setFields(fields);
                }

                @Override
                public List setKey(java.lang.String key) {
                  return (List) super.setKey(key);
                }

                @Override
                public List setOauthToken(java.lang.String oauthToken) {
                  return (List) super.setOauthToken(oauthToken);
                }

                @Override
                public List setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (List) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public List setQuotaUser(java.lang.String quotaUser) {
                  return (List) super.setQuotaUser(quotaUser);
                }

                @Override
                public List setUploadType(java.lang.String uploadType) {
                  return (List) super.setUploadType(uploadType);
                }

                @Override
                public List setUploadProtocol(java.lang.String uploadProtocol) {
                  return (List) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The session to list all contexts from. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String parent;

                /** Required. The session to list all contexts from. Format: `projects//agent/sessions/` or
               `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
               default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getParent() {
                  return parent;
                }

                /**
                 * Required. The session to list all contexts from. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                public List setParent(java.lang.String parent) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                  this.parent = parent;
                  return this;
                }

                /**
                 * Optional. The maximum number of items to return in a single page. By default 100
                 * and at most 1000.
                 */
                @com.google.api.client.util.Key
                private java.lang.Integer pageSize;

                /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
                 */
                public java.lang.Integer getPageSize() {
                  return pageSize;
                }

                /**
                 * Optional. The maximum number of items to return in a single page. By default 100
                 * and at most 1000.
                 */
                public List setPageSize(java.lang.Integer pageSize) {
                  this.pageSize = pageSize;
                  return this;
                }

                /** Optional. The next_page_token value returned from a previous list request. */
                @com.google.api.client.util.Key
                private java.lang.String pageToken;

                /** Optional. The next_page_token value returned from a previous list request.
                 */
                public java.lang.String getPageToken() {
                  return pageToken;
                }

                /** Optional. The next_page_token value returned from a previous list request. */
                public List setPageToken(java.lang.String pageToken) {
                  this.pageToken = pageToken;
                  return this;
                }

                @Override
                public List set(String parameterName, Object value) {
                  return (List) super.set(parameterName, value);
                }
              }
              /**
               * Updates the specified context.
               *
               * Create a request for the method "contexts.patch".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
               *
               * @param name Required. The unique identifier of the context. Format:
              `projects//agent/sessions//contexts/`,
              or
               *        `projects//agent/environments//users//sessions//contexts/`.
              The `Context ID` is always
               *        converted to lowercase, may only contain
              characters in a-zA-Z0-9_-% and may be at most 250
               *        bytes long.
              If `Environment ID` is not specified, we assume default 'draft'
              environment.
               *        If `User ID` is not specified, we assume default '-' user.
               * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
               * @return the request
               */
              public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) throws java.io.IOException {
                Patch result = new Patch(name, content);
                initialize(result);
                return result;
              }

              public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");

                /**
                 * Updates the specified context.
                 *
                 * Create a request for the method "contexts.patch".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The unique identifier of the context. Format:
              `projects//agent/sessions//contexts/`,
              or
               *        `projects//agent/environments//users//sessions//contexts/`.
              The `Context ID` is always
               *        converted to lowercase, may only contain
              characters in a-zA-Z0-9_-% and may be at most 250
               *        bytes long.
              If `Environment ID` is not specified, we assume default 'draft'
              environment.
               *        If `User ID` is not specified, we assume default '-' user.
                 * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
                 * @since 1.13
                 */
                protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) {
                  super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                }

                @Override
                public Patch set$Xgafv(java.lang.String $Xgafv) {
                  return (Patch) super.set$Xgafv($Xgafv);
                }

                @Override
                public Patch setAccessToken(java.lang.String accessToken) {
                  return (Patch) super.setAccessToken(accessToken);
                }

                @Override
                public Patch setAlt(java.lang.String alt) {
                  return (Patch) super.setAlt(alt);
                }

                @Override
                public Patch setCallback(java.lang.String callback) {
                  return (Patch) super.setCallback(callback);
                }

                @Override
                public Patch setFields(java.lang.String fields) {
                  return (Patch) super.setFields(fields);
                }

                @Override
                public Patch setKey(java.lang.String key) {
                  return (Patch) super.setKey(key);
                }

                @Override
                public Patch setOauthToken(java.lang.String oauthToken) {
                  return (Patch) super.setOauthToken(oauthToken);
                }

                @Override
                public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Patch) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Patch setQuotaUser(java.lang.String quotaUser) {
                  return (Patch) super.setQuotaUser(quotaUser);
                }

                @Override
                public Patch setUploadType(java.lang.String uploadType) {
                  return (Patch) super.setUploadType(uploadType);
                }

                @Override
                public Patch setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Patch) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The unique identifier of the context. Format:
                 * `projects//agent/sessions//contexts/`, or
                 * `projects//agent/environments//users//sessions//contexts/`.
                 *
                 * The `Context ID` is always converted to lowercase, may only contain characters in
                 * a-zA-Z0-9_-% and may be at most 250 bytes long.
                 *
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or
               `projects//agent/environments//users//sessions//contexts/`.

               The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and
               may be at most 250 bytes long.

               If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not
               specified, we assume default '-' user.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The unique identifier of the context. Format:
                 * `projects//agent/sessions//contexts/`, or
                 * `projects//agent/environments//users//sessions//contexts/`.
                 *
                 * The `Context ID` is always converted to lowercase, may only contain characters in
                 * a-zA-Z0-9_-% and may be at most 250 bytes long.
                 *
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                public Patch setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                /** Optional. The mask to control which fields get updated. */
                @com.google.api.client.util.Key
                private String updateMask;

                /** Optional. The mask to control which fields get updated.
                 */
                public String getUpdateMask() {
                  return updateMask;
                }

                /** Optional. The mask to control which fields get updated. */
                public Patch setUpdateMask(String updateMask) {
                  this.updateMask = updateMask;
                  return this;
                }

                @Override
                public Patch set(String parameterName, Object value) {
                  return (Patch) super.set(parameterName, value);
                }
              }

            }
            /**
             * An accessor for creating requests from the EntityTypes collection.
             *
             * <p>The typical use is:</p>
             * <pre>
             *   {@code Dialogflow dialogflow = new Dialogflow(...);}
             *   {@code Dialogflow.EntityTypes.List request = dialogflow.entityTypes().list(parameters ...)}
             * </pre>
             *
             * @return the resource collection
             */
            public EntityTypes entityTypes() {
              return new EntityTypes();
            }

            /**
             * The "entityTypes" collection of methods.
             */
            public class EntityTypes {

              /**
               * Creates a session entity type.
               *
               * If the specified session entity type already exists, overrides the session entity type.
               *
               * Create a request for the method "entityTypes.create".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Create#execute()} method to invoke the remote operation.
               *
               * @param parent Required. The session to create a session entity type for.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//
              sessions/`. If `Environment ID` is not specified,
               *        we assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default
               *        '-' user.
               * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
               * @return the request
               */
              public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) throws java.io.IOException {
                Create result = new Create(parent, content);
                initialize(result);
                return result;
              }

              public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

                private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

                private final java.util.regex.Pattern PARENT_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

                /**
                 * Creates a session entity type.
                 *
                 * If the specified session entity type already exists, overrides the session entity type.
                 *
                 * Create a request for the method "entityTypes.create".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param parent Required. The session to create a session entity type for.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//
              sessions/`. If `Environment ID` is not specified,
               *        we assume
              default 'draft' environment. If `User ID` is not specified, we assume
              default
               *        '-' user.
                 * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
                 * @since 1.13
                 */
                protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) {
                  super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
                  this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                }

                @Override
                public Create set$Xgafv(java.lang.String $Xgafv) {
                  return (Create) super.set$Xgafv($Xgafv);
                }

                @Override
                public Create setAccessToken(java.lang.String accessToken) {
                  return (Create) super.setAccessToken(accessToken);
                }

                @Override
                public Create setAlt(java.lang.String alt) {
                  return (Create) super.setAlt(alt);
                }

                @Override
                public Create setCallback(java.lang.String callback) {
                  return (Create) super.setCallback(callback);
                }

                @Override
                public Create setFields(java.lang.String fields) {
                  return (Create) super.setFields(fields);
                }

                @Override
                public Create setKey(java.lang.String key) {
                  return (Create) super.setKey(key);
                }

                @Override
                public Create setOauthToken(java.lang.String oauthToken) {
                  return (Create) super.setOauthToken(oauthToken);
                }

                @Override
                public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Create) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Create setQuotaUser(java.lang.String quotaUser) {
                  return (Create) super.setQuotaUser(quotaUser);
                }

                @Override
                public Create setUploadType(java.lang.String uploadType) {
                  return (Create) super.setUploadType(uploadType);
                }

                @Override
                public Create setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Create) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The session to create a session entity type for. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String parent;

                /** Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or
               `projects//agent/environments//users// sessions/`. If `Environment ID` is not specified, we assume
               default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getParent() {
                  return parent;
                }

                /**
                 * Required. The session to create a session entity type for. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                public Create setParent(java.lang.String parent) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                  this.parent = parent;
                  return this;
                }

                @Override
                public Create set(String parameterName, Object value) {
                  return (Create) super.set(parameterName, value);
                }
              }
              /**
               * Deletes the specified session entity type.
               *
               * Create a request for the method "entityTypes.delete".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
               *
               * @param name Required. The name of the entity type to delete. Format:
              `projects//agent/sessions//entityTypes/` or
               *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
               * @return the request
               */
              public Delete delete(java.lang.String name) throws java.io.IOException {
                Delete result = new Delete(name);
                initialize(result);
                return result;
              }

              public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");

                /**
                 * Deletes the specified session entity type.
                 *
                 * Create a request for the method "entityTypes.delete".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The name of the entity type to delete. Format:
              `projects//agent/sessions//entityTypes/` or
               *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
                 * @since 1.13
                 */
                protected Delete(java.lang.String name) {
                  super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                }

                @Override
                public Delete set$Xgafv(java.lang.String $Xgafv) {
                  return (Delete) super.set$Xgafv($Xgafv);
                }

                @Override
                public Delete setAccessToken(java.lang.String accessToken) {
                  return (Delete) super.setAccessToken(accessToken);
                }

                @Override
                public Delete setAlt(java.lang.String alt) {
                  return (Delete) super.setAlt(alt);
                }

                @Override
                public Delete setCallback(java.lang.String callback) {
                  return (Delete) super.setCallback(callback);
                }

                @Override
                public Delete setFields(java.lang.String fields) {
                  return (Delete) super.setFields(fields);
                }

                @Override
                public Delete setKey(java.lang.String key) {
                  return (Delete) super.setKey(key);
                }

                @Override
                public Delete setOauthToken(java.lang.String oauthToken) {
                  return (Delete) super.setOauthToken(oauthToken);
                }

                @Override
                public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Delete) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Delete setQuotaUser(java.lang.String quotaUser) {
                  return (Delete) super.setQuotaUser(quotaUser);
                }

                @Override
                public Delete setUploadType(java.lang.String uploadType) {
                  return (Delete) super.setUploadType(uploadType);
                }

                @Override
                public Delete setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Delete) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The name of the entity type to delete. Format:
                 * `projects//agent/sessions//entityTypes/` or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/`
               or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
               '-' user.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The name of the entity type to delete. Format:
                 * `projects//agent/sessions//entityTypes/` or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                public Delete setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                @Override
                public Delete set(String parameterName, Object value) {
                  return (Delete) super.set(parameterName, value);
                }
              }
              /**
               * Retrieves the specified session entity type.
               *
               * Create a request for the method "entityTypes.get".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Get#execute()} method to invoke the remote operation.
               *
               * @param name Required. The name of the session entity type. Format:
              `projects//agent/sessions//entityTypes/` or
               *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
               * @return the request
               */
              public Get get(java.lang.String name) throws java.io.IOException {
                Get result = new Get(name);
                initialize(result);
                return result;
              }

              public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");

                /**
                 * Retrieves the specified session entity type.
                 *
                 * Create a request for the method "entityTypes.get".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
                 * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
                 * must be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The name of the session entity type. Format:
              `projects//agent/sessions//entityTypes/` or
               *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
                 * @since 1.13
                 */
                protected Get(java.lang.String name) {
                  super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                }

                @Override
                public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
                  return super.executeUsingHead();
                }

                @Override
                public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
                  return super.buildHttpRequestUsingHead();
                }

                @Override
                public Get set$Xgafv(java.lang.String $Xgafv) {
                  return (Get) super.set$Xgafv($Xgafv);
                }

                @Override
                public Get setAccessToken(java.lang.String accessToken) {
                  return (Get) super.setAccessToken(accessToken);
                }

                @Override
                public Get setAlt(java.lang.String alt) {
                  return (Get) super.setAlt(alt);
                }

                @Override
                public Get setCallback(java.lang.String callback) {
                  return (Get) super.setCallback(callback);
                }

                @Override
                public Get setFields(java.lang.String fields) {
                  return (Get) super.setFields(fields);
                }

                @Override
                public Get setKey(java.lang.String key) {
                  return (Get) super.setKey(key);
                }

                @Override
                public Get setOauthToken(java.lang.String oauthToken) {
                  return (Get) super.setOauthToken(oauthToken);
                }

                @Override
                public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Get) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Get setQuotaUser(java.lang.String quotaUser) {
                  return (Get) super.setQuotaUser(quotaUser);
                }

                @Override
                public Get setUploadType(java.lang.String uploadType) {
                  return (Get) super.setUploadType(uploadType);
                }

                @Override
                public Get setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Get) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The name of the session entity type. Format:
                 * `projects//agent/sessions//entityTypes/` or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or
               `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
               '-' user.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The name of the session entity type. Format:
                 * `projects//agent/sessions//entityTypes/` or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 */
                public Get setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                @Override
                public Get set(String parameterName, Object value) {
                  return (Get) super.set(parameterName, value);
                }
              }
              /**
               * Returns the list of all session entity types in the specified session.
               *
               * Create a request for the method "entityTypes.list".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link List#execute()} method to invoke the remote operation.
               *
               * @param parent Required. The session to list all session entity types from.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//
              sessions/`.
              If `Environment ID` is not specified,
               *        we assume default 'draft'
              environment. If `User ID` is not specified, we assume default
               *        '-' user.
               * @return the request
               */
              public List list(java.lang.String parent) throws java.io.IOException {
                List result = new List(parent);
                initialize(result);
                return result;
              }

              public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> {

                private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

                private final java.util.regex.Pattern PARENT_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");

                /**
                 * Returns the list of all session entity types in the specified session.
                 *
                 * Create a request for the method "entityTypes.list".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
                 * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
                 * must be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param parent Required. The session to list all session entity types from.
              Format: `projects//agent/sessions/` or
               *        `projects//agent/environments//users//
              sessions/`.
              If `Environment ID` is not specified,
               *        we assume default 'draft'
              environment. If `User ID` is not specified, we assume default
               *        '-' user.
                 * @since 1.13
                 */
                protected List(java.lang.String parent) {
                  super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.class);
                  this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                }

                @Override
                public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
                  return super.executeUsingHead();
                }

                @Override
                public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
                  return super.buildHttpRequestUsingHead();
                }

                @Override
                public List set$Xgafv(java.lang.String $Xgafv) {
                  return (List) super.set$Xgafv($Xgafv);
                }

                @Override
                public List setAccessToken(java.lang.String accessToken) {
                  return (List) super.setAccessToken(accessToken);
                }

                @Override
                public List setAlt(java.lang.String alt) {
                  return (List) super.setAlt(alt);
                }

                @Override
                public List setCallback(java.lang.String callback) {
                  return (List) super.setCallback(callback);
                }

                @Override
                public List setFields(java.lang.String fields) {
                  return (List) super.setFields(fields);
                }

                @Override
                public List setKey(java.lang.String key) {
                  return (List) super.setKey(key);
                }

                @Override
                public List setOauthToken(java.lang.String oauthToken) {
                  return (List) super.setOauthToken(oauthToken);
                }

                @Override
                public List setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (List) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public List setQuotaUser(java.lang.String quotaUser) {
                  return (List) super.setQuotaUser(quotaUser);
                }

                @Override
                public List setUploadType(java.lang.String uploadType) {
                  return (List) super.setUploadType(uploadType);
                }

                @Override
                public List setUploadProtocol(java.lang.String uploadProtocol) {
                  return (List) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The session to list all session entity types from. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                @com.google.api.client.util.Key
                private java.lang.String parent;

                /** Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or
               `projects//agent/environments//users// sessions/`. If `Environment ID` is not specified, we assume
               default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
                 */
                public java.lang.String getParent() {
                  return parent;
                }

                /**
                 * Required. The session to list all session entity types from. Format:
                 * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`.
                 * If `Environment ID` is not specified, we assume default 'draft' environment. If
                 * `User ID` is not specified, we assume default '-' user.
                 */
                public List setParent(java.lang.String parent) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                        "Parameter parent must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+$");
                  }
                  this.parent = parent;
                  return this;
                }

                /**
                 * Optional. The maximum number of items to return in a single page. By default 100
                 * and at most 1000.
                 */
                @com.google.api.client.util.Key
                private java.lang.Integer pageSize;

                /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
                 */
                public java.lang.Integer getPageSize() {
                  return pageSize;
                }

                /**
                 * Optional. The maximum number of items to return in a single page. By default 100
                 * and at most 1000.
                 */
                public List setPageSize(java.lang.Integer pageSize) {
                  this.pageSize = pageSize;
                  return this;
                }

                /** Optional. The next_page_token value returned from a previous list request. */
                @com.google.api.client.util.Key
                private java.lang.String pageToken;

                /** Optional. The next_page_token value returned from a previous list request.
                 */
                public java.lang.String getPageToken() {
                  return pageToken;
                }

                /** Optional. The next_page_token value returned from a previous list request. */
                public List setPageToken(java.lang.String pageToken) {
                  this.pageToken = pageToken;
                  return this;
                }

                @Override
                public List set(String parameterName, Object value) {
                  return (List) super.set(parameterName, value);
                }
              }
              /**
               * Updates the specified session entity type.
               *
               * Create a request for the method "entityTypes.patch".
               *
               * This request holds the parameters needed by the dialogflow server.  After setting any optional
               * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
               *
               * @param name Required. The unique identifier of this session entity type. Format:
               *        `projects//agent/sessions//entityTypes/`, or
               *        `projects//agent/environments//users//sessions//entityTypes/`.
              If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
              `` must be the display name of an existing entity
              type in the same agent
               *        that will be overridden or supplemented.
               * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
               * @return the request
               */
              public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) throws java.io.IOException {
                Patch result = new Patch(name, content);
                initialize(result);
                return result;
              }

              public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

                private static final String REST_PATH = "v2beta1/{+name}";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");

                /**
                 * Updates the specified session entity type.
                 *
                 * Create a request for the method "entityTypes.patch".
                 *
                 * This request holds the parameters needed by the the dialogflow server.  After setting any
                 * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name Required. The unique identifier of this session entity type. Format:
               *        `projects//agent/sessions//entityTypes/`, or
               *        `projects//agent/environments//users//sessions//entityTypes/`.
              If `Environment ID` is not
               *        specified, we assume default 'draft'
              environment. If `User ID` is not specified, we assume
               *        default '-' user.
              `` must be the display name of an existing entity
              type in the same agent
               *        that will be overridden or supplemented.
                 * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
                 * @since 1.13
                 */
                protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) {
                  super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                }

                @Override
                public Patch set$Xgafv(java.lang.String $Xgafv) {
                  return (Patch) super.set$Xgafv($Xgafv);
                }

                @Override
                public Patch setAccessToken(java.lang.String accessToken) {
                  return (Patch) super.setAccessToken(accessToken);
                }

                @Override
                public Patch setAlt(java.lang.String alt) {
                  return (Patch) super.setAlt(alt);
                }

                @Override
                public Patch setCallback(java.lang.String callback) {
                  return (Patch) super.setCallback(callback);
                }

                @Override
                public Patch setFields(java.lang.String fields) {
                  return (Patch) super.setFields(fields);
                }

                @Override
                public Patch setKey(java.lang.String key) {
                  return (Patch) super.setKey(key);
                }

                @Override
                public Patch setOauthToken(java.lang.String oauthToken) {
                  return (Patch) super.setOauthToken(oauthToken);
                }

                @Override
                public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
                  return (Patch) super.setPrettyPrint(prettyPrint);
                }

                @Override
                public Patch setQuotaUser(java.lang.String quotaUser) {
                  return (Patch) super.setQuotaUser(quotaUser);
                }

                @Override
                public Patch setUploadType(java.lang.String uploadType) {
                  return (Patch) super.setUploadType(uploadType);
                }

                @Override
                public Patch setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Patch) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The unique identifier of this session entity type. Format:
                 * `projects//agent/sessions//entityTypes/`, or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 *
                 * `` must be the display name of an existing entity type in the same agent that
                 * will be overridden or supplemented.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The unique identifier of this session entity type. Format:
               `projects//agent/sessions//entityTypes/`, or
               `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
               specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
               '-' user.

               `` must be the display name of an existing entity type in the same agent that will be overridden or
               supplemented.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The unique identifier of this session entity type. Format:
                 * `projects//agent/sessions//entityTypes/`, or
                 * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment
                 * ID` is not specified, we assume default 'draft' environment. If `User ID` is not
                 * specified, we assume default '-' user.
                 *
                 * `` must be the display name of an existing entity type in the same agent that
                 * will be overridden or supplemented.
                 */
                public Patch setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                /** Optional. The mask to control which fields get updated. */
                @com.google.api.client.util.Key
                private String updateMask;

                /** Optional. The mask to control which fields get updated.
                 */
                public String getUpdateMask() {
                  return updateMask;
                }

                /** Optional. The mask to control which fields get updated. */
                public Patch setUpdateMask(String updateMask) {
                  this.updateMask = updateMask;
                  return this;
                }

                @Override
                public Patch set(String parameterName, Object value) {
                  return (Patch) super.set(parameterName, value);
                }
              }

            }
          }
        }
      }
      /**
       * An accessor for creating requests from the Intents collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.Intents.List request = dialogflow.intents().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public Intents intents() {
        return new Intents();
      }

      /**
       * The "intents" collection of methods.
       */
      public class Intents {

        /**
         * Deletes intents in the specified agent.
         *
         * Operation
         *
         * Create a request for the method "intents.batchDelete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link BatchDelete#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The name of the agent to delete all entities types for. Format:
        `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest}
         * @return the request
         */
        public BatchDelete batchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest content) throws java.io.IOException {
          BatchDelete result = new BatchDelete(parent, content);
          initialize(result);
          return result;
        }

        public class BatchDelete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+parent}/intents:batchDelete";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Deletes intents in the specified agent.
           *
           * Operation
           *
           * Create a request for the method "intents.batchDelete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link BatchDelete#execute()} method to invoke the remote
           * operation. <p> {@link
           * BatchDelete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The name of the agent to delete all entities types for. Format:
        `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest}
           * @since 1.13
           */
          protected BatchDelete(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public BatchDelete set$Xgafv(java.lang.String $Xgafv) {
            return (BatchDelete) super.set$Xgafv($Xgafv);
          }

          @Override
          public BatchDelete setAccessToken(java.lang.String accessToken) {
            return (BatchDelete) super.setAccessToken(accessToken);
          }

          @Override
          public BatchDelete setAlt(java.lang.String alt) {
            return (BatchDelete) super.setAlt(alt);
          }

          @Override
          public BatchDelete setCallback(java.lang.String callback) {
            return (BatchDelete) super.setCallback(callback);
          }

          @Override
          public BatchDelete setFields(java.lang.String fields) {
            return (BatchDelete) super.setFields(fields);
          }

          @Override
          public BatchDelete setKey(java.lang.String key) {
            return (BatchDelete) super.setKey(key);
          }

          @Override
          public BatchDelete setOauthToken(java.lang.String oauthToken) {
            return (BatchDelete) super.setOauthToken(oauthToken);
          }

          @Override
          public BatchDelete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (BatchDelete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public BatchDelete setQuotaUser(java.lang.String quotaUser) {
            return (BatchDelete) super.setQuotaUser(quotaUser);
          }

          @Override
          public BatchDelete setUploadType(java.lang.String uploadType) {
            return (BatchDelete) super.setUploadType(uploadType);
          }

          @Override
          public BatchDelete setUploadProtocol(java.lang.String uploadProtocol) {
            return (BatchDelete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the agent to delete all entities types for. Format:
           * `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The name of the agent to delete all entities types for. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The name of the agent to delete all entities types for. Format:
           * `projects//agent`.
           */
          public BatchDelete setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public BatchDelete set(String parameterName, Object value) {
            return (BatchDelete) super.set(parameterName, value);
          }
        }
        /**
         * Updates/Creates multiple intents in the specified agent.
         *
         * Operation
         *
         * Create a request for the method "intents.batchUpdate".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link BatchUpdate#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The name of the agent to update or create intents in.
        Format: `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest}
         * @return the request
         */
        public BatchUpdate batchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest content) throws java.io.IOException {
          BatchUpdate result = new BatchUpdate(parent, content);
          initialize(result);
          return result;
        }

        public class BatchUpdate extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+parent}/intents:batchUpdate";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Updates/Creates multiple intents in the specified agent.
           *
           * Operation
           *
           * Create a request for the method "intents.batchUpdate".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link BatchUpdate#execute()} method to invoke the remote
           * operation. <p> {@link
           * BatchUpdate#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The name of the agent to update or create intents in.
        Format: `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest}
           * @since 1.13
           */
          protected BatchUpdate(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public BatchUpdate set$Xgafv(java.lang.String $Xgafv) {
            return (BatchUpdate) super.set$Xgafv($Xgafv);
          }

          @Override
          public BatchUpdate setAccessToken(java.lang.String accessToken) {
            return (BatchUpdate) super.setAccessToken(accessToken);
          }

          @Override
          public BatchUpdate setAlt(java.lang.String alt) {
            return (BatchUpdate) super.setAlt(alt);
          }

          @Override
          public BatchUpdate setCallback(java.lang.String callback) {
            return (BatchUpdate) super.setCallback(callback);
          }

          @Override
          public BatchUpdate setFields(java.lang.String fields) {
            return (BatchUpdate) super.setFields(fields);
          }

          @Override
          public BatchUpdate setKey(java.lang.String key) {
            return (BatchUpdate) super.setKey(key);
          }

          @Override
          public BatchUpdate setOauthToken(java.lang.String oauthToken) {
            return (BatchUpdate) super.setOauthToken(oauthToken);
          }

          @Override
          public BatchUpdate setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (BatchUpdate) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public BatchUpdate setQuotaUser(java.lang.String quotaUser) {
            return (BatchUpdate) super.setQuotaUser(quotaUser);
          }

          @Override
          public BatchUpdate setUploadType(java.lang.String uploadType) {
            return (BatchUpdate) super.setUploadType(uploadType);
          }

          @Override
          public BatchUpdate setUploadProtocol(java.lang.String uploadProtocol) {
            return (BatchUpdate) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the agent to update or create intents in. Format:
           * `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The name of the agent to update or create intents in. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The name of the agent to update or create intents in. Format:
           * `projects//agent`.
           */
          public BatchUpdate setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public BatchUpdate set(String parameterName, Object value) {
            return (BatchUpdate) super.set(parameterName, value);
          }
        }
        /**
         * Creates an intent in the specified agent.
         *
         * Create a request for the method "intents.create".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The agent to create a intent for.
        Format: `projects//agent`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent> {

          private static final String REST_PATH = "v2beta1/{+parent}/intents";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Creates an intent in the specified agent.
           *
           * Create a request for the method "intents.create".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           * <p> {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The agent to create a intent for.
        Format: `projects//agent`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public Create set$Xgafv(java.lang.String $Xgafv) {
            return (Create) super.set$Xgafv($Xgafv);
          }

          @Override
          public Create setAccessToken(java.lang.String accessToken) {
            return (Create) super.setAccessToken(accessToken);
          }

          @Override
          public Create setAlt(java.lang.String alt) {
            return (Create) super.setAlt(alt);
          }

          @Override
          public Create setCallback(java.lang.String callback) {
            return (Create) super.setCallback(callback);
          }

          @Override
          public Create setFields(java.lang.String fields) {
            return (Create) super.setFields(fields);
          }

          @Override
          public Create setKey(java.lang.String key) {
            return (Create) super.setKey(key);
          }

          @Override
          public Create setOauthToken(java.lang.String oauthToken) {
            return (Create) super.setOauthToken(oauthToken);
          }

          @Override
          public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Create) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Create setQuotaUser(java.lang.String quotaUser) {
            return (Create) super.setQuotaUser(quotaUser);
          }

          @Override
          public Create setUploadType(java.lang.String uploadType) {
            return (Create) super.setUploadType(uploadType);
          }

          @Override
          public Create setUploadProtocol(java.lang.String uploadProtocol) {
            return (Create) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The agent to create a intent for. Format: `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The agent to create a intent for. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The agent to create a intent for. Format: `projects//agent`.
           */
          public Create setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          /** Optional. The resource view to apply to the returned intent. */
          @com.google.api.client.util.Key
          private java.lang.String intentView;

          /** Optional. The resource view to apply to the returned intent.
           */
          public java.lang.String getIntentView() {
            return intentView;
          }

          /** Optional. The resource view to apply to the returned intent. */
          public Create setIntentView(java.lang.String intentView) {
            this.intentView = intentView;
            return this;
          }

          /**
           * Optional. The language of training phrases, parameters and rich messages defined in
           * `intent`. If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language of training phrases, parameters and rich messages defined in `intent`. If
         not specified, the agent's default language is used. [Many languages](https://cloud.google.com
         /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be enabled in
         the agent before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language of training phrases, parameters and rich messages defined in
           * `intent`. If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          public Create setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          @Override
          public Create set(String parameterName, Object value) {
            return (Create) super.set(parameterName, value);
          }
        }
        /**
         * Deletes the specified intent and its direct or indirect followup intents.
         *
         * Create a request for the method "intents.delete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the intent to delete. If this intent has direct or
        indirect followup intents,
         *        we also delete them.
        Format: `projects//agent/intents/`.
         * @return the request
         */
        public Delete delete(java.lang.String name) throws java.io.IOException {
          Delete result = new Delete(name);
          initialize(result);
          return result;
        }

        public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/intents/[^/]+$");

          /**
           * Deletes the specified intent and its direct or indirect followup intents.
           *
           * Create a request for the method "intents.delete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           * <p> {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the intent to delete. If this intent has direct or
        indirect followup intents,
         *        we also delete them.
        Format: `projects//agent/intents/`.
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
          }

          @Override
          public Delete set$Xgafv(java.lang.String $Xgafv) {
            return (Delete) super.set$Xgafv($Xgafv);
          }

          @Override
          public Delete setAccessToken(java.lang.String accessToken) {
            return (Delete) super.setAccessToken(accessToken);
          }

          @Override
          public Delete setAlt(java.lang.String alt) {
            return (Delete) super.setAlt(alt);
          }

          @Override
          public Delete setCallback(java.lang.String callback) {
            return (Delete) super.setCallback(callback);
          }

          @Override
          public Delete setFields(java.lang.String fields) {
            return (Delete) super.setFields(fields);
          }

          @Override
          public Delete setKey(java.lang.String key) {
            return (Delete) super.setKey(key);
          }

          @Override
          public Delete setOauthToken(java.lang.String oauthToken) {
            return (Delete) super.setOauthToken(oauthToken);
          }

          @Override
          public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Delete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Delete setQuotaUser(java.lang.String quotaUser) {
            return (Delete) super.setQuotaUser(quotaUser);
          }

          @Override
          public Delete setUploadType(java.lang.String uploadType) {
            return (Delete) super.setUploadType(uploadType);
          }

          @Override
          public Delete setUploadProtocol(java.lang.String uploadProtocol) {
            return (Delete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the intent to delete. If this intent has direct or indirect
           * followup intents, we also delete them.
           *
           * Format: `projects//agent/intents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the intent to delete. If this intent has direct or indirect followup intents,
         we also delete them.

         Format: `projects//agent/intents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the intent to delete. If this intent has direct or indirect
           * followup intents, we also delete them.
           *
           * Format: `projects//agent/intents/`.
           */
          public Delete setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Retrieves the specified intent.
         *
         * Create a request for the method "intents.get".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the intent.
        Format: `projects//agent/intents/`.
         * @return the request
         */
        public Get get(java.lang.String name) throws java.io.IOException {
          Get result = new Get(name);
          initialize(result);
          return result;
        }

        public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/intents/[^/]+$");

          /**
           * Retrieves the specified intent.
           *
           * Create a request for the method "intents.get".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the intent.
        Format: `projects//agent/intents/`.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public Get set$Xgafv(java.lang.String $Xgafv) {
            return (Get) super.set$Xgafv($Xgafv);
          }

          @Override
          public Get setAccessToken(java.lang.String accessToken) {
            return (Get) super.setAccessToken(accessToken);
          }

          @Override
          public Get setAlt(java.lang.String alt) {
            return (Get) super.setAlt(alt);
          }

          @Override
          public Get setCallback(java.lang.String callback) {
            return (Get) super.setCallback(callback);
          }

          @Override
          public Get setFields(java.lang.String fields) {
            return (Get) super.setFields(fields);
          }

          @Override
          public Get setKey(java.lang.String key) {
            return (Get) super.setKey(key);
          }

          @Override
          public Get setOauthToken(java.lang.String oauthToken) {
            return (Get) super.setOauthToken(oauthToken);
          }

          @Override
          public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Get) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Get setQuotaUser(java.lang.String quotaUser) {
            return (Get) super.setQuotaUser(quotaUser);
          }

          @Override
          public Get setUploadType(java.lang.String uploadType) {
            return (Get) super.setUploadType(uploadType);
          }

          @Override
          public Get setUploadProtocol(java.lang.String uploadProtocol) {
            return (Get) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the intent. Format: `projects//agent/intents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the intent. Format: `projects//agent/intents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the intent. Format: `projects//agent/intents/`.
           */
          public Get setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /** Optional. The resource view to apply to the returned intent. */
          @com.google.api.client.util.Key
          private java.lang.String intentView;

          /** Optional. The resource view to apply to the returned intent.
           */
          public java.lang.String getIntentView() {
            return intentView;
          }

          /** Optional. The resource view to apply to the returned intent. */
          public Get setIntentView(java.lang.String intentView) {
            this.intentView = intentView;
            return this;
          }

          /**
           * Optional. The language to retrieve training phrases, parameters and rich messages for.
           * If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language to retrieve training phrases, parameters and rich messages for. If not
         specified, the agent's default language is used. [Many languages](https://cloud.google.com
         /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be enabled in
         the agent before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language to retrieve training phrases, parameters and rich messages for.
           * If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          public Get setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Returns the list of all intents in the specified agent.
         *
         * Create a request for the method "intents.list".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The agent to list all intents from.
        Format: `projects//agent`.
         * @return the request
         */
        public List list(java.lang.String parent) throws java.io.IOException {
          List result = new List(parent);
          initialize(result);
          return result;
        }

        public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListIntentsResponse> {

          private static final String REST_PATH = "v2beta1/{+parent}/intents";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Returns the list of all intents in the specified agent.
           *
           * Create a request for the method "intents.list".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The agent to list all intents from.
        Format: `projects//agent`.
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListIntentsResponse.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public List set$Xgafv(java.lang.String $Xgafv) {
            return (List) super.set$Xgafv($Xgafv);
          }

          @Override
          public List setAccessToken(java.lang.String accessToken) {
            return (List) super.setAccessToken(accessToken);
          }

          @Override
          public List setAlt(java.lang.String alt) {
            return (List) super.setAlt(alt);
          }

          @Override
          public List setCallback(java.lang.String callback) {
            return (List) super.setCallback(callback);
          }

          @Override
          public List setFields(java.lang.String fields) {
            return (List) super.setFields(fields);
          }

          @Override
          public List setKey(java.lang.String key) {
            return (List) super.setKey(key);
          }

          @Override
          public List setOauthToken(java.lang.String oauthToken) {
            return (List) super.setOauthToken(oauthToken);
          }

          @Override
          public List setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (List) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public List setQuotaUser(java.lang.String quotaUser) {
            return (List) super.setQuotaUser(quotaUser);
          }

          @Override
          public List setUploadType(java.lang.String uploadType) {
            return (List) super.setUploadType(uploadType);
          }

          @Override
          public List setUploadProtocol(java.lang.String uploadProtocol) {
            return (List) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The agent to list all intents from. Format: `projects//agent`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The agent to list all intents from. Format: `projects//agent`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The agent to list all intents from. Format: `projects//agent`.
           */
          public List setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          /** Optional. The resource view to apply to the returned intent. */
          @com.google.api.client.util.Key
          private java.lang.String intentView;

          /** Optional. The resource view to apply to the returned intent.
           */
          public java.lang.String getIntentView() {
            return intentView;
          }

          /** Optional. The resource view to apply to the returned intent. */
          public List setIntentView(java.lang.String intentView) {
            this.intentView = intentView;
            return this;
          }

          /**
           * Optional. The language to list training phrases, parameters and rich messages for. If
           * not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language to list training phrases, parameters and rich messages for. If not
         specified, the agent's default language is used. [Many languages](https://cloud.google.com
         /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be enabled in
         the agent before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language to list training phrases, parameters and rich messages for. If
           * not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          public List setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 100 and at
           * most 1000.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 100 and at
           * most 1000.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** Optional. The next_page_token value returned from a previous list request.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          public List setPageToken(java.lang.String pageToken) {
            this.pageToken = pageToken;
            return this;
          }

          @Override
          public List set(String parameterName, Object value) {
            return (List) super.set(parameterName, value);
          }
        }
        /**
         * Updates the specified intent.
         *
         * Create a request for the method "intents.patch".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         *
         * @param name The unique identifier of this intent.
        Required for Intents.UpdateIntent and
         *        Intents.BatchUpdateIntents
        methods.
        Format: `projects//agent/intents/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent}
         * @return the request
         */
        public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent content) throws java.io.IOException {
          Patch result = new Patch(name, content);
          initialize(result);
          return result;
        }

        public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/intents/[^/]+$");

          /**
           * Updates the specified intent.
           *
           * Create a request for the method "intents.patch".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           * <p> {@link
           * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The unique identifier of this intent.
        Required for Intents.UpdateIntent and
         *        Intents.BatchUpdateIntents
        methods.
        Format: `projects//agent/intents/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent}
           * @since 1.13
           */
          protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent content) {
            super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Intent.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
          }

          @Override
          public Patch set$Xgafv(java.lang.String $Xgafv) {
            return (Patch) super.set$Xgafv($Xgafv);
          }

          @Override
          public Patch setAccessToken(java.lang.String accessToken) {
            return (Patch) super.setAccessToken(accessToken);
          }

          @Override
          public Patch setAlt(java.lang.String alt) {
            return (Patch) super.setAlt(alt);
          }

          @Override
          public Patch setCallback(java.lang.String callback) {
            return (Patch) super.setCallback(callback);
          }

          @Override
          public Patch setFields(java.lang.String fields) {
            return (Patch) super.setFields(fields);
          }

          @Override
          public Patch setKey(java.lang.String key) {
            return (Patch) super.setKey(key);
          }

          @Override
          public Patch setOauthToken(java.lang.String oauthToken) {
            return (Patch) super.setOauthToken(oauthToken);
          }

          @Override
          public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Patch) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Patch setQuotaUser(java.lang.String quotaUser) {
            return (Patch) super.setQuotaUser(quotaUser);
          }

          @Override
          public Patch setUploadType(java.lang.String uploadType) {
            return (Patch) super.setUploadType(uploadType);
          }

          @Override
          public Patch setUploadProtocol(java.lang.String uploadProtocol) {
            return (Patch) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The unique identifier of this intent. Required for Intents.UpdateIntent and
           * Intents.BatchUpdateIntents methods. Format: `projects//agent/intents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The unique identifier of this intent. Required for Intents.UpdateIntent and
         Intents.BatchUpdateIntents methods. Format: `projects//agent/intents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The unique identifier of this intent. Required for Intents.UpdateIntent and
           * Intents.BatchUpdateIntents methods. Format: `projects//agent/intents/`.
           */
          public Patch setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/intents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /** Optional. The resource view to apply to the returned intent. */
          @com.google.api.client.util.Key
          private java.lang.String intentView;

          /** Optional. The resource view to apply to the returned intent.
           */
          public java.lang.String getIntentView() {
            return intentView;
          }

          /** Optional. The resource view to apply to the returned intent. */
          public Patch setIntentView(java.lang.String intentView) {
            this.intentView = intentView;
            return this;
          }

          /**
           * Optional. The language of training phrases, parameters and rich messages defined in
           * `intent`. If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          @com.google.api.client.util.Key
          private java.lang.String languageCode;

          /** Optional. The language of training phrases, parameters and rich messages defined in `intent`. If
         not specified, the agent's default language is used. [Many languages](https://cloud.google.com
         /dialogflow-enterprise/docs/reference/language) are supported. Note: languages must be enabled in
         the agent before they can be used.
           */
          public java.lang.String getLanguageCode() {
            return languageCode;
          }

          /**
           * Optional. The language of training phrases, parameters and rich messages defined in
           * `intent`. If not specified, the agent's default language is used. [Many
           * languages](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) are
           * supported. Note: languages must be enabled in the agent before they can be used.
           */
          public Patch setLanguageCode(java.lang.String languageCode) {
            this.languageCode = languageCode;
            return this;
          }

          /** Optional. The mask to control which fields get updated. */
          @com.google.api.client.util.Key
          private String updateMask;

          /** Optional. The mask to control which fields get updated.
           */
          public String getUpdateMask() {
            return updateMask;
          }

          /** Optional. The mask to control which fields get updated. */
          public Patch setUpdateMask(String updateMask) {
            this.updateMask = updateMask;
            return this;
          }

          @Override
          public Patch set(String parameterName, Object value) {
            return (Patch) super.set(parameterName, value);
          }
        }

      }
      /**
       * An accessor for creating requests from the KnowledgeBases collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.KnowledgeBases.List request = dialogflow.knowledgeBases().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public KnowledgeBases knowledgeBases() {
        return new KnowledgeBases();
      }

      /**
       * The "knowledgeBases" collection of methods.
       */
      public class KnowledgeBases {

        /**
         * Creates a knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.create".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The project to create a knowledge base for.
        Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

          private static final String REST_PATH = "v2beta1/{+parent}/knowledgeBases";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Creates a knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
           * `projects.knowledgeBases`.
           *
           * Create a request for the method "knowledgeBases.create".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           * <p> {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The project to create a knowledge base for.
        Format: `projects/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public Create set$Xgafv(java.lang.String $Xgafv) {
            return (Create) super.set$Xgafv($Xgafv);
          }

          @Override
          public Create setAccessToken(java.lang.String accessToken) {
            return (Create) super.setAccessToken(accessToken);
          }

          @Override
          public Create setAlt(java.lang.String alt) {
            return (Create) super.setAlt(alt);
          }

          @Override
          public Create setCallback(java.lang.String callback) {
            return (Create) super.setCallback(callback);
          }

          @Override
          public Create setFields(java.lang.String fields) {
            return (Create) super.setFields(fields);
          }

          @Override
          public Create setKey(java.lang.String key) {
            return (Create) super.setKey(key);
          }

          @Override
          public Create setOauthToken(java.lang.String oauthToken) {
            return (Create) super.setOauthToken(oauthToken);
          }

          @Override
          public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Create) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Create setQuotaUser(java.lang.String quotaUser) {
            return (Create) super.setQuotaUser(quotaUser);
          }

          @Override
          public Create setUploadType(java.lang.String uploadType) {
            return (Create) super.setUploadType(uploadType);
          }

          @Override
          public Create setUploadProtocol(java.lang.String uploadProtocol) {
            return (Create) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The project to create a knowledge base for. Format: `projects/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The project to create a knowledge base for. Format: `projects/`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The project to create a knowledge base for. Format: `projects/`.
           */
          public Create setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public Create set(String parameterName, Object value) {
            return (Create) super.set(parameterName, value);
          }
        }
        /**
         * Deletes the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.delete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the knowledge base to delete.
        Format: `projects//knowledgeBases/`.
         * @return the request
         */
        public Delete delete(java.lang.String name) throws java.io.IOException {
          Delete result = new Delete(name);
          initialize(result);
          return result;
        }

        public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+$");

          /**
           * Deletes the specified knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
           * `projects.knowledgeBases`.
           *
           * Create a request for the method "knowledgeBases.delete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           * <p> {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the knowledge base to delete.
        Format: `projects//knowledgeBases/`.
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
          }

          @Override
          public Delete set$Xgafv(java.lang.String $Xgafv) {
            return (Delete) super.set$Xgafv($Xgafv);
          }

          @Override
          public Delete setAccessToken(java.lang.String accessToken) {
            return (Delete) super.setAccessToken(accessToken);
          }

          @Override
          public Delete setAlt(java.lang.String alt) {
            return (Delete) super.setAlt(alt);
          }

          @Override
          public Delete setCallback(java.lang.String callback) {
            return (Delete) super.setCallback(callback);
          }

          @Override
          public Delete setFields(java.lang.String fields) {
            return (Delete) super.setFields(fields);
          }

          @Override
          public Delete setKey(java.lang.String key) {
            return (Delete) super.setKey(key);
          }

          @Override
          public Delete setOauthToken(java.lang.String oauthToken) {
            return (Delete) super.setOauthToken(oauthToken);
          }

          @Override
          public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Delete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Delete setQuotaUser(java.lang.String quotaUser) {
            return (Delete) super.setQuotaUser(quotaUser);
          }

          @Override
          public Delete setUploadType(java.lang.String uploadType) {
            return (Delete) super.setUploadType(uploadType);
          }

          @Override
          public Delete setUploadProtocol(java.lang.String uploadProtocol) {
            return (Delete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the knowledge base to delete. Format:
           * `projects//knowledgeBases/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the knowledge base to delete. Format: `projects//knowledgeBases/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the knowledge base to delete. Format:
           * `projects//knowledgeBases/`.
           */
          public Delete setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. Force deletes the knowledge base. When set to true, any documents in the
           * knowledge base are also deleted.
           */
          @com.google.api.client.util.Key
          private java.lang.Boolean force;

          /** Optional. Force deletes the knowledge base. When set to true, any documents in the knowledge base
         are also deleted.
           */
          public java.lang.Boolean getForce() {
            return force;
          }

          /**
           * Optional. Force deletes the knowledge base. When set to true, any documents in the
           * knowledge base are also deleted.
           */
          public Delete setForce(java.lang.Boolean force) {
            this.force = force;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Retrieves the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.get".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the knowledge base to retrieve.
        Format `projects//knowledgeBases/`.
         * @return the request
         */
        public Get get(java.lang.String name) throws java.io.IOException {
          Get result = new Get(name);
          initialize(result);
          return result;
        }

        public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+$");

          /**
           * Retrieves the specified knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
           * `projects.knowledgeBases`.
           *
           * Create a request for the method "knowledgeBases.get".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the knowledge base to retrieve.
        Format `projects//knowledgeBases/`.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public Get set$Xgafv(java.lang.String $Xgafv) {
            return (Get) super.set$Xgafv($Xgafv);
          }

          @Override
          public Get setAccessToken(java.lang.String accessToken) {
            return (Get) super.setAccessToken(accessToken);
          }

          @Override
          public Get setAlt(java.lang.String alt) {
            return (Get) super.setAlt(alt);
          }

          @Override
          public Get setCallback(java.lang.String callback) {
            return (Get) super.setCallback(callback);
          }

          @Override
          public Get setFields(java.lang.String fields) {
            return (Get) super.setFields(fields);
          }

          @Override
          public Get setKey(java.lang.String key) {
            return (Get) super.setKey(key);
          }

          @Override
          public Get setOauthToken(java.lang.String oauthToken) {
            return (Get) super.setOauthToken(oauthToken);
          }

          @Override
          public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Get) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Get setQuotaUser(java.lang.String quotaUser) {
            return (Get) super.setQuotaUser(quotaUser);
          }

          @Override
          public Get setUploadType(java.lang.String uploadType) {
            return (Get) super.setUploadType(uploadType);
          }

          @Override
          public Get setUploadProtocol(java.lang.String uploadProtocol) {
            return (Get) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the knowledge base to retrieve. Format
           * `projects//knowledgeBases/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the knowledge base to retrieve. Format `projects//knowledgeBases/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the knowledge base to retrieve. Format
           * `projects//knowledgeBases/`.
           */
          public Get setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Returns the list of all knowledge bases of the specified agent.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.list".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The project to list of knowledge bases for.
        Format: `projects/`.
         * @return the request
         */
        public List list(java.lang.String parent) throws java.io.IOException {
          List result = new List(parent);
          initialize(result);
          return result;
        }

        public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse> {

          private static final String REST_PATH = "v2beta1/{+parent}/knowledgeBases";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent$");

          /**
           * Returns the list of all knowledge bases of the specified agent.
           *
           * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
           * `projects.knowledgeBases`.
           *
           * Create a request for the method "knowledgeBases.list".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The project to list of knowledge bases for.
        Format: `projects/`.
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public List set$Xgafv(java.lang.String $Xgafv) {
            return (List) super.set$Xgafv($Xgafv);
          }

          @Override
          public List setAccessToken(java.lang.String accessToken) {
            return (List) super.setAccessToken(accessToken);
          }

          @Override
          public List setAlt(java.lang.String alt) {
            return (List) super.setAlt(alt);
          }

          @Override
          public List setCallback(java.lang.String callback) {
            return (List) super.setCallback(callback);
          }

          @Override
          public List setFields(java.lang.String fields) {
            return (List) super.setFields(fields);
          }

          @Override
          public List setKey(java.lang.String key) {
            return (List) super.setKey(key);
          }

          @Override
          public List setOauthToken(java.lang.String oauthToken) {
            return (List) super.setOauthToken(oauthToken);
          }

          @Override
          public List setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (List) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public List setQuotaUser(java.lang.String quotaUser) {
            return (List) super.setQuotaUser(quotaUser);
          }

          @Override
          public List setUploadType(java.lang.String uploadType) {
            return (List) super.setUploadType(uploadType);
          }

          @Override
          public List setUploadProtocol(java.lang.String uploadProtocol) {
            return (List) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The project to list of knowledge bases for. Format: `projects/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The project to list of knowledge bases for. Format: `projects/`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The project to list of knowledge bases for. Format: `projects/`.
           */
          public List setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 10 and at
           * most 100.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** Optional. The maximum number of items to return in a single page. By default 10 and at most 100.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 10 and at
           * most 100.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** Optional. The next_page_token value returned from a previous list request.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          public List setPageToken(java.lang.String pageToken) {
            this.pageToken = pageToken;
            return this;
          }

          @Override
          public List set(String parameterName, Object value) {
            return (List) super.set(parameterName, value);
          }
        }
        /**
         * Updates the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.patch".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         *
         * @param name The knowledge base resource name.
        The name must be empty when creating a knowledge base.
        Format:
         *        `projects//knowledgeBases/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
         * @return the request
         */
        public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) throws java.io.IOException {
          Patch result = new Patch(name, content);
          initialize(result);
          return result;
        }

        public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+$");

          /**
           * Updates the specified knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
           * `projects.knowledgeBases`.
           *
           * Create a request for the method "knowledgeBases.patch".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           * <p> {@link
           * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The knowledge base resource name.
        The name must be empty when creating a knowledge base.
        Format:
         *        `projects//knowledgeBases/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
           * @since 1.13
           */
          protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) {
            super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
          }

          @Override
          public Patch set$Xgafv(java.lang.String $Xgafv) {
            return (Patch) super.set$Xgafv($Xgafv);
          }

          @Override
          public Patch setAccessToken(java.lang.String accessToken) {
            return (Patch) super.setAccessToken(accessToken);
          }

          @Override
          public Patch setAlt(java.lang.String alt) {
            return (Patch) super.setAlt(alt);
          }

          @Override
          public Patch setCallback(java.lang.String callback) {
            return (Patch) super.setCallback(callback);
          }

          @Override
          public Patch setFields(java.lang.String fields) {
            return (Patch) super.setFields(fields);
          }

          @Override
          public Patch setKey(java.lang.String key) {
            return (Patch) super.setKey(key);
          }

          @Override
          public Patch setOauthToken(java.lang.String oauthToken) {
            return (Patch) super.setOauthToken(oauthToken);
          }

          @Override
          public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Patch) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Patch setQuotaUser(java.lang.String quotaUser) {
            return (Patch) super.setQuotaUser(quotaUser);
          }

          @Override
          public Patch setUploadType(java.lang.String uploadType) {
            return (Patch) super.setUploadType(uploadType);
          }

          @Override
          public Patch setUploadProtocol(java.lang.String uploadProtocol) {
            return (Patch) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The knowledge base resource name. The name must be empty when creating a knowledge
           * base. Format: `projects//knowledgeBases/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The knowledge base resource name. The name must be empty when creating a knowledge base. Format:
         `projects//knowledgeBases/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The knowledge base resource name. The name must be empty when creating a knowledge
           * base. Format: `projects//knowledgeBases/`.
           */
          public Patch setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. Not specified means `update all`. Currently, only `display_name` can be
           * updated, an InvalidArgument will be returned for attempting to update other fields.
           */
          @com.google.api.client.util.Key
          private String updateMask;

          /** Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an
         InvalidArgument will be returned for attempting to update other fields.
           */
          public String getUpdateMask() {
            return updateMask;
          }

          /**
           * Optional. Not specified means `update all`. Currently, only `display_name` can be
           * updated, an InvalidArgument will be returned for attempting to update other fields.
           */
          public Patch setUpdateMask(String updateMask) {
            this.updateMask = updateMask;
            return this;
          }

          @Override
          public Patch set(String parameterName, Object value) {
            return (Patch) super.set(parameterName, value);
          }
        }

        /**
         * An accessor for creating requests from the Documents collection.
         *
         * <p>The typical use is:</p>
         * <pre>
         *   {@code Dialogflow dialogflow = new Dialogflow(...);}
         *   {@code Dialogflow.Documents.List request = dialogflow.documents().list(parameters ...)}
         * </pre>
         *
         * @return the resource collection
         */
        public Documents documents() {
          return new Documents();
        }

        /**
         * The "documents" collection of methods.
         */
        public class Documents {

          /**
           * Creates a new document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.create".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The knoweldge base to create a document for.
          Format: `projects//knowledgeBases/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
           * @return the request
           */
          public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) throws java.io.IOException {
            Create result = new Create(parent, content);
            initialize(result);
            return result;
          }

          public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+parent}/documents";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+$");

            /**
             * Creates a new document.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Operation
             *
             * Create a request for the method "documents.create".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
             * <p> {@link
             * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The knoweldge base to create a document for.
          Format: `projects//knowledgeBases/`.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
             * @since 1.13
             */
            protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
              }
            }

            @Override
            public Create set$Xgafv(java.lang.String $Xgafv) {
              return (Create) super.set$Xgafv($Xgafv);
            }

            @Override
            public Create setAccessToken(java.lang.String accessToken) {
              return (Create) super.setAccessToken(accessToken);
            }

            @Override
            public Create setAlt(java.lang.String alt) {
              return (Create) super.setAlt(alt);
            }

            @Override
            public Create setCallback(java.lang.String callback) {
              return (Create) super.setCallback(callback);
            }

            @Override
            public Create setFields(java.lang.String fields) {
              return (Create) super.setFields(fields);
            }

            @Override
            public Create setKey(java.lang.String key) {
              return (Create) super.setKey(key);
            }

            @Override
            public Create setOauthToken(java.lang.String oauthToken) {
              return (Create) super.setOauthToken(oauthToken);
            }

            @Override
            public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Create) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Create setQuotaUser(java.lang.String quotaUser) {
              return (Create) super.setQuotaUser(quotaUser);
            }

            @Override
            public Create setUploadType(java.lang.String uploadType) {
              return (Create) super.setUploadType(uploadType);
            }

            @Override
            public Create setUploadProtocol(java.lang.String uploadProtocol) {
              return (Create) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The knoweldge base to create a document for. Format:
             * `projects//knowledgeBases/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The knoweldge base to create a document for. Format: `projects//knowledgeBases/`.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The knoweldge base to create a document for. Format:
             * `projects//knowledgeBases/`.
             */
            public Create setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public Create set(String parameterName, Object value) {
              return (Create) super.set(parameterName, value);
            }
          }
          /**
           * Deletes the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.delete".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name The name of the document to delete.
          Format: `projects//knowledgeBases//documents/`.
           * @return the request
           */
          public Delete delete(java.lang.String name) throws java.io.IOException {
            Delete result = new Delete(name);
            initialize(result);
            return result;
          }

          public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");

            /**
             * Deletes the specified document.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Operation
             *
             * Create a request for the method "documents.delete".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             * <p> {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name The name of the document to delete.
          Format: `projects//knowledgeBases//documents/`.
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
            }

            @Override
            public Delete set$Xgafv(java.lang.String $Xgafv) {
              return (Delete) super.set$Xgafv($Xgafv);
            }

            @Override
            public Delete setAccessToken(java.lang.String accessToken) {
              return (Delete) super.setAccessToken(accessToken);
            }

            @Override
            public Delete setAlt(java.lang.String alt) {
              return (Delete) super.setAlt(alt);
            }

            @Override
            public Delete setCallback(java.lang.String callback) {
              return (Delete) super.setCallback(callback);
            }

            @Override
            public Delete setFields(java.lang.String fields) {
              return (Delete) super.setFields(fields);
            }

            @Override
            public Delete setKey(java.lang.String key) {
              return (Delete) super.setKey(key);
            }

            @Override
            public Delete setOauthToken(java.lang.String oauthToken) {
              return (Delete) super.setOauthToken(oauthToken);
            }

            @Override
            public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Delete) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Delete setQuotaUser(java.lang.String quotaUser) {
              return (Delete) super.setQuotaUser(quotaUser);
            }

            @Override
            public Delete setUploadType(java.lang.String uploadType) {
              return (Delete) super.setUploadType(uploadType);
            }

            @Override
            public Delete setUploadProtocol(java.lang.String uploadProtocol) {
              return (Delete) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
             */
            public Delete setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Delete set(String parameterName, Object value) {
              return (Delete) super.set(parameterName, value);
            }
          }
          /**
           * Retrieves the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Create a request for the method "documents.get".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Get#execute()} method to invoke the remote operation.
           *
           * @param name Required. The name of the document to retrieve.
          Format `projects//knowledgeBases//documents/`.
           * @return the request
           */
          public Get get(java.lang.String name) throws java.io.IOException {
            Get result = new Get(name);
            initialize(result);
            return result;
          }

          public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");

            /**
             * Retrieves the specified document.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Create a request for the method "documents.get".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
             * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The name of the document to retrieve.
          Format `projects//knowledgeBases//documents/`.
             * @since 1.13
             */
            protected Get(java.lang.String name) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public Get set$Xgafv(java.lang.String $Xgafv) {
              return (Get) super.set$Xgafv($Xgafv);
            }

            @Override
            public Get setAccessToken(java.lang.String accessToken) {
              return (Get) super.setAccessToken(accessToken);
            }

            @Override
            public Get setAlt(java.lang.String alt) {
              return (Get) super.setAlt(alt);
            }

            @Override
            public Get setCallback(java.lang.String callback) {
              return (Get) super.setCallback(callback);
            }

            @Override
            public Get setFields(java.lang.String fields) {
              return (Get) super.setFields(fields);
            }

            @Override
            public Get setKey(java.lang.String key) {
              return (Get) super.setKey(key);
            }

            @Override
            public Get setOauthToken(java.lang.String oauthToken) {
              return (Get) super.setOauthToken(oauthToken);
            }

            @Override
            public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Get) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Get setQuotaUser(java.lang.String quotaUser) {
              return (Get) super.setQuotaUser(quotaUser);
            }

            @Override
            public Get setUploadType(java.lang.String uploadType) {
              return (Get) super.setUploadType(uploadType);
            }

            @Override
            public Get setUploadProtocol(java.lang.String uploadProtocol) {
              return (Get) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the document to retrieve. Format
             * `projects//knowledgeBases//documents/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The name of the document to retrieve. Format `projects//knowledgeBases//documents/`.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The name of the document to retrieve. Format
             * `projects//knowledgeBases//documents/`.
             */
            public Get setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Get set(String parameterName, Object value) {
              return (Get) super.set(parameterName, value);
            }
          }
          /**
           * Returns the list of all documents of the knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Create a request for the method "documents.list".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link List#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The knowledge base to list all documents for.
          Format: `projects//knowledgeBases/`.
           * @return the request
           */
          public List list(java.lang.String parent) throws java.io.IOException {
            List result = new List(parent);
            initialize(result);
            return result;
          }

          public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListDocumentsResponse> {

            private static final String REST_PATH = "v2beta1/{+parent}/documents";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+$");

            /**
             * Returns the list of all documents of the knowledge base.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Create a request for the method "documents.list".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
             * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The knowledge base to list all documents for.
          Format: `projects//knowledgeBases/`.
             * @since 1.13
             */
            protected List(java.lang.String parent) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListDocumentsResponse.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public List set$Xgafv(java.lang.String $Xgafv) {
              return (List) super.set$Xgafv($Xgafv);
            }

            @Override
            public List setAccessToken(java.lang.String accessToken) {
              return (List) super.setAccessToken(accessToken);
            }

            @Override
            public List setAlt(java.lang.String alt) {
              return (List) super.setAlt(alt);
            }

            @Override
            public List setCallback(java.lang.String callback) {
              return (List) super.setCallback(callback);
            }

            @Override
            public List setFields(java.lang.String fields) {
              return (List) super.setFields(fields);
            }

            @Override
            public List setKey(java.lang.String key) {
              return (List) super.setKey(key);
            }

            @Override
            public List setOauthToken(java.lang.String oauthToken) {
              return (List) super.setOauthToken(oauthToken);
            }

            @Override
            public List setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (List) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public List setQuotaUser(java.lang.String quotaUser) {
              return (List) super.setQuotaUser(quotaUser);
            }

            @Override
            public List setUploadType(java.lang.String uploadType) {
              return (List) super.setUploadType(uploadType);
            }

            @Override
            public List setUploadProtocol(java.lang.String uploadProtocol) {
              return (List) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The knowledge base to list all documents for. Format:
             * `projects//knowledgeBases/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The knowledge base to list all documents for. Format: `projects//knowledgeBases/`.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The knowledge base to list all documents for. Format:
             * `projects//knowledgeBases/`.
             */
            public List setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 10 and
             * at most 100.
             */
            @com.google.api.client.util.Key
            private java.lang.Integer pageSize;

            /** Optional. The maximum number of items to return in a single page. By default 10 and at most 100.
             */
            public java.lang.Integer getPageSize() {
              return pageSize;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 10 and
             * at most 100.
             */
            public List setPageSize(java.lang.Integer pageSize) {
              this.pageSize = pageSize;
              return this;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            @com.google.api.client.util.Key
            private java.lang.String pageToken;

            /** Optional. The next_page_token value returned from a previous list request.
             */
            public java.lang.String getPageToken() {
              return pageToken;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            public List setPageToken(java.lang.String pageToken) {
              this.pageToken = pageToken;
              return this;
            }

            @Override
            public List set(String parameterName, Object value) {
              return (List) super.set(parameterName, value);
            }
          }
          /**
           * Updates the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.patch".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           *
           * @param name The document resource name.
          The name must be empty when creating a document.
          Format:
           *        `projects//knowledgeBases//documents/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
           * @return the request
           */
          public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) throws java.io.IOException {
            Patch result = new Patch(name, content);
            initialize(result);
            return result;
          }

          public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");

            /**
             * Updates the specified document.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Operation
             *
             * Create a request for the method "documents.patch".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
             * <p> {@link
             * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name The document resource name.
          The name must be empty when creating a document.
          Format:
           *        `projects//knowledgeBases//documents/`.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
             * @since 1.13
             */
            protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) {
              super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
            }

            @Override
            public Patch set$Xgafv(java.lang.String $Xgafv) {
              return (Patch) super.set$Xgafv($Xgafv);
            }

            @Override
            public Patch setAccessToken(java.lang.String accessToken) {
              return (Patch) super.setAccessToken(accessToken);
            }

            @Override
            public Patch setAlt(java.lang.String alt) {
              return (Patch) super.setAlt(alt);
            }

            @Override
            public Patch setCallback(java.lang.String callback) {
              return (Patch) super.setCallback(callback);
            }

            @Override
            public Patch setFields(java.lang.String fields) {
              return (Patch) super.setFields(fields);
            }

            @Override
            public Patch setKey(java.lang.String key) {
              return (Patch) super.setKey(key);
            }

            @Override
            public Patch setOauthToken(java.lang.String oauthToken) {
              return (Patch) super.setOauthToken(oauthToken);
            }

            @Override
            public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Patch) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Patch setQuotaUser(java.lang.String quotaUser) {
              return (Patch) super.setQuotaUser(quotaUser);
            }

            @Override
            public Patch setUploadType(java.lang.String uploadType) {
              return (Patch) super.setUploadType(uploadType);
            }

            @Override
            public Patch setUploadProtocol(java.lang.String uploadProtocol) {
              return (Patch) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * The document resource name. The name must be empty when creating a document. Format:
             * `projects//knowledgeBases//documents/`.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** The document resource name. The name must be empty when creating a document. Format:
           `projects//knowledgeBases//documents/`.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * The document resource name. The name must be empty when creating a document. Format:
             * `projects//knowledgeBases//documents/`.
             */
            public Patch setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
              this.name = name;
              return this;
            }

            /**
             * Optional. Not specified means `update all`. Currently, only `display_name` can be
             * updated, an InvalidArgument will be returned for attempting to update other fields.
             */
            @com.google.api.client.util.Key
            private String updateMask;

            /** Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an
           InvalidArgument will be returned for attempting to update other fields.
             */
            public String getUpdateMask() {
              return updateMask;
            }

            /**
             * Optional. Not specified means `update all`. Currently, only `display_name` can be
             * updated, an InvalidArgument will be returned for attempting to update other fields.
             */
            public Patch setUpdateMask(String updateMask) {
              this.updateMask = updateMask;
              return this;
            }

            @Override
            public Patch set(String parameterName, Object value) {
              return (Patch) super.set(parameterName, value);
            }
          }
          /**
           * Reloads the specified document from its specified source, content_uri or content. The previously
           * loaded content of the document will be deleted. Note: Even when the content of the document has
           * not changed, there still may be side effects because of internal implementation changes.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.reload".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Reload#execute()} method to invoke the remote operation.
           *
           * @param name The name of the document to reload.
          Format: `projects//knowledgeBases//documents/`
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest}
           * @return the request
           */
          public Reload reload(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest content) throws java.io.IOException {
            Reload result = new Reload(name, content);
            initialize(result);
            return result;
          }

          public class Reload extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v2beta1/{+name}:reload";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");

            /**
             * Reloads the specified document from its specified source, content_uri or content. The
             * previously loaded content of the document will be deleted. Note: Even when the content of the
             * document has not changed, there still may be side effects because of internal implementation
             * changes.
             *
             * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
             * `projects.knowledgeBases.documents`.
             *
             * Operation
             *
             * Create a request for the method "documents.reload".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Reload#execute()} method to invoke the remote operation.
             * <p> {@link
             * Reload#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name The name of the document to reload.
          Format: `projects//knowledgeBases//documents/`
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest}
             * @since 1.13
             */
            protected Reload(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
            }

            @Override
            public Reload set$Xgafv(java.lang.String $Xgafv) {
              return (Reload) super.set$Xgafv($Xgafv);
            }

            @Override
            public Reload setAccessToken(java.lang.String accessToken) {
              return (Reload) super.setAccessToken(accessToken);
            }

            @Override
            public Reload setAlt(java.lang.String alt) {
              return (Reload) super.setAlt(alt);
            }

            @Override
            public Reload setCallback(java.lang.String callback) {
              return (Reload) super.setCallback(callback);
            }

            @Override
            public Reload setFields(java.lang.String fields) {
              return (Reload) super.setFields(fields);
            }

            @Override
            public Reload setKey(java.lang.String key) {
              return (Reload) super.setKey(key);
            }

            @Override
            public Reload setOauthToken(java.lang.String oauthToken) {
              return (Reload) super.setOauthToken(oauthToken);
            }

            @Override
            public Reload setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Reload) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Reload setQuotaUser(java.lang.String quotaUser) {
              return (Reload) super.setQuotaUser(quotaUser);
            }

            @Override
            public Reload setUploadType(java.lang.String uploadType) {
              return (Reload) super.setUploadType(uploadType);
            }

            @Override
            public Reload setUploadProtocol(java.lang.String uploadProtocol) {
              return (Reload) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * The name of the document to reload. Format: `projects//knowledgeBases//documents/`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** The name of the document to reload. Format: `projects//knowledgeBases//documents/`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * The name of the document to reload. Format: `projects//knowledgeBases//documents/`
             */
            public Reload setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Reload set(String parameterName, Object value) {
              return (Reload) super.set(parameterName, value);
            }
          }

        }
      }
      /**
       * An accessor for creating requests from the Sessions collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.Sessions.List request = dialogflow.sessions().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public Sessions sessions() {
        return new Sessions();
      }

      /**
       * The "sessions" collection of methods.
       */
      public class Sessions {

        /**
         * Deletes all active contexts in the specified session.
         *
         * Create a request for the method "sessions.deleteContexts".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link DeleteContexts#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The name of the session to delete all contexts from. Format:
        `projects//agent/sessions/`
         *        or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified
         *        we assume default 'draft'
        environment. If `User ID` is not specified, we assume default
         *        '-' user.
         * @return the request
         */
        public DeleteContexts deleteContexts(java.lang.String parent) throws java.io.IOException {
          DeleteContexts result = new DeleteContexts(parent);
          initialize(result);
          return result;
        }

        public class DeleteContexts extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

          private static final String REST_PATH = "v2beta1/{+parent}/contexts";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

          /**
           * Deletes all active contexts in the specified session.
           *
           * Create a request for the method "sessions.deleteContexts".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link DeleteContexts#execute()} method to invoke the remote
           * operation. <p> {@link DeleteContexts#initialize(com.google.api.client.googleapis.services.Abstr
           * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
           * the constructor. </p>
           *
           * @param parent Required. The name of the session to delete all contexts from. Format:
        `projects//agent/sessions/`
         *        or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified
         *        we assume default 'draft'
        environment. If `User ID` is not specified, we assume default
         *        '-' user.
           * @since 1.13
           */
          protected DeleteContexts(java.lang.String parent) {
            super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent/sessions/[^/]+$");
            }
          }

          @Override
          public DeleteContexts set$Xgafv(java.lang.String $Xgafv) {
            return (DeleteContexts) super.set$Xgafv($Xgafv);
          }

          @Override
          public DeleteContexts setAccessToken(java.lang.String accessToken) {
            return (DeleteContexts) super.setAccessToken(accessToken);
          }

          @Override
          public DeleteContexts setAlt(java.lang.String alt) {
            return (DeleteContexts) super.setAlt(alt);
          }

          @Override
          public DeleteContexts setCallback(java.lang.String callback) {
            return (DeleteContexts) super.setCallback(callback);
          }

          @Override
          public DeleteContexts setFields(java.lang.String fields) {
            return (DeleteContexts) super.setFields(fields);
          }

          @Override
          public DeleteContexts setKey(java.lang.String key) {
            return (DeleteContexts) super.setKey(key);
          }

          @Override
          public DeleteContexts setOauthToken(java.lang.String oauthToken) {
            return (DeleteContexts) super.setOauthToken(oauthToken);
          }

          @Override
          public DeleteContexts setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (DeleteContexts) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public DeleteContexts setQuotaUser(java.lang.String quotaUser) {
            return (DeleteContexts) super.setQuotaUser(quotaUser);
          }

          @Override
          public DeleteContexts setUploadType(java.lang.String uploadType) {
            return (DeleteContexts) super.setUploadType(uploadType);
          }

          @Override
          public DeleteContexts setUploadProtocol(java.lang.String uploadProtocol) {
            return (DeleteContexts) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the session to delete all contexts from. Format:
           * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If
           * `Environment ID` is not specified we assume default 'draft' environment. If `User ID`
           * is not specified, we assume default '-' user.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/`
         or `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified we assume
         default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The name of the session to delete all contexts from. Format:
           * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. If
           * `Environment ID` is not specified we assume default 'draft' environment. If `User ID`
           * is not specified, we assume default '-' user.
           */
          public DeleteContexts setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/agent/sessions/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public DeleteContexts set(String parameterName, Object value) {
            return (DeleteContexts) super.set(parameterName, value);
          }
        }
        /**
         * Processes a natural language query and returns structured, actionable data as a result. This
         * method is not idempotent, because it may cause contexts and session entity types to be updated,
         * which in turn might affect results of future queries.
         *
         * Create a request for the method "sessions.detectIntent".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link DetectIntent#execute()} method to invoke the remote operation.
         *
         * @param session Required. The name of the session this query is sent to. Format:
        `projects//agent/sessions/`, or
         *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
         *        assume
        default 'draft' environment. If `User ID` is not specified, we are using
        "-". It’s
         *        up to the API caller to choose an appropriate `Session ID` and
        `User Id`. They can be a
         *        random numbers or some type of user and session
        identifiers (preferably hashed). The
         *        length of the `Session ID` and
        `User ID` must not exceed 36 characters.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest}
         * @return the request
         */
        public DetectIntent detectIntent(java.lang.String session, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest content) throws java.io.IOException {
          DetectIntent result = new DetectIntent(session, content);
          initialize(result);
          return result;
        }

        public class DetectIntent extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentResponse> {

          private static final String REST_PATH = "v2beta1/{+session}:detectIntent";

          private final java.util.regex.Pattern SESSION_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

          /**
           * Processes a natural language query and returns structured, actionable data as a result. This
           * method is not idempotent, because it may cause contexts and session entity types to be updated,
           * which in turn might affect results of future queries.
           *
           * Create a request for the method "sessions.detectIntent".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link DetectIntent#execute()} method to invoke the remote
           * operation. <p> {@link
           * DetectIntent#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param session Required. The name of the session this query is sent to. Format:
        `projects//agent/sessions/`, or
         *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
         *        assume
        default 'draft' environment. If `User ID` is not specified, we are using
        "-". It’s
         *        up to the API caller to choose an appropriate `Session ID` and
        `User Id`. They can be a
         *        random numbers or some type of user and session
        identifiers (preferably hashed). The
         *        length of the `Session ID` and
        `User ID` must not exceed 36 characters.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest}
           * @since 1.13
           */
          protected DetectIntent(java.lang.String session, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1DetectIntentResponse.class);
            this.session = com.google.api.client.util.Preconditions.checkNotNull(session, "Required parameter session must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(SESSION_PATTERN.matcher(session).matches(),
                  "Parameter session must conform to the pattern " +
                  "^projects/[^/]+/agent/sessions/[^/]+$");
            }
          }

          @Override
          public DetectIntent set$Xgafv(java.lang.String $Xgafv) {
            return (DetectIntent) super.set$Xgafv($Xgafv);
          }

          @Override
          public DetectIntent setAccessToken(java.lang.String accessToken) {
            return (DetectIntent) super.setAccessToken(accessToken);
          }

          @Override
          public DetectIntent setAlt(java.lang.String alt) {
            return (DetectIntent) super.setAlt(alt);
          }

          @Override
          public DetectIntent setCallback(java.lang.String callback) {
            return (DetectIntent) super.setCallback(callback);
          }

          @Override
          public DetectIntent setFields(java.lang.String fields) {
            return (DetectIntent) super.setFields(fields);
          }

          @Override
          public DetectIntent setKey(java.lang.String key) {
            return (DetectIntent) super.setKey(key);
          }

          @Override
          public DetectIntent setOauthToken(java.lang.String oauthToken) {
            return (DetectIntent) super.setOauthToken(oauthToken);
          }

          @Override
          public DetectIntent setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (DetectIntent) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public DetectIntent setQuotaUser(java.lang.String quotaUser) {
            return (DetectIntent) super.setQuotaUser(quotaUser);
          }

          @Override
          public DetectIntent setUploadType(java.lang.String uploadType) {
            return (DetectIntent) super.setUploadType(uploadType);
          }

          @Override
          public DetectIntent setUploadProtocol(java.lang.String uploadProtocol) {
            return (DetectIntent) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the session this query is sent to. Format:
           * `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. If
           * `Environment ID` is not specified, we assume default 'draft' environment. If `User ID`
           * is not specified, we are using "-". It’s up to the API caller to choose an appropriate
           * `Session ID` and `User Id`. They can be a random numbers or some type of user and
           * session identifiers (preferably hashed). The length of the `Session ID` and `User ID`
           * must not exceed 36 characters.
           */
          @com.google.api.client.util.Key
          private java.lang.String session;

          /** Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or
         `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
         default 'draft' environment. If `User ID` is not specified, we are using "-". It’s up to the API
         caller to choose an appropriate `Session ID` and `User Id`. They can be a random numbers or some
         type of user and session identifiers (preferably hashed). The length of the `Session ID` and `User
         ID` must not exceed 36 characters.
           */
          public java.lang.String getSession() {
            return session;
          }

          /**
           * Required. The name of the session this query is sent to. Format:
           * `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. If
           * `Environment ID` is not specified, we assume default 'draft' environment. If `User ID`
           * is not specified, we are using "-". It’s up to the API caller to choose an appropriate
           * `Session ID` and `User Id`. They can be a random numbers or some type of user and
           * session identifiers (preferably hashed). The length of the `Session ID` and `User ID`
           * must not exceed 36 characters.
           */
          public DetectIntent setSession(java.lang.String session) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(SESSION_PATTERN.matcher(session).matches(),
                  "Parameter session must conform to the pattern " +
                  "^projects/[^/]+/agent/sessions/[^/]+$");
            }
            this.session = session;
            return this;
          }

          @Override
          public DetectIntent set(String parameterName, Object value) {
            return (DetectIntent) super.set(parameterName, value);
          }
        }

        /**
         * An accessor for creating requests from the Contexts collection.
         *
         * <p>The typical use is:</p>
         * <pre>
         *   {@code Dialogflow dialogflow = new Dialogflow(...);}
         *   {@code Dialogflow.Contexts.List request = dialogflow.contexts().list(parameters ...)}
         * </pre>
         *
         * @return the resource collection
         */
        public Contexts contexts() {
          return new Contexts();
        }

        /**
         * The "contexts" collection of methods.
         */
        public class Contexts {

          /**
           * Creates a context.
           *
           * If the specified context already exists, overrides the context.
           *
           * Create a request for the method "contexts.create".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The session to create a context for.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
           *        assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default '-'
           *        user.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
           * @return the request
           */
          public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) throws java.io.IOException {
            Create result = new Create(parent, content);
            initialize(result);
            return result;
          }

          public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

            private static final String REST_PATH = "v2beta1/{+parent}/contexts";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

            /**
             * Creates a context.
             *
             * If the specified context already exists, overrides the context.
             *
             * Create a request for the method "contexts.create".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
             * <p> {@link
             * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The session to create a context for.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
           *        assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default '-'
           *        user.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
             * @since 1.13
             */
            protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
            }

            @Override
            public Create set$Xgafv(java.lang.String $Xgafv) {
              return (Create) super.set$Xgafv($Xgafv);
            }

            @Override
            public Create setAccessToken(java.lang.String accessToken) {
              return (Create) super.setAccessToken(accessToken);
            }

            @Override
            public Create setAlt(java.lang.String alt) {
              return (Create) super.setAlt(alt);
            }

            @Override
            public Create setCallback(java.lang.String callback) {
              return (Create) super.setCallback(callback);
            }

            @Override
            public Create setFields(java.lang.String fields) {
              return (Create) super.setFields(fields);
            }

            @Override
            public Create setKey(java.lang.String key) {
              return (Create) super.setKey(key);
            }

            @Override
            public Create setOauthToken(java.lang.String oauthToken) {
              return (Create) super.setOauthToken(oauthToken);
            }

            @Override
            public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Create) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Create setQuotaUser(java.lang.String quotaUser) {
              return (Create) super.setQuotaUser(quotaUser);
            }

            @Override
            public Create setUploadType(java.lang.String uploadType) {
              return (Create) super.setUploadType(uploadType);
            }

            @Override
            public Create setUploadProtocol(java.lang.String uploadProtocol) {
              return (Create) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The session to create a context for. Format: `projects//agent/sessions/` or
             * `projects//agent/environments//users//sessions/`. If `Environment ID` is not
             * specified, we assume default 'draft' environment. If `User ID` is not specified, we
             * assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The session to create a context for. Format: `projects//agent/sessions/` or
           `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
           default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The session to create a context for. Format: `projects//agent/sessions/` or
             * `projects//agent/environments//users//sessions/`. If `Environment ID` is not
             * specified, we assume default 'draft' environment. If `User ID` is not specified, we
             * assume default '-' user.
             */
            public Create setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public Create set(String parameterName, Object value) {
              return (Create) super.set(parameterName, value);
            }
          }
          /**
           * Deletes the specified context.
           *
           * Create a request for the method "contexts.delete".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name Required. The name of the context to delete. Format:
          `projects//agent/sessions//contexts/`
          or
           *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
          not
           *        specified, we assume default 'draft' environment. If `User ID` is not
          specified, we assume
           *        default '-' user.
           * @return the request
           */
          public Delete delete(java.lang.String name) throws java.io.IOException {
            Delete result = new Delete(name);
            initialize(result);
            return result;
          }

          public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");

            /**
             * Deletes the specified context.
             *
             * Create a request for the method "contexts.delete".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             * <p> {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The name of the context to delete. Format:
          `projects//agent/sessions//contexts/`
          or
           *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
          not
           *        specified, we assume default 'draft' environment. If `User ID` is not
          specified, we assume
           *        default '-' user.
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
            }

            @Override
            public Delete set$Xgafv(java.lang.String $Xgafv) {
              return (Delete) super.set$Xgafv($Xgafv);
            }

            @Override
            public Delete setAccessToken(java.lang.String accessToken) {
              return (Delete) super.setAccessToken(accessToken);
            }

            @Override
            public Delete setAlt(java.lang.String alt) {
              return (Delete) super.setAlt(alt);
            }

            @Override
            public Delete setCallback(java.lang.String callback) {
              return (Delete) super.setCallback(callback);
            }

            @Override
            public Delete setFields(java.lang.String fields) {
              return (Delete) super.setFields(fields);
            }

            @Override
            public Delete setKey(java.lang.String key) {
              return (Delete) super.setKey(key);
            }

            @Override
            public Delete setOauthToken(java.lang.String oauthToken) {
              return (Delete) super.setOauthToken(oauthToken);
            }

            @Override
            public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Delete) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Delete setQuotaUser(java.lang.String quotaUser) {
              return (Delete) super.setQuotaUser(quotaUser);
            }

            @Override
            public Delete setUploadType(java.lang.String uploadType) {
              return (Delete) super.setUploadType(uploadType);
            }

            @Override
            public Delete setUploadProtocol(java.lang.String uploadProtocol) {
              return (Delete) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the context to delete. Format:
             * `projects//agent/sessions//contexts/` or
             * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or
           `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is not specified,
           we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The name of the context to delete. Format:
             * `projects//agent/sessions//contexts/` or
             * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            public Delete setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Delete set(String parameterName, Object value) {
              return (Delete) super.set(parameterName, value);
            }
          }
          /**
           * Retrieves the specified context.
           *
           * Create a request for the method "contexts.get".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Get#execute()} method to invoke the remote operation.
           *
           * @param name Required. The name of the context. Format:
          `projects//agent/sessions//contexts/`
          or
           *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
          not
           *        specified, we assume default 'draft' environment. If `User ID` is not
          specified, we assume
           *        default '-' user.
           * @return the request
           */
          public Get get(java.lang.String name) throws java.io.IOException {
            Get result = new Get(name);
            initialize(result);
            return result;
          }

          public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");

            /**
             * Retrieves the specified context.
             *
             * Create a request for the method "contexts.get".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
             * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The name of the context. Format:
          `projects//agent/sessions//contexts/`
          or
           *        `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
          not
           *        specified, we assume default 'draft' environment. If `User ID` is not
          specified, we assume
           *        default '-' user.
             * @since 1.13
             */
            protected Get(java.lang.String name) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public Get set$Xgafv(java.lang.String $Xgafv) {
              return (Get) super.set$Xgafv($Xgafv);
            }

            @Override
            public Get setAccessToken(java.lang.String accessToken) {
              return (Get) super.setAccessToken(accessToken);
            }

            @Override
            public Get setAlt(java.lang.String alt) {
              return (Get) super.setAlt(alt);
            }

            @Override
            public Get setCallback(java.lang.String callback) {
              return (Get) super.setCallback(callback);
            }

            @Override
            public Get setFields(java.lang.String fields) {
              return (Get) super.setFields(fields);
            }

            @Override
            public Get setKey(java.lang.String key) {
              return (Get) super.setKey(key);
            }

            @Override
            public Get setOauthToken(java.lang.String oauthToken) {
              return (Get) super.setOauthToken(oauthToken);
            }

            @Override
            public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Get) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Get setQuotaUser(java.lang.String quotaUser) {
              return (Get) super.setQuotaUser(quotaUser);
            }

            @Override
            public Get setUploadType(java.lang.String uploadType) {
              return (Get) super.setUploadType(uploadType);
            }

            @Override
            public Get setUploadProtocol(java.lang.String uploadProtocol) {
              return (Get) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the context. Format: `projects//agent/sessions//contexts/` or
             * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The name of the context. Format: `projects//agent/sessions//contexts/` or
           `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is not specified,
           we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The name of the context. Format: `projects//agent/sessions//contexts/` or
             * `projects//agent/environments//users//sessions//contexts/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            public Get setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Get set(String parameterName, Object value) {
              return (Get) super.set(parameterName, value);
            }
          }
          /**
           * Returns the list of all contexts in the specified session.
           *
           * Create a request for the method "contexts.list".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link List#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The session to list all contexts from.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
           *        assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default '-'
           *        user.
           * @return the request
           */
          public List list(java.lang.String parent) throws java.io.IOException {
            List result = new List(parent);
            initialize(result);
            return result;
          }

          public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListContextsResponse> {

            private static final String REST_PATH = "v2beta1/{+parent}/contexts";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

            /**
             * Returns the list of all contexts in the specified session.
             *
             * Create a request for the method "contexts.list".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
             * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The session to list all contexts from.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we
           *        assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default '-'
           *        user.
             * @since 1.13
             */
            protected List(java.lang.String parent) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListContextsResponse.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public List set$Xgafv(java.lang.String $Xgafv) {
              return (List) super.set$Xgafv($Xgafv);
            }

            @Override
            public List setAccessToken(java.lang.String accessToken) {
              return (List) super.setAccessToken(accessToken);
            }

            @Override
            public List setAlt(java.lang.String alt) {
              return (List) super.setAlt(alt);
            }

            @Override
            public List setCallback(java.lang.String callback) {
              return (List) super.setCallback(callback);
            }

            @Override
            public List setFields(java.lang.String fields) {
              return (List) super.setFields(fields);
            }

            @Override
            public List setKey(java.lang.String key) {
              return (List) super.setKey(key);
            }

            @Override
            public List setOauthToken(java.lang.String oauthToken) {
              return (List) super.setOauthToken(oauthToken);
            }

            @Override
            public List setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (List) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public List setQuotaUser(java.lang.String quotaUser) {
              return (List) super.setQuotaUser(quotaUser);
            }

            @Override
            public List setUploadType(java.lang.String uploadType) {
              return (List) super.setUploadType(uploadType);
            }

            @Override
            public List setUploadProtocol(java.lang.String uploadProtocol) {
              return (List) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The session to list all contexts from. Format: `projects//agent/sessions/`
             * or `projects//agent/environments//users//sessions/`. If `Environment ID` is not
             * specified, we assume default 'draft' environment. If `User ID` is not specified, we
             * assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The session to list all contexts from. Format: `projects//agent/sessions/` or
           `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume
           default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The session to list all contexts from. Format: `projects//agent/sessions/`
             * or `projects//agent/environments//users//sessions/`. If `Environment ID` is not
             * specified, we assume default 'draft' environment. If `User ID` is not specified, we
             * assume default '-' user.
             */
            public List setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 100 and
             * at most 1000.
             */
            @com.google.api.client.util.Key
            private java.lang.Integer pageSize;

            /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
             */
            public java.lang.Integer getPageSize() {
              return pageSize;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 100 and
             * at most 1000.
             */
            public List setPageSize(java.lang.Integer pageSize) {
              this.pageSize = pageSize;
              return this;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            @com.google.api.client.util.Key
            private java.lang.String pageToken;

            /** Optional. The next_page_token value returned from a previous list request.
             */
            public java.lang.String getPageToken() {
              return pageToken;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            public List setPageToken(java.lang.String pageToken) {
              this.pageToken = pageToken;
              return this;
            }

            @Override
            public List set(String parameterName, Object value) {
              return (List) super.set(parameterName, value);
            }
          }
          /**
           * Updates the specified context.
           *
           * Create a request for the method "contexts.patch".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           *
           * @param name Required. The unique identifier of the context. Format:
          `projects//agent/sessions//contexts/`,
          or
           *        `projects//agent/environments//users//sessions//contexts/`.
          The `Context ID` is always
           *        converted to lowercase, may only contain
          characters in a-zA-Z0-9_-% and may be at most 250
           *        bytes long.
          If `Environment ID` is not specified, we assume default 'draft'
          environment.
           *        If `User ID` is not specified, we assume default '-' user.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
           * @return the request
           */
          public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) throws java.io.IOException {
            Patch result = new Patch(name, content);
            initialize(result);
            return result;
          }

          public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");

            /**
             * Updates the specified context.
             *
             * Create a request for the method "contexts.patch".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
             * <p> {@link
             * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The unique identifier of the context. Format:
          `projects//agent/sessions//contexts/`,
          or
           *        `projects//agent/environments//users//sessions//contexts/`.
          The `Context ID` is always
           *        converted to lowercase, may only contain
          characters in a-zA-Z0-9_-% and may be at most 250
           *        bytes long.
          If `Environment ID` is not specified, we assume default 'draft'
          environment.
           *        If `User ID` is not specified, we assume default '-' user.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context}
             * @since 1.13
             */
            protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context content) {
              super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Context.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
            }

            @Override
            public Patch set$Xgafv(java.lang.String $Xgafv) {
              return (Patch) super.set$Xgafv($Xgafv);
            }

            @Override
            public Patch setAccessToken(java.lang.String accessToken) {
              return (Patch) super.setAccessToken(accessToken);
            }

            @Override
            public Patch setAlt(java.lang.String alt) {
              return (Patch) super.setAlt(alt);
            }

            @Override
            public Patch setCallback(java.lang.String callback) {
              return (Patch) super.setCallback(callback);
            }

            @Override
            public Patch setFields(java.lang.String fields) {
              return (Patch) super.setFields(fields);
            }

            @Override
            public Patch setKey(java.lang.String key) {
              return (Patch) super.setKey(key);
            }

            @Override
            public Patch setOauthToken(java.lang.String oauthToken) {
              return (Patch) super.setOauthToken(oauthToken);
            }

            @Override
            public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Patch) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Patch setQuotaUser(java.lang.String quotaUser) {
              return (Patch) super.setQuotaUser(quotaUser);
            }

            @Override
            public Patch setUploadType(java.lang.String uploadType) {
              return (Patch) super.setUploadType(uploadType);
            }

            @Override
            public Patch setUploadProtocol(java.lang.String uploadProtocol) {
              return (Patch) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The unique identifier of the context. Format:
             * `projects//agent/sessions//contexts/`, or
             * `projects//agent/environments//users//sessions//contexts/`.
             *
             * The `Context ID` is always converted to lowercase, may only contain characters in
             * a-zA-Z0-9_-% and may be at most 250 bytes long.
             *
             * If `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or
           `projects//agent/environments//users//sessions//contexts/`.

           The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-% and
           may be at most 250 bytes long.

           If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not
           specified, we assume default '-' user.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The unique identifier of the context. Format:
             * `projects//agent/sessions//contexts/`, or
             * `projects//agent/environments//users//sessions//contexts/`.
             *
             * The `Context ID` is always converted to lowercase, may only contain characters in
             * a-zA-Z0-9_-% and may be at most 250 bytes long.
             *
             * If `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            public Patch setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+$");
              }
              this.name = name;
              return this;
            }

            /** Optional. The mask to control which fields get updated. */
            @com.google.api.client.util.Key
            private String updateMask;

            /** Optional. The mask to control which fields get updated.
             */
            public String getUpdateMask() {
              return updateMask;
            }

            /** Optional. The mask to control which fields get updated. */
            public Patch setUpdateMask(String updateMask) {
              this.updateMask = updateMask;
              return this;
            }

            @Override
            public Patch set(String parameterName, Object value) {
              return (Patch) super.set(parameterName, value);
            }
          }

        }
        /**
         * An accessor for creating requests from the EntityTypes collection.
         *
         * <p>The typical use is:</p>
         * <pre>
         *   {@code Dialogflow dialogflow = new Dialogflow(...);}
         *   {@code Dialogflow.EntityTypes.List request = dialogflow.entityTypes().list(parameters ...)}
         * </pre>
         *
         * @return the resource collection
         */
        public EntityTypes entityTypes() {
          return new EntityTypes();
        }

        /**
         * The "entityTypes" collection of methods.
         */
        public class EntityTypes {

          /**
           * Creates a session entity type.
           *
           * If the specified session entity type already exists, overrides the session entity type.
           *
           * Create a request for the method "entityTypes.create".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The session to create a session entity type for.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//
          sessions/`. If `Environment ID` is not specified,
           *        we assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default
           *        '-' user.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
           * @return the request
           */
          public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) throws java.io.IOException {
            Create result = new Create(parent, content);
            initialize(result);
            return result;
          }

          public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

            private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

            /**
             * Creates a session entity type.
             *
             * If the specified session entity type already exists, overrides the session entity type.
             *
             * Create a request for the method "entityTypes.create".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
             * <p> {@link
             * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The session to create a session entity type for.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//
          sessions/`. If `Environment ID` is not specified,
           *        we assume
          default 'draft' environment. If `User ID` is not specified, we assume
          default
           *        '-' user.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
             * @since 1.13
             */
            protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) {
              super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
            }

            @Override
            public Create set$Xgafv(java.lang.String $Xgafv) {
              return (Create) super.set$Xgafv($Xgafv);
            }

            @Override
            public Create setAccessToken(java.lang.String accessToken) {
              return (Create) super.setAccessToken(accessToken);
            }

            @Override
            public Create setAlt(java.lang.String alt) {
              return (Create) super.setAlt(alt);
            }

            @Override
            public Create setCallback(java.lang.String callback) {
              return (Create) super.setCallback(callback);
            }

            @Override
            public Create setFields(java.lang.String fields) {
              return (Create) super.setFields(fields);
            }

            @Override
            public Create setKey(java.lang.String key) {
              return (Create) super.setKey(key);
            }

            @Override
            public Create setOauthToken(java.lang.String oauthToken) {
              return (Create) super.setOauthToken(oauthToken);
            }

            @Override
            public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Create) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Create setQuotaUser(java.lang.String quotaUser) {
              return (Create) super.setQuotaUser(quotaUser);
            }

            @Override
            public Create setUploadType(java.lang.String uploadType) {
              return (Create) super.setUploadType(uploadType);
            }

            @Override
            public Create setUploadProtocol(java.lang.String uploadProtocol) {
              return (Create) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The session to create a session entity type for. Format:
             * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. If
             * `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or
           `projects//agent/environments//users// sessions/`. If `Environment ID` is not specified, we assume
           default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The session to create a session entity type for. Format:
             * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. If
             * `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            public Create setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public Create set(String parameterName, Object value) {
              return (Create) super.set(parameterName, value);
            }
          }
          /**
           * Deletes the specified session entity type.
           *
           * Create a request for the method "entityTypes.delete".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name Required. The name of the entity type to delete. Format:
          `projects//agent/sessions//entityTypes/` or
           *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
           * @return the request
           */
          public Delete delete(java.lang.String name) throws java.io.IOException {
            Delete result = new Delete(name);
            initialize(result);
            return result;
          }

          public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");

            /**
             * Deletes the specified session entity type.
             *
             * Create a request for the method "entityTypes.delete".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             * <p> {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The name of the entity type to delete. Format:
          `projects//agent/sessions//entityTypes/` or
           *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
            }

            @Override
            public Delete set$Xgafv(java.lang.String $Xgafv) {
              return (Delete) super.set$Xgafv($Xgafv);
            }

            @Override
            public Delete setAccessToken(java.lang.String accessToken) {
              return (Delete) super.setAccessToken(accessToken);
            }

            @Override
            public Delete setAlt(java.lang.String alt) {
              return (Delete) super.setAlt(alt);
            }

            @Override
            public Delete setCallback(java.lang.String callback) {
              return (Delete) super.setCallback(callback);
            }

            @Override
            public Delete setFields(java.lang.String fields) {
              return (Delete) super.setFields(fields);
            }

            @Override
            public Delete setKey(java.lang.String key) {
              return (Delete) super.setKey(key);
            }

            @Override
            public Delete setOauthToken(java.lang.String oauthToken) {
              return (Delete) super.setOauthToken(oauthToken);
            }

            @Override
            public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Delete) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Delete setQuotaUser(java.lang.String quotaUser) {
              return (Delete) super.setQuotaUser(quotaUser);
            }

            @Override
            public Delete setUploadType(java.lang.String uploadType) {
              return (Delete) super.setUploadType(uploadType);
            }

            @Override
            public Delete setUploadProtocol(java.lang.String uploadProtocol) {
              return (Delete) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the entity type to delete. Format:
             * `projects//agent/sessions//entityTypes/` or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/`
           or `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
           '-' user.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The name of the entity type to delete. Format:
             * `projects//agent/sessions//entityTypes/` or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            public Delete setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Delete set(String parameterName, Object value) {
              return (Delete) super.set(parameterName, value);
            }
          }
          /**
           * Retrieves the specified session entity type.
           *
           * Create a request for the method "entityTypes.get".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Get#execute()} method to invoke the remote operation.
           *
           * @param name Required. The name of the session entity type. Format:
          `projects//agent/sessions//entityTypes/` or
           *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
           * @return the request
           */
          public Get get(java.lang.String name) throws java.io.IOException {
            Get result = new Get(name);
            initialize(result);
            return result;
          }

          public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");

            /**
             * Retrieves the specified session entity type.
             *
             * Create a request for the method "entityTypes.get".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
             * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The name of the session entity type. Format:
          `projects//agent/sessions//entityTypes/` or
           *        `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
             * @since 1.13
             */
            protected Get(java.lang.String name) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public Get set$Xgafv(java.lang.String $Xgafv) {
              return (Get) super.set$Xgafv($Xgafv);
            }

            @Override
            public Get setAccessToken(java.lang.String accessToken) {
              return (Get) super.setAccessToken(accessToken);
            }

            @Override
            public Get setAlt(java.lang.String alt) {
              return (Get) super.setAlt(alt);
            }

            @Override
            public Get setCallback(java.lang.String callback) {
              return (Get) super.setCallback(callback);
            }

            @Override
            public Get setFields(java.lang.String fields) {
              return (Get) super.setFields(fields);
            }

            @Override
            public Get setKey(java.lang.String key) {
              return (Get) super.setKey(key);
            }

            @Override
            public Get setOauthToken(java.lang.String oauthToken) {
              return (Get) super.setOauthToken(oauthToken);
            }

            @Override
            public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Get) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Get setQuotaUser(java.lang.String quotaUser) {
              return (Get) super.setQuotaUser(quotaUser);
            }

            @Override
            public Get setUploadType(java.lang.String uploadType) {
              return (Get) super.setUploadType(uploadType);
            }

            @Override
            public Get setUploadProtocol(java.lang.String uploadProtocol) {
              return (Get) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The name of the session entity type. Format:
             * `projects//agent/sessions//entityTypes/` or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or
           `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
           '-' user.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The name of the session entity type. Format:
             * `projects//agent/sessions//entityTypes/` or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             */
            public Get setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Get set(String parameterName, Object value) {
              return (Get) super.set(parameterName, value);
            }
          }
          /**
           * Returns the list of all session entity types in the specified session.
           *
           * Create a request for the method "entityTypes.list".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link List#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The session to list all session entity types from.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//
          sessions/`.
          If `Environment ID` is not specified,
           *        we assume default 'draft'
          environment. If `User ID` is not specified, we assume default
           *        '-' user.
           * @return the request
           */
          public List list(java.lang.String parent) throws java.io.IOException {
            List result = new List(parent);
            initialize(result);
            return result;
          }

          public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> {

            private static final String REST_PATH = "v2beta1/{+parent}/entityTypes";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+$");

            /**
             * Returns the list of all session entity types in the specified session.
             *
             * Create a request for the method "entityTypes.list".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
             * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The session to list all session entity types from.
          Format: `projects//agent/sessions/` or
           *        `projects//agent/environments//users//
          sessions/`.
          If `Environment ID` is not specified,
           *        we assume default 'draft'
          environment. If `User ID` is not specified, we assume default
           *        '-' user.
             * @since 1.13
             */
            protected List(java.lang.String parent) {
              super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
            }

            @Override
            public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
              return super.executeUsingHead();
            }

            @Override
            public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
              return super.buildHttpRequestUsingHead();
            }

            @Override
            public List set$Xgafv(java.lang.String $Xgafv) {
              return (List) super.set$Xgafv($Xgafv);
            }

            @Override
            public List setAccessToken(java.lang.String accessToken) {
              return (List) super.setAccessToken(accessToken);
            }

            @Override
            public List setAlt(java.lang.String alt) {
              return (List) super.setAlt(alt);
            }

            @Override
            public List setCallback(java.lang.String callback) {
              return (List) super.setCallback(callback);
            }

            @Override
            public List setFields(java.lang.String fields) {
              return (List) super.setFields(fields);
            }

            @Override
            public List setKey(java.lang.String key) {
              return (List) super.setKey(key);
            }

            @Override
            public List setOauthToken(java.lang.String oauthToken) {
              return (List) super.setOauthToken(oauthToken);
            }

            @Override
            public List setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (List) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public List setQuotaUser(java.lang.String quotaUser) {
              return (List) super.setQuotaUser(quotaUser);
            }

            @Override
            public List setUploadType(java.lang.String uploadType) {
              return (List) super.setUploadType(uploadType);
            }

            @Override
            public List setUploadProtocol(java.lang.String uploadProtocol) {
              return (List) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The session to list all session entity types from. Format:
             * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. If
             * `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or
           `projects//agent/environments//users// sessions/`. If `Environment ID` is not specified, we assume
           default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The session to list all session entity types from. Format:
             * `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. If
             * `Environment ID` is not specified, we assume default 'draft' environment. If `User
             * ID` is not specified, we assume default '-' user.
             */
            public List setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 100 and
             * at most 1000.
             */
            @com.google.api.client.util.Key
            private java.lang.Integer pageSize;

            /** Optional. The maximum number of items to return in a single page. By default 100 and at most 1000.
             */
            public java.lang.Integer getPageSize() {
              return pageSize;
            }

            /**
             * Optional. The maximum number of items to return in a single page. By default 100 and
             * at most 1000.
             */
            public List setPageSize(java.lang.Integer pageSize) {
              this.pageSize = pageSize;
              return this;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            @com.google.api.client.util.Key
            private java.lang.String pageToken;

            /** Optional. The next_page_token value returned from a previous list request.
             */
            public java.lang.String getPageToken() {
              return pageToken;
            }

            /** Optional. The next_page_token value returned from a previous list request. */
            public List setPageToken(java.lang.String pageToken) {
              this.pageToken = pageToken;
              return this;
            }

            @Override
            public List set(String parameterName, Object value) {
              return (List) super.set(parameterName, value);
            }
          }
          /**
           * Updates the specified session entity type.
           *
           * Create a request for the method "entityTypes.patch".
           *
           * This request holds the parameters needed by the dialogflow server.  After setting any optional
           * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           *
           * @param name Required. The unique identifier of this session entity type. Format:
           *        `projects//agent/sessions//entityTypes/`, or
           *        `projects//agent/environments//users//sessions//entityTypes/`.
          If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
          `` must be the display name of an existing entity
          type in the same agent
           *        that will be overridden or supplemented.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
           * @return the request
           */
          public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) throws java.io.IOException {
            Patch result = new Patch(name, content);
            initialize(result);
            return result;
          }

          public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType> {

            private static final String REST_PATH = "v2beta1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");

            /**
             * Updates the specified session entity type.
             *
             * Create a request for the method "entityTypes.patch".
             *
             * This request holds the parameters needed by the the dialogflow server.  After setting any
             * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
             * <p> {@link
             * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The unique identifier of this session entity type. Format:
           *        `projects//agent/sessions//entityTypes/`, or
           *        `projects//agent/environments//users//sessions//entityTypes/`.
          If `Environment ID` is not
           *        specified, we assume default 'draft'
          environment. If `User ID` is not specified, we assume
           *        default '-' user.
          `` must be the display name of an existing entity
          type in the same agent
           *        that will be overridden or supplemented.
             * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType}
             * @since 1.13
             */
            protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType content) {
              super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1SessionEntityType.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
            }

            @Override
            public Patch set$Xgafv(java.lang.String $Xgafv) {
              return (Patch) super.set$Xgafv($Xgafv);
            }

            @Override
            public Patch setAccessToken(java.lang.String accessToken) {
              return (Patch) super.setAccessToken(accessToken);
            }

            @Override
            public Patch setAlt(java.lang.String alt) {
              return (Patch) super.setAlt(alt);
            }

            @Override
            public Patch setCallback(java.lang.String callback) {
              return (Patch) super.setCallback(callback);
            }

            @Override
            public Patch setFields(java.lang.String fields) {
              return (Patch) super.setFields(fields);
            }

            @Override
            public Patch setKey(java.lang.String key) {
              return (Patch) super.setKey(key);
            }

            @Override
            public Patch setOauthToken(java.lang.String oauthToken) {
              return (Patch) super.setOauthToken(oauthToken);
            }

            @Override
            public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
              return (Patch) super.setPrettyPrint(prettyPrint);
            }

            @Override
            public Patch setQuotaUser(java.lang.String quotaUser) {
              return (Patch) super.setQuotaUser(quotaUser);
            }

            @Override
            public Patch setUploadType(java.lang.String uploadType) {
              return (Patch) super.setUploadType(uploadType);
            }

            @Override
            public Patch setUploadProtocol(java.lang.String uploadProtocol) {
              return (Patch) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The unique identifier of this session entity type. Format:
             * `projects//agent/sessions//entityTypes/`, or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             *
             * `` must be the display name of an existing entity type in the same agent that will be
             * overridden or supplemented.
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The unique identifier of this session entity type. Format:
           `projects//agent/sessions//entityTypes/`, or
           `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is not
           specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default
           '-' user.

           `` must be the display name of an existing entity type in the same agent that will be overridden or
           supplemented.
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The unique identifier of this session entity type. Format:
             * `projects//agent/sessions//entityTypes/`, or
             * `projects//agent/environments//users//sessions//entityTypes/`. If `Environment ID` is
             * not specified, we assume default 'draft' environment. If `User ID` is not specified,
             * we assume default '-' user.
             *
             * `` must be the display name of an existing entity type in the same agent that will be
             * overridden or supplemented.
             */
            public Patch setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+$");
              }
              this.name = name;
              return this;
            }

            /** Optional. The mask to control which fields get updated. */
            @com.google.api.client.util.Key
            private String updateMask;

            /** Optional. The mask to control which fields get updated.
             */
            public String getUpdateMask() {
              return updateMask;
            }

            /** Optional. The mask to control which fields get updated. */
            public Patch setUpdateMask(String updateMask) {
              this.updateMask = updateMask;
              return this;
            }

            @Override
            public Patch set(String parameterName, Object value) {
              return (Patch) super.set(parameterName, value);
            }
          }

        }
      }
    }
    /**
     * An accessor for creating requests from the KnowledgeBases collection.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code Dialogflow dialogflow = new Dialogflow(...);}
     *   {@code Dialogflow.KnowledgeBases.List request = dialogflow.knowledgeBases().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public KnowledgeBases knowledgeBases() {
      return new KnowledgeBases();
    }

    /**
     * The "knowledgeBases" collection of methods.
     */
    public class KnowledgeBases {

      /**
       * Creates a knowledge base.
       *
       * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
       * `projects.knowledgeBases`.
       *
       * Create a request for the method "knowledgeBases.create".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Create#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project to create a knowledge base for.
      Format: `projects/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
       * @return the request
       */
      public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) throws java.io.IOException {
        Create result = new Create(parent, content);
        initialize(result);
        return result;
      }

      public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

        private static final String REST_PATH = "v2beta1/{+parent}/knowledgeBases";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Creates a knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.create".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
         * <p> {@link
         * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project to create a knowledge base for.
      Format: `projects/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
         * @since 1.13
         */
        protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) {
          super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public Create set$Xgafv(java.lang.String $Xgafv) {
          return (Create) super.set$Xgafv($Xgafv);
        }

        @Override
        public Create setAccessToken(java.lang.String accessToken) {
          return (Create) super.setAccessToken(accessToken);
        }

        @Override
        public Create setAlt(java.lang.String alt) {
          return (Create) super.setAlt(alt);
        }

        @Override
        public Create setCallback(java.lang.String callback) {
          return (Create) super.setCallback(callback);
        }

        @Override
        public Create setFields(java.lang.String fields) {
          return (Create) super.setFields(fields);
        }

        @Override
        public Create setKey(java.lang.String key) {
          return (Create) super.setKey(key);
        }

        @Override
        public Create setOauthToken(java.lang.String oauthToken) {
          return (Create) super.setOauthToken(oauthToken);
        }

        @Override
        public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Create) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Create setQuotaUser(java.lang.String quotaUser) {
          return (Create) super.setQuotaUser(quotaUser);
        }

        @Override
        public Create setUploadType(java.lang.String uploadType) {
          return (Create) super.setUploadType(uploadType);
        }

        @Override
        public Create setUploadProtocol(java.lang.String uploadProtocol) {
          return (Create) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project to create a knowledge base for. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project to create a knowledge base for. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project to create a knowledge base for. Format: `projects/`.
         */
        public Create setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public Create set(String parameterName, Object value) {
          return (Create) super.set(parameterName, value);
        }
      }
      /**
       * Deletes the specified knowledge base.
       *
       * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
       * `projects.knowledgeBases`.
       *
       * Create a request for the method "knowledgeBases.delete".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
       *
       * @param name Required. The name of the knowledge base to delete.
      Format: `projects//knowledgeBases/`.
       * @return the request
       */
      public Delete delete(java.lang.String name) throws java.io.IOException {
        Delete result = new Delete(name);
        initialize(result);
        return result;
      }

      public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty> {

        private static final String REST_PATH = "v2beta1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+$");

        /**
         * Deletes the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.delete".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         * <p> {@link
         * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Required. The name of the knowledge base to delete.
      Format: `projects//knowledgeBases/`.
         * @since 1.13
         */
        protected Delete(java.lang.String name) {
          super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleProtobufEmpty.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
        }

        @Override
        public Delete set$Xgafv(java.lang.String $Xgafv) {
          return (Delete) super.set$Xgafv($Xgafv);
        }

        @Override
        public Delete setAccessToken(java.lang.String accessToken) {
          return (Delete) super.setAccessToken(accessToken);
        }

        @Override
        public Delete setAlt(java.lang.String alt) {
          return (Delete) super.setAlt(alt);
        }

        @Override
        public Delete setCallback(java.lang.String callback) {
          return (Delete) super.setCallback(callback);
        }

        @Override
        public Delete setFields(java.lang.String fields) {
          return (Delete) super.setFields(fields);
        }

        @Override
        public Delete setKey(java.lang.String key) {
          return (Delete) super.setKey(key);
        }

        @Override
        public Delete setOauthToken(java.lang.String oauthToken) {
          return (Delete) super.setOauthToken(oauthToken);
        }

        @Override
        public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Delete) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Delete setQuotaUser(java.lang.String quotaUser) {
          return (Delete) super.setQuotaUser(quotaUser);
        }

        @Override
        public Delete setUploadType(java.lang.String uploadType) {
          return (Delete) super.setUploadType(uploadType);
        }

        @Override
        public Delete setUploadProtocol(java.lang.String uploadProtocol) {
          return (Delete) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The name of the knowledge base to delete. Format: `projects//knowledgeBases/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. The name of the knowledge base to delete. Format: `projects//knowledgeBases/`.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. The name of the knowledge base to delete. Format: `projects//knowledgeBases/`.
         */
        public Delete setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * Optional. Force deletes the knowledge base. When set to true, any documents in the
         * knowledge base are also deleted.
         */
        @com.google.api.client.util.Key
        private java.lang.Boolean force;

        /** Optional. Force deletes the knowledge base. When set to true, any documents in the knowledge base
       are also deleted.
         */
        public java.lang.Boolean getForce() {
          return force;
        }

        /**
         * Optional. Force deletes the knowledge base. When set to true, any documents in the
         * knowledge base are also deleted.
         */
        public Delete setForce(java.lang.Boolean force) {
          this.force = force;
          return this;
        }

        @Override
        public Delete set(String parameterName, Object value) {
          return (Delete) super.set(parameterName, value);
        }
      }
      /**
       * Retrieves the specified knowledge base.
       *
       * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
       * `projects.knowledgeBases`.
       *
       * Create a request for the method "knowledgeBases.get".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation.
       *
       * @param name Required. The name of the knowledge base to retrieve.
      Format `projects//knowledgeBases/`.
       * @return the request
       */
      public Get get(java.lang.String name) throws java.io.IOException {
        Get result = new Get(name);
        initialize(result);
        return result;
      }

      public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

        private static final String REST_PATH = "v2beta1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+$");

        /**
         * Retrieves the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.get".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
         * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Required. The name of the knowledge base to retrieve.
      Format `projects//knowledgeBases/`.
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public Get set$Xgafv(java.lang.String $Xgafv) {
          return (Get) super.set$Xgafv($Xgafv);
        }

        @Override
        public Get setAccessToken(java.lang.String accessToken) {
          return (Get) super.setAccessToken(accessToken);
        }

        @Override
        public Get setAlt(java.lang.String alt) {
          return (Get) super.setAlt(alt);
        }

        @Override
        public Get setCallback(java.lang.String callback) {
          return (Get) super.setCallback(callback);
        }

        @Override
        public Get setFields(java.lang.String fields) {
          return (Get) super.setFields(fields);
        }

        @Override
        public Get setKey(java.lang.String key) {
          return (Get) super.setKey(key);
        }

        @Override
        public Get setOauthToken(java.lang.String oauthToken) {
          return (Get) super.setOauthToken(oauthToken);
        }

        @Override
        public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Get) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Get setQuotaUser(java.lang.String quotaUser) {
          return (Get) super.setQuotaUser(quotaUser);
        }

        @Override
        public Get setUploadType(java.lang.String uploadType) {
          return (Get) super.setUploadType(uploadType);
        }

        @Override
        public Get setUploadProtocol(java.lang.String uploadProtocol) {
          return (Get) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The name of the knowledge base to retrieve. Format `projects//knowledgeBases/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. The name of the knowledge base to retrieve. Format `projects//knowledgeBases/`.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. The name of the knowledge base to retrieve. Format `projects//knowledgeBases/`.
         */
        public Get setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Get set(String parameterName, Object value) {
          return (Get) super.set(parameterName, value);
        }
      }
      /**
       * Returns the list of all knowledge bases of the specified agent.
       *
       * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
       * `projects.knowledgeBases`.
       *
       * Create a request for the method "knowledgeBases.list".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project to list of knowledge bases for.
      Format: `projects/`.
       * @return the request
       */
      public List list(java.lang.String parent) throws java.io.IOException {
        List result = new List(parent);
        initialize(result);
        return result;
      }

      public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse> {

        private static final String REST_PATH = "v2beta1/{+parent}/knowledgeBases";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Returns the list of all knowledge bases of the specified agent.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.list".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
         * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project to list of knowledge bases for.
      Format: `projects/`.
         * @since 1.13
         */
        protected List(java.lang.String parent) {
          super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListKnowledgeBasesResponse.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public List set$Xgafv(java.lang.String $Xgafv) {
          return (List) super.set$Xgafv($Xgafv);
        }

        @Override
        public List setAccessToken(java.lang.String accessToken) {
          return (List) super.setAccessToken(accessToken);
        }

        @Override
        public List setAlt(java.lang.String alt) {
          return (List) super.setAlt(alt);
        }

        @Override
        public List setCallback(java.lang.String callback) {
          return (List) super.setCallback(callback);
        }

        @Override
        public List setFields(java.lang.String fields) {
          return (List) super.setFields(fields);
        }

        @Override
        public List setKey(java.lang.String key) {
          return (List) super.setKey(key);
        }

        @Override
        public List setOauthToken(java.lang.String oauthToken) {
          return (List) super.setOauthToken(oauthToken);
        }

        @Override
        public List setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (List) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public List setQuotaUser(java.lang.String quotaUser) {
          return (List) super.setQuotaUser(quotaUser);
        }

        @Override
        public List setUploadType(java.lang.String uploadType) {
          return (List) super.setUploadType(uploadType);
        }

        @Override
        public List setUploadProtocol(java.lang.String uploadProtocol) {
          return (List) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project to list of knowledge bases for. Format: `projects/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project to list of knowledge bases for. Format: `projects/`.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project to list of knowledge bases for. Format: `projects/`.
         */
        public List setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /**
         * Optional. The maximum number of items to return in a single page. By default 10 and at
         * most 100.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** Optional. The maximum number of items to return in a single page. By default 10 and at most 100.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * Optional. The maximum number of items to return in a single page. By default 10 and at
         * most 100.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /** Optional. The next_page_token value returned from a previous list request. */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** Optional. The next_page_token value returned from a previous list request.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /** Optional. The next_page_token value returned from a previous list request. */
        public List setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        @Override
        public List set(String parameterName, Object value) {
          return (List) super.set(parameterName, value);
        }
      }
      /**
       * Updates the specified knowledge base.
       *
       * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
       * `projects.knowledgeBases`.
       *
       * Create a request for the method "knowledgeBases.patch".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
       *
       * @param name The knowledge base resource name.
      The name must be empty when creating a knowledge base.
      Format:
       *        `projects//knowledgeBases/`.
       * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
       * @return the request
       */
      public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) throws java.io.IOException {
        Patch result = new Patch(name, content);
        initialize(result);
        return result;
      }

      public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase> {

        private static final String REST_PATH = "v2beta1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+$");

        /**
         * Updates the specified knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases` resource is deprecated; only use
         * `projects.knowledgeBases`.
         *
         * Create a request for the method "knowledgeBases.patch".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         * <p> {@link
         * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name The knowledge base resource name.
      The name must be empty when creating a knowledge base.
      Format:
       *        `projects//knowledgeBases/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase}
         * @since 1.13
         */
        protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase content) {
          super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1KnowledgeBase.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
        }

        @Override
        public Patch set$Xgafv(java.lang.String $Xgafv) {
          return (Patch) super.set$Xgafv($Xgafv);
        }

        @Override
        public Patch setAccessToken(java.lang.String accessToken) {
          return (Patch) super.setAccessToken(accessToken);
        }

        @Override
        public Patch setAlt(java.lang.String alt) {
          return (Patch) super.setAlt(alt);
        }

        @Override
        public Patch setCallback(java.lang.String callback) {
          return (Patch) super.setCallback(callback);
        }

        @Override
        public Patch setFields(java.lang.String fields) {
          return (Patch) super.setFields(fields);
        }

        @Override
        public Patch setKey(java.lang.String key) {
          return (Patch) super.setKey(key);
        }

        @Override
        public Patch setOauthToken(java.lang.String oauthToken) {
          return (Patch) super.setOauthToken(oauthToken);
        }

        @Override
        public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Patch) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Patch setQuotaUser(java.lang.String quotaUser) {
          return (Patch) super.setQuotaUser(quotaUser);
        }

        @Override
        public Patch setUploadType(java.lang.String uploadType) {
          return (Patch) super.setUploadType(uploadType);
        }

        @Override
        public Patch setUploadProtocol(java.lang.String uploadProtocol) {
          return (Patch) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * The knowledge base resource name. The name must be empty when creating a knowledge base.
         * Format: `projects//knowledgeBases/`.
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** The knowledge base resource name. The name must be empty when creating a knowledge base. Format:
       `projects//knowledgeBases/`.
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * The knowledge base resource name. The name must be empty when creating a knowledge base.
         * Format: `projects//knowledgeBases/`.
         */
        public Patch setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/knowledgeBases/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * Optional. Not specified means `update all`. Currently, only `display_name` can be
         * updated, an InvalidArgument will be returned for attempting to update other fields.
         */
        @com.google.api.client.util.Key
        private String updateMask;

        /** Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an
       InvalidArgument will be returned for attempting to update other fields.
         */
        public String getUpdateMask() {
          return updateMask;
        }

        /**
         * Optional. Not specified means `update all`. Currently, only `display_name` can be
         * updated, an InvalidArgument will be returned for attempting to update other fields.
         */
        public Patch setUpdateMask(String updateMask) {
          this.updateMask = updateMask;
          return this;
        }

        @Override
        public Patch set(String parameterName, Object value) {
          return (Patch) super.set(parameterName, value);
        }
      }

      /**
       * An accessor for creating requests from the Documents collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code Dialogflow dialogflow = new Dialogflow(...);}
       *   {@code Dialogflow.Documents.List request = dialogflow.documents().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public Documents documents() {
        return new Documents();
      }

      /**
       * The "documents" collection of methods.
       */
      public class Documents {

        /**
         * Creates a new document.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Operation
         *
         * Create a request for the method "documents.create".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The knoweldge base to create a document for.
        Format: `projects//knowledgeBases/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+parent}/documents";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+$");

          /**
           * Creates a new document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.create".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           * <p> {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The knoweldge base to create a document for.
        Format: `projects//knowledgeBases/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+$");
            }
          }

          @Override
          public Create set$Xgafv(java.lang.String $Xgafv) {
            return (Create) super.set$Xgafv($Xgafv);
          }

          @Override
          public Create setAccessToken(java.lang.String accessToken) {
            return (Create) super.setAccessToken(accessToken);
          }

          @Override
          public Create setAlt(java.lang.String alt) {
            return (Create) super.setAlt(alt);
          }

          @Override
          public Create setCallback(java.lang.String callback) {
            return (Create) super.setCallback(callback);
          }

          @Override
          public Create setFields(java.lang.String fields) {
            return (Create) super.setFields(fields);
          }

          @Override
          public Create setKey(java.lang.String key) {
            return (Create) super.setKey(key);
          }

          @Override
          public Create setOauthToken(java.lang.String oauthToken) {
            return (Create) super.setOauthToken(oauthToken);
          }

          @Override
          public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Create) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Create setQuotaUser(java.lang.String quotaUser) {
            return (Create) super.setQuotaUser(quotaUser);
          }

          @Override
          public Create setUploadType(java.lang.String uploadType) {
            return (Create) super.setUploadType(uploadType);
          }

          @Override
          public Create setUploadProtocol(java.lang.String uploadProtocol) {
            return (Create) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The knoweldge base to create a document for. Format:
           * `projects//knowledgeBases/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The knoweldge base to create a document for. Format: `projects//knowledgeBases/`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The knoweldge base to create a document for. Format:
           * `projects//knowledgeBases/`.
           */
          public Create setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public Create set(String parameterName, Object value) {
            return (Create) super.set(parameterName, value);
          }
        }
        /**
         * Deletes the specified document.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Operation
         *
         * Create a request for the method "documents.delete".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name The name of the document to delete.
        Format: `projects//knowledgeBases//documents/`.
         * @return the request
         */
        public Delete delete(java.lang.String name) throws java.io.IOException {
          Delete result = new Delete(name);
          initialize(result);
          return result;
        }

        public class Delete extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");

          /**
           * Deletes the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.delete".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           * <p> {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The name of the document to delete.
        Format: `projects//knowledgeBases//documents/`.
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(Dialogflow.this, "DELETE", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
          }

          @Override
          public Delete set$Xgafv(java.lang.String $Xgafv) {
            return (Delete) super.set$Xgafv($Xgafv);
          }

          @Override
          public Delete setAccessToken(java.lang.String accessToken) {
            return (Delete) super.setAccessToken(accessToken);
          }

          @Override
          public Delete setAlt(java.lang.String alt) {
            return (Delete) super.setAlt(alt);
          }

          @Override
          public Delete setCallback(java.lang.String callback) {
            return (Delete) super.setCallback(callback);
          }

          @Override
          public Delete setFields(java.lang.String fields) {
            return (Delete) super.setFields(fields);
          }

          @Override
          public Delete setKey(java.lang.String key) {
            return (Delete) super.setKey(key);
          }

          @Override
          public Delete setOauthToken(java.lang.String oauthToken) {
            return (Delete) super.setOauthToken(oauthToken);
          }

          @Override
          public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Delete) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Delete setQuotaUser(java.lang.String quotaUser) {
            return (Delete) super.setQuotaUser(quotaUser);
          }

          @Override
          public Delete setUploadType(java.lang.String uploadType) {
            return (Delete) super.setUploadType(uploadType);
          }

          @Override
          public Delete setUploadProtocol(java.lang.String uploadProtocol) {
            return (Delete) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The name of the document to delete. Format: `projects//knowledgeBases//documents/`.
           */
          public Delete setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Retrieves the specified document.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Create a request for the method "documents.get".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The name of the document to retrieve.
        Format `projects//knowledgeBases//documents/`.
         * @return the request
         */
        public Get get(java.lang.String name) throws java.io.IOException {
          Get result = new Get(name);
          initialize(result);
          return result;
        }

        public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");

          /**
           * Retrieves the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Create a request for the method "documents.get".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The name of the document to retrieve.
        Format `projects//knowledgeBases//documents/`.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public Get set$Xgafv(java.lang.String $Xgafv) {
            return (Get) super.set$Xgafv($Xgafv);
          }

          @Override
          public Get setAccessToken(java.lang.String accessToken) {
            return (Get) super.setAccessToken(accessToken);
          }

          @Override
          public Get setAlt(java.lang.String alt) {
            return (Get) super.setAlt(alt);
          }

          @Override
          public Get setCallback(java.lang.String callback) {
            return (Get) super.setCallback(callback);
          }

          @Override
          public Get setFields(java.lang.String fields) {
            return (Get) super.setFields(fields);
          }

          @Override
          public Get setKey(java.lang.String key) {
            return (Get) super.setKey(key);
          }

          @Override
          public Get setOauthToken(java.lang.String oauthToken) {
            return (Get) super.setOauthToken(oauthToken);
          }

          @Override
          public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Get) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Get setQuotaUser(java.lang.String quotaUser) {
            return (Get) super.setQuotaUser(quotaUser);
          }

          @Override
          public Get setUploadType(java.lang.String uploadType) {
            return (Get) super.setUploadType(uploadType);
          }

          @Override
          public Get setUploadProtocol(java.lang.String uploadProtocol) {
            return (Get) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The name of the document to retrieve. Format
           * `projects//knowledgeBases//documents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The name of the document to retrieve. Format `projects//knowledgeBases//documents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The name of the document to retrieve. Format
           * `projects//knowledgeBases//documents/`.
           */
          public Get setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Returns the list of all documents of the knowledge base.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Create a request for the method "documents.list".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The knowledge base to list all documents for.
        Format: `projects//knowledgeBases/`.
         * @return the request
         */
        public List list(java.lang.String parent) throws java.io.IOException {
          List result = new List(parent);
          initialize(result);
          return result;
        }

        public class List extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListDocumentsResponse> {

          private static final String REST_PATH = "v2beta1/{+parent}/documents";

          private final java.util.regex.Pattern PARENT_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+$");

          /**
           * Returns the list of all documents of the knowledge base.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Create a request for the method "documents.list".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The knowledge base to list all documents for.
        Format: `projects//knowledgeBases/`.
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ListDocumentsResponse.class);
            this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+$");
            }
          }

          @Override
          public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
            return super.executeUsingHead();
          }

          @Override
          public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
            return super.buildHttpRequestUsingHead();
          }

          @Override
          public List set$Xgafv(java.lang.String $Xgafv) {
            return (List) super.set$Xgafv($Xgafv);
          }

          @Override
          public List setAccessToken(java.lang.String accessToken) {
            return (List) super.setAccessToken(accessToken);
          }

          @Override
          public List setAlt(java.lang.String alt) {
            return (List) super.setAlt(alt);
          }

          @Override
          public List setCallback(java.lang.String callback) {
            return (List) super.setCallback(callback);
          }

          @Override
          public List setFields(java.lang.String fields) {
            return (List) super.setFields(fields);
          }

          @Override
          public List setKey(java.lang.String key) {
            return (List) super.setKey(key);
          }

          @Override
          public List setOauthToken(java.lang.String oauthToken) {
            return (List) super.setOauthToken(oauthToken);
          }

          @Override
          public List setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (List) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public List setQuotaUser(java.lang.String quotaUser) {
            return (List) super.setQuotaUser(quotaUser);
          }

          @Override
          public List setUploadType(java.lang.String uploadType) {
            return (List) super.setUploadType(uploadType);
          }

          @Override
          public List setUploadProtocol(java.lang.String uploadProtocol) {
            return (List) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The knowledge base to list all documents for. Format:
           * `projects//knowledgeBases/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The knowledge base to list all documents for. Format: `projects//knowledgeBases/`.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The knowledge base to list all documents for. Format:
           * `projects//knowledgeBases/`.
           */
          public List setParent(java.lang.String parent) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                  "Parameter parent must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 10 and at
           * most 100.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** Optional. The maximum number of items to return in a single page. By default 10 and at most 100.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * Optional. The maximum number of items to return in a single page. By default 10 and at
           * most 100.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** Optional. The next_page_token value returned from a previous list request.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** Optional. The next_page_token value returned from a previous list request. */
          public List setPageToken(java.lang.String pageToken) {
            this.pageToken = pageToken;
            return this;
          }

          @Override
          public List set(String parameterName, Object value) {
            return (List) super.set(parameterName, value);
          }
        }
        /**
         * Updates the specified document.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Operation
         *
         * Create a request for the method "documents.patch".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         *
         * @param name The document resource name.
        The name must be empty when creating a document.
        Format:
         *        `projects//knowledgeBases//documents/`.
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
         * @return the request
         */
        public Patch patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) throws java.io.IOException {
          Patch result = new Patch(name, content);
          initialize(result);
          return result;
        }

        public class Patch extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");

          /**
           * Updates the specified document.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.patch".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           * <p> {@link
           * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The document resource name.
        The name must be empty when creating a document.
        Format:
         *        `projects//knowledgeBases//documents/`.
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document}
           * @since 1.13
           */
          protected Patch(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1Document content) {
            super(Dialogflow.this, "PATCH", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
          }

          @Override
          public Patch set$Xgafv(java.lang.String $Xgafv) {
            return (Patch) super.set$Xgafv($Xgafv);
          }

          @Override
          public Patch setAccessToken(java.lang.String accessToken) {
            return (Patch) super.setAccessToken(accessToken);
          }

          @Override
          public Patch setAlt(java.lang.String alt) {
            return (Patch) super.setAlt(alt);
          }

          @Override
          public Patch setCallback(java.lang.String callback) {
            return (Patch) super.setCallback(callback);
          }

          @Override
          public Patch setFields(java.lang.String fields) {
            return (Patch) super.setFields(fields);
          }

          @Override
          public Patch setKey(java.lang.String key) {
            return (Patch) super.setKey(key);
          }

          @Override
          public Patch setOauthToken(java.lang.String oauthToken) {
            return (Patch) super.setOauthToken(oauthToken);
          }

          @Override
          public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Patch) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Patch setQuotaUser(java.lang.String quotaUser) {
            return (Patch) super.setQuotaUser(quotaUser);
          }

          @Override
          public Patch setUploadType(java.lang.String uploadType) {
            return (Patch) super.setUploadType(uploadType);
          }

          @Override
          public Patch setUploadProtocol(java.lang.String uploadProtocol) {
            return (Patch) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The document resource name. The name must be empty when creating a document. Format:
           * `projects//knowledgeBases//documents/`.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The document resource name. The name must be empty when creating a document. Format:
         `projects//knowledgeBases//documents/`.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The document resource name. The name must be empty when creating a document. Format:
           * `projects//knowledgeBases//documents/`.
           */
          public Patch setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. Not specified means `update all`. Currently, only `display_name` can be
           * updated, an InvalidArgument will be returned for attempting to update other fields.
           */
          @com.google.api.client.util.Key
          private String updateMask;

          /** Optional. Not specified means `update all`. Currently, only `display_name` can be updated, an
         InvalidArgument will be returned for attempting to update other fields.
           */
          public String getUpdateMask() {
            return updateMask;
          }

          /**
           * Optional. Not specified means `update all`. Currently, only `display_name` can be
           * updated, an InvalidArgument will be returned for attempting to update other fields.
           */
          public Patch setUpdateMask(String updateMask) {
            this.updateMask = updateMask;
            return this;
          }

          @Override
          public Patch set(String parameterName, Object value) {
            return (Patch) super.set(parameterName, value);
          }
        }
        /**
         * Reloads the specified document from its specified source, content_uri or content. The previously
         * loaded content of the document will be deleted. Note: Even when the content of the document has
         * not changed, there still may be side effects because of internal implementation changes.
         *
         * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
         * `projects.knowledgeBases.documents`.
         *
         * Operation
         *
         * Create a request for the method "documents.reload".
         *
         * This request holds the parameters needed by the dialogflow server.  After setting any optional
         * parameters, call the {@link Reload#execute()} method to invoke the remote operation.
         *
         * @param name The name of the document to reload.
        Format: `projects//knowledgeBases//documents/`
         * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest}
         * @return the request
         */
        public Reload reload(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest content) throws java.io.IOException {
          Reload result = new Reload(name, content);
          initialize(result);
          return result;
        }

        public class Reload extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v2beta1/{+name}:reload";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");

          /**
           * Reloads the specified document from its specified source, content_uri or content. The
           * previously loaded content of the document will be deleted. Note: Even when the content of the
           * document has not changed, there still may be side effects because of internal implementation
           * changes.
           *
           * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; only use
           * `projects.knowledgeBases.documents`.
           *
           * Operation
           *
           * Create a request for the method "documents.reload".
           *
           * This request holds the parameters needed by the the dialogflow server.  After setting any
           * optional parameters, call the {@link Reload#execute()} method to invoke the remote operation.
           * <p> {@link
           * Reload#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name The name of the document to reload.
        Format: `projects//knowledgeBases//documents/`
           * @param content the {@link com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest}
           * @since 1.13
           */
          protected Reload(java.lang.String name, com.google.api.services.dialogflow.v2beta1.model.GoogleCloudDialogflowV2beta1ReloadDocumentRequest content) {
            super(Dialogflow.this, "POST", REST_PATH, content, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
          }

          @Override
          public Reload set$Xgafv(java.lang.String $Xgafv) {
            return (Reload) super.set$Xgafv($Xgafv);
          }

          @Override
          public Reload setAccessToken(java.lang.String accessToken) {
            return (Reload) super.setAccessToken(accessToken);
          }

          @Override
          public Reload setAlt(java.lang.String alt) {
            return (Reload) super.setAlt(alt);
          }

          @Override
          public Reload setCallback(java.lang.String callback) {
            return (Reload) super.setCallback(callback);
          }

          @Override
          public Reload setFields(java.lang.String fields) {
            return (Reload) super.setFields(fields);
          }

          @Override
          public Reload setKey(java.lang.String key) {
            return (Reload) super.setKey(key);
          }

          @Override
          public Reload setOauthToken(java.lang.String oauthToken) {
            return (Reload) super.setOauthToken(oauthToken);
          }

          @Override
          public Reload setPrettyPrint(java.lang.Boolean prettyPrint) {
            return (Reload) super.setPrettyPrint(prettyPrint);
          }

          @Override
          public Reload setQuotaUser(java.lang.String quotaUser) {
            return (Reload) super.setQuotaUser(quotaUser);
          }

          @Override
          public Reload setUploadType(java.lang.String uploadType) {
            return (Reload) super.setUploadType(uploadType);
          }

          @Override
          public Reload setUploadProtocol(java.lang.String uploadProtocol) {
            return (Reload) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * The name of the document to reload. Format: `projects//knowledgeBases//documents/`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The name of the document to reload. Format: `projects//knowledgeBases//documents/`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * The name of the document to reload. Format: `projects//knowledgeBases//documents/`
           */
          public Reload setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Reload set(String parameterName, Object value) {
            return (Reload) super.set(parameterName, value);
          }
        }

      }
    }
    /**
     * An accessor for creating requests from the Operations collection.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code Dialogflow dialogflow = new Dialogflow(...);}
     *   {@code Dialogflow.Operations.List request = dialogflow.operations().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public Operations operations() {
      return new Operations();
    }

    /**
     * The "operations" collection of methods.
     */
    public class Operations {

      /**
       * Gets the latest state of a long-running operation.  Clients can use this method to poll the
       * operation result at intervals as recommended by the API service.
       *
       * Create a request for the method "operations.get".
       *
       * This request holds the parameters needed by the dialogflow server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation.
       *
       * @param name The name of the operation resource.
       * @return the request
       */
      public Get get(java.lang.String name) throws java.io.IOException {
        Get result = new Get(name);
        initialize(result);
        return result;
      }

      public class Get extends DialogflowRequest<com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation> {

        private static final String REST_PATH = "v2beta1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/operations/[^/]+$");

        /**
         * Gets the latest state of a long-running operation.  Clients can use this method to poll the
         * operation result at intervals as recommended by the API service.
         *
         * Create a request for the method "operations.get".
         *
         * This request holds the parameters needed by the the dialogflow server.  After setting any
         * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
         * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name The name of the operation resource.
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(Dialogflow.this, "GET", REST_PATH, null, com.google.api.services.dialogflow.v2beta1.model.GoogleLongrunningOperation.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/operations/[^/]+$");
          }
        }

        @Override
        public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
          return super.executeUsingHead();
        }

        @Override
        public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
          return super.buildHttpRequestUsingHead();
        }

        @Override
        public Get set$Xgafv(java.lang.String $Xgafv) {
          return (Get) super.set$Xgafv($Xgafv);
        }

        @Override
        public Get setAccessToken(java.lang.String accessToken) {
          return (Get) super.setAccessToken(accessToken);
        }

        @Override
        public Get setAlt(java.lang.String alt) {
          return (Get) super.setAlt(alt);
        }

        @Override
        public Get setCallback(java.lang.String callback) {
          return (Get) super.setCallback(callback);
        }

        @Override
        public Get setFields(java.lang.String fields) {
          return (Get) super.setFields(fields);
        }

        @Override
        public Get setKey(java.lang.String key) {
          return (Get) super.setKey(key);
        }

        @Override
        public Get setOauthToken(java.lang.String oauthToken) {
          return (Get) super.setOauthToken(oauthToken);
        }

        @Override
        public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
          return (Get) super.setPrettyPrint(prettyPrint);
        }

        @Override
        public Get setQuotaUser(java.lang.String quotaUser) {
          return (Get) super.setQuotaUser(quotaUser);
        }

        @Override
        public Get setUploadType(java.lang.String uploadType) {
          return (Get) super.setUploadType(uploadType);
        }

        @Override
        public Get setUploadProtocol(java.lang.String uploadProtocol) {
          return (Get) super.setUploadProtocol(uploadProtocol);
        }

        /** The name of the operation resource. */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** The name of the operation resource.
         */
        public java.lang.String getName() {
          return name;
        }

        /** The name of the operation resource. */
        public Get setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/operations/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Get set(String parameterName, Object value) {
          return (Get) super.set(parameterName, value);
        }
      }

    }
  }

  /**
   * Builder for {@link Dialogflow}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {

    /**
     * Returns an instance of a new builder.
     *
     * @param transport HTTP transport, which should normally be:
     *        <ul>
     *        <li>Google App Engine:
     *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
     *        <li>Android: {@code newCompatibleTransport} from
     *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
     *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
     *        </li>
     *        </ul>
     * @param jsonFactory JSON factory, which may be:
     *        <ul>
     *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
     *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
     *        <li>Android Honeycomb or higher:
     *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
     *        </ul>
     * @param httpRequestInitializer HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
        com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      super(
          transport,
          jsonFactory,
          DEFAULT_ROOT_URL,
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Dialogflow}. */
    @Override
    public Dialogflow build() {
      return new Dialogflow(this);
    }

    @Override
    public Builder setRootUrl(String rootUrl) {
      return (Builder) super.setRootUrl(rootUrl);
    }

    @Override
    public Builder setServicePath(String servicePath) {
      return (Builder) super.setServicePath(servicePath);
    }

    @Override
    public Builder setBatchPath(String batchPath) {
      return (Builder) super.setBatchPath(batchPath);
    }

    @Override
    public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
    }

    @Override
    public Builder setApplicationName(String applicationName) {
      return (Builder) super.setApplicationName(applicationName);
    }

    @Override
    public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
      return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
    }

    @Override
    public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
      return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
    }

    @Override
    public Builder setSuppressAllChecks(boolean suppressAllChecks) {
      return (Builder) super.setSuppressAllChecks(suppressAllChecks);
    }

    /**
     * Set the {@link DialogflowRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setDialogflowRequestInitializer(
        DialogflowRequestInitializer dialogflowRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(dialogflowRequestInitializer);
    }

    @Override
    public Builder setGoogleClientRequestInitializer(
        com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
    }
  }
}
