text:
/*
 * 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.documentai.v1beta3;

/**
 * Service definition for Document (v1beta3).
 *
 *

 * Service to parse structured information from unstructured or semi-structured documents using state-of-the-art Google AI such as natural language, computer vision, translation, and AutoML.
 *

 *
 *

 * For more information about this service, see the
 * API Documentation
 *

 *
 *

 * This service uses {@link DocumentRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 *

 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Document 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 >= 32 ||
        (com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 &&
        com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1)),
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.31.1 of google-api-client to run version " +
        "1.32.1 of the Cloud Document AI 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://documentai.googleapis.com/";

  /**
   * The default encoded mTLS root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.31
   */
  public static final String DEFAULT_MTLS_ROOT_URL = "https://documentai.mtls.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.
   *
   *

   * Use {@link Builder} if you need to specify any of the optional parameters.
   *

   *
   * @param transport HTTP transport, which should normally be:
   *

   *
Google App Engine:
   *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}

   *
Android: {@code newCompatibleTransport} from
   *        {@code com.google.api.client.extensions.android.http.AndroidHttp}

   *
Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
   *

   *

   * @param jsonFactory JSON factory, which may be:
   *

   *
Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}

   *
Google GSON: {@code com.google.api.client.json.gson.GsonFactory}

   *
Android Honeycomb or higher:
   *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}

   *

   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Document(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
   */
  Document(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.
   *
   *
The typical use is:

   *

   *   {@code Document documentai = new Document(...);}
   *   {@code Document.Projects.List request = documentai.projects().list(parameters ...)}
   *

   *
   * @return the resource collection
   */
  public Projects projects() {
    return new Projects();
  }

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

    /**
     * An accessor for creating requests from the Locations collection.
     *
     *
The typical use is:

     *

     *   {@code Document documentai = new Document(...);}
     *   {@code Document.Locations.List request = documentai.locations().list(parameters ...)}
     *

     *
     * @return the resource collection
     */
    public Locations locations() {
      return new Locations();
    }

    /**
     * The "locations" collection of methods.
     */
    public class Locations {

      /**
       * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
       * paginated.
       *
       * Create a request for the method "locations.fetchProcessorTypes".
       *
       * This request holds the parameters needed by the documentai server.  After setting any optional
       * parameters, call the {@link FetchProcessorTypes#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project of processor type to list. The available processor types may depend on the
       *        allow-listing on projects. Format: `projects/{project}/locations/{location}`
       * @return the request
       */
      public FetchProcessorTypes fetchProcessorTypes(java.lang.String parent) throws java.io.IOException {
        FetchProcessorTypes result = new FetchProcessorTypes(parent);
        initialize(result);
        return result;
      }

      public class FetchProcessorTypes extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse> {

        private static final String REST_PATH = "v1beta3/{+parent}:fetchProcessorTypes";

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

        /**
         * Fetches processor types. Note that we do not use ListProcessorTypes here because it is not
         * paginated.
         *
         * Create a request for the method "locations.fetchProcessorTypes".
         *
         * This request holds the parameters needed by the the documentai server.  After setting any
         * optional parameters, call the {@link FetchProcessorTypes#execute()} method to invoke the remote
         * operation.
 {@link FetchProcessorTypes#initialize(com.google.api.client.googleapis.services.
         * AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
         * invoking the constructor.

         *
         * @param parent Required. The project of processor type to list. The available processor types may depend on the
       *        allow-listing on projects. Format: `projects/{project}/locations/{location}`
         * @since 1.13
         */
        protected FetchProcessorTypes(java.lang.String parent) {
          super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3FetchProcessorTypesResponse.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/[^/]+/locations/[^/]+$");
          }
        }

        @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 FetchProcessorTypes set$Xgafv(java.lang.String $Xgafv) {
          return (FetchProcessorTypes) super.set$Xgafv($Xgafv);
        }

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

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

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

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

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

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

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

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

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

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

        /**
         * Required. The project of processor type to list. The available processor types may depend
         * on the allow-listing on projects. Format: `projects/{project}/locations/{location}`
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project of processor type to list. The available processor types may depend on the
       allow-listing on projects. Format: `projects/{project}/locations/{location}`
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project of processor type to list. The available processor types may depend
         * on the allow-listing on projects. Format: `projects/{project}/locations/{location}`
         */
        public FetchProcessorTypes 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/[^/]+/locations/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        @Override
        public FetchProcessorTypes set(String parameterName, Object value) {
          return (FetchProcessorTypes) super.set(parameterName, value);
        }
      }
      /**
       * Gets information about a location.
       *
       * Create a request for the method "locations.get".
       *
       * This request holds the parameters needed by the documentai server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation.
       *
       * @param name Resource name for the location.
       * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudLocationLocation> {

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

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

        /**
         * Gets information about a location.
         *
         * Create a request for the method "locations.get".
         *
         * This request holds the parameters needed by the the documentai server.  After setting any
         * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.

         * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor.

         *
         * @param name Resource name for the location.
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudLocationLocation.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/[^/]+/locations/[^/]+$");
          }
        }

        @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);
        }

        /** Resource name for the location. */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Resource name for the location.
         */
        public java.lang.String getName() {
          return name;
        }

        /** Resource name for the location. */
        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/[^/]+/locations/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Get set(String parameterName, Object value) {
          return (Get) super.set(parameterName, value);
        }
      }
      /**
       * Lists information about the supported locations for this service.
       *
       * Create a request for the method "locations.list".
       *
       * This request holds the parameters needed by the documentai server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param name The resource that owns the locations collection, if applicable.
       * @return the request
       */
      public List list(java.lang.String name) throws java.io.IOException {
        List result = new List(name);
        initialize(result);
        return result;
      }

      public class List extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudLocationListLocationsResponse> {

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

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

        /**
         * Lists information about the supported locations for this service.
         *
         * Create a request for the method "locations.list".
         *
         * This request holds the parameters needed by the the documentai server.  After setting any
         * optional parameters, call the {@link List#execute()} method to invoke the remote operation.

         * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor.

         *
         * @param name The resource that owns the locations collection, if applicable.
         * @since 1.13
         */
        protected List(java.lang.String name) {
          super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudLocationListLocationsResponse.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/[^/]+$");
          }
        }

        @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);
        }

        /** The resource that owns the locations collection, if applicable. */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** The resource that owns the locations collection, if applicable.
         */
        public java.lang.String getName() {
          return name;
        }

        /** The resource that owns the locations collection, if applicable. */
        public List 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/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /**
         * A filter to narrow down results to a preferred subset. The filtering language accepts
         * strings like `"displayName=tokyo"`, and is documented in more detail in
         * [AIP-160](https://google.aip.dev/160).
         */
        @com.google.api.client.util.Key
        private java.lang.String filter;

        /** A filter to narrow down results to a preferred subset. The filtering language accepts strings like
       `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
         */
        public java.lang.String getFilter() {
          return filter;
        }

        /**
         * A filter to narrow down results to a preferred subset. The filtering language accepts
         * strings like `"displayName=tokyo"`, and is documented in more detail in
         * [AIP-160](https://google.aip.dev/160).
         */
        public List setFilter(java.lang.String filter) {
          this.filter = filter;
          return this;
        }

        /** The maximum number of results to return. If not set, the service selects a default. */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** The maximum number of results to return. If not set, the service selects a default.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /** The maximum number of results to return. If not set, the service selects a default. */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * A page token received from the `next_page_token` field in the response. Send that page
         * token to receive the subsequent page.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** A page token received from the `next_page_token` field in the response. Send that page token to
       receive the subsequent page.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * A page token received from the `next_page_token` field in the response. Send that page
         * token to receive the subsequent page.
         */
        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);
        }
      }

      /**
       * An accessor for creating requests from the Operations collection.
       *
       *
The typical use is:

       *

       *   {@code Document documentai = new Document(...);}
       *   {@code Document.Operations.List request = documentai.operations().list(parameters ...)}
       *

       *
       * @return the resource collection
       */
      public Operations operations() {
        return new Operations();
      }

      /**
       * The "operations" collection of methods.
       */
      public class Operations {

        /**
         * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to
         * cancel the operation, but success is not guaranteed. If the server doesn't support this method,
         * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other
         * methods to check whether the cancellation succeeded or whether the operation completed despite
         * cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an
         * operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to
         * `Code.CANCELLED`.
         *
         * Create a request for the method "operations.cancel".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Cancel#execute()} method to invoke the remote operation.
         *
         * @param name The name of the operation resource to be cancelled.
         * @return the request
         */
        public Cancel cancel(java.lang.String name) throws java.io.IOException {
          Cancel result = new Cancel(name);
          initialize(result);
          return result;
        }

        public class Cancel extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleProtobufEmpty> {

          private static final String REST_PATH = "v1beta3/{+name}:cancel";

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

          /**
           * Starts asynchronous cancellation on a long-running operation. The server makes a best effort to
           * cancel the operation, but success is not guaranteed. If the server doesn't support this method,
           * it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other
           * methods to check whether the cancellation succeeded or whether the operation completed despite
           * cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an
           * operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to
           * `Code.CANCELLED`.
           *
           * Create a request for the method "operations.cancel".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Cancel#execute()} method to invoke the remote operation.
           *
 {@link
           * Cancel#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name The name of the operation resource to be cancelled.
           * @since 1.13
           */
          protected Cancel(java.lang.String name) {
            super(Document.this, "POST", REST_PATH, null, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/operations/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /** The name of the operation resource to be cancelled. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The name of the operation resource to be cancelled.
           */
          public java.lang.String getName() {
            return name;
          }

          /** The name of the operation resource to be cancelled. */
          public Cancel 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/[^/]+/locations/[^/]+/operations/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Cancel set(String parameterName, Object value) {
            return (Cancel) super.set(parameterName, value);
          }
        }
        /**
         * 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 documentai 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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

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

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/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 documentai server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.

           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name The name of the operation resource.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/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/[^/]+/locations/[^/]+/operations/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Lists operations that match the specified filter in the request. If the server doesn't support
         * this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override
         * the binding to use different resource name schemes, such as `users/operations`. To override the
         * binding, API services can add a binding such as `"/v1/{name=users}/operations"` to their service
         * configuration. For backwards compatibility, the default name includes the operations collection
         * id, however overriding users must ensure the name binding is the parent resource, without the
         * operations collection id.
         *
         * Create a request for the method "operations.list".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param name The name of the operation's parent resource.
         * @return the request
         */
        public List list(java.lang.String name) throws java.io.IOException {
          List result = new List(name);
          initialize(result);
          return result;
        }

        public class List extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningListOperationsResponse> {

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

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

          /**
           * Lists operations that match the specified filter in the request. If the server doesn't support
           * this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
           * override the binding to use different resource name schemes, such as `users/operations`. To
           * override the binding, API services can add a binding such as `"/v1/{name=users}/operations"` to
           * their service configuration. For backwards compatibility, the default name includes the
           * operations collection id, however overriding users must ensure the name binding is the parent
           * resource, without the operations collection id.
           *
           * Create a request for the method "operations.list".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation.

           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name The name of the operation's parent resource.
           * @since 1.13
           */
          protected List(java.lang.String name) {
            super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleLongrunningListOperationsResponse.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/[^/]+/locations/[^/]+/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 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);
          }

          /** The name of the operation's parent resource. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** The name of the operation's parent resource.
           */
          public java.lang.String getName() {
            return name;
          }

          /** The name of the operation's parent resource. */
          public List 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/[^/]+/locations/[^/]+/operations$");
            }
            this.name = name;
            return this;
          }

          /** The standard list filter. */
          @com.google.api.client.util.Key
          private java.lang.String filter;

          /** The standard list filter.
           */
          public java.lang.String getFilter() {
            return filter;
          }

          /** The standard list filter. */
          public List setFilter(java.lang.String filter) {
            this.filter = filter;
            return this;
          }

          /** The standard list page size. */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** The standard list page size.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /** The standard list page size. */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** The standard list page token. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** The standard list page token.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** The standard list page token. */
          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);
          }
        }

      }
      /**
       * An accessor for creating requests from the ProcessorTypes collection.
       *
       *
The typical use is:

       *

       *   {@code Document documentai = new Document(...);}
       *   {@code Document.ProcessorTypes.List request = documentai.processorTypes().list(parameters ...)}
       *

       *
       * @return the resource collection
       */
      public ProcessorTypes processorTypes() {
        return new ProcessorTypes();
      }

      /**
       * The "processorTypes" collection of methods.
       */
      public class ProcessorTypes {

        /**
         * Lists the processor types that exist.
         *
         * Create a request for the method "processorTypes.list".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The location of processor type to list. The available processor types may depend on the
         *        allow-listing on projects. Format: `projects/{project}/locations/{location}`
         * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorTypesResponse> {

          private static final String REST_PATH = "v1beta3/{+parent}/processorTypes";

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

          /**
           * Lists the processor types that exist.
           *
           * Create a request for the method "processorTypes.list".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation.

           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param parent Required. The location of processor type to list. The available processor types may depend on the
         *        allow-listing on projects. Format: `projects/{project}/locations/{location}`
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorTypesResponse.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/[^/]+/locations/[^/]+$");
            }
          }

          @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 location of processor type to list. The available processor types may
           * depend on the allow-listing on projects. Format:
           * `projects/{project}/locations/{location}`
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The location of processor type to list. The available processor types may depend on the
         allow-listing on projects. Format: `projects/{project}/locations/{location}`
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The location of processor type to list. The available processor types may
           * depend on the allow-listing on projects. Format:
           * `projects/{project}/locations/{location}`
           */
          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/[^/]+/locations/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * The maximum number of processor types to return. If unspecified, at most 100 processor
           * types will be returned. The maximum value is 500; values above 500 will be coerced to
           * 500.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** The maximum number of processor types to return. If unspecified, at most 100 processor types will
         be returned. The maximum value is 500; values above 500 will be coerced to 500.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * The maximum number of processor types to return. If unspecified, at most 100 processor
           * types will be returned. The maximum value is 500; values above 500 will be coerced to
           * 500.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /** Used to retrieve the next page of results, empty if at the end of the list. */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** Used to retrieve the next page of results, empty if at the end of the list.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /** Used to retrieve the next page of results, empty if at the end of the list. */
          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);
          }
        }

      }
      /**
       * An accessor for creating requests from the Processors collection.
       *
       *
The typical use is:

       *

       *   {@code Document documentai = new Document(...);}
       *   {@code Document.Processors.List request = documentai.processors().list(parameters ...)}
       *

       *
       * @return the resource collection
       */
      public Processors processors() {
        return new Processors();
      }

      /**
       * The "processors" collection of methods.
       */
      public class Processors {

        /**
         * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in
         * the [Document] format.
         *
         * Create a request for the method "processors.batchProcess".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link BatchProcess#execute()} method to invoke the remote operation.
         *
         * @param name Required. The resource name of Processor or ProcessorVersion. Format:
         *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
         *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest}
         * @return the request
         */
        public BatchProcess batchProcess(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest content) throws java.io.IOException {
          BatchProcess result = new BatchProcess(name, content);
          initialize(result);
          return result;
        }

        public class BatchProcess extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v1beta3/{+name}:batchProcess";

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

          /**
           * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in
           * the [Document] format.
           *
           * Create a request for the method "processors.batchProcess".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link BatchProcess#execute()} method to invoke the remote
           * operation.
 {@link
           * BatchProcess#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The resource name of Processor or ProcessorVersion. Format:
         *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
         *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest}
           * @since 1.13
           */
          protected BatchProcess(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Required. The resource name of Processor or ProcessorVersion. Format:
           * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project
           * }/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The resource name of Processor or ProcessorVersion. Format:
         `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/
         {location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The resource name of Processor or ProcessorVersion. Format:
           * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project
           * }/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          public BatchProcess 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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public BatchProcess set(String parameterName, Object value) {
            return (BatchProcess) super.set(parameterName, value);
          }
        }
        /**
         * Creates a processor from the type processor that the user chose. The processor will be at
         * "ENABLED" state by default after its creation.
         *
         * Create a request for the method "processors.create".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The parent (project and location) under which to create the processor. Format:
         *        `projects/{project}/locations/{location}`
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor> {

          private static final String REST_PATH = "v1beta3/{+parent}/processors";

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

          /**
           * Creates a processor from the type processor that the user chose. The processor will be at
           * "ENABLED" state by default after its creation.
           *
           * Create a request for the method "processors.create".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
 {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param parent Required. The parent (project and location) under which to create the processor. Format:
         *        `projects/{project}/locations/{location}`
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor.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/[^/]+/locations/[^/]+$");
            }
          }

          @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 parent (project and location) under which to create the processor.
           * Format: `projects/{project}/locations/{location}`
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The parent (project and location) under which to create the processor. Format:
         `projects/{project}/locations/{location}`
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The parent (project and location) under which to create the processor.
           * Format: `projects/{project}/locations/{location}`
           */
          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/[^/]+/locations/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          @Override
          public Create set(String parameterName, Object value) {
            return (Create) super.set(parameterName, value);
          }
        }
        /**
         * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
         * all artifacts associated with this processor.
         *
         * Create a request for the method "processors.delete".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name Required. The processor resource name to be deleted.
         * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

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

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

          /**
           * Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes
           * all artifacts associated with this processor.
           *
           * Create a request for the method "processors.delete".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
 {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The processor resource name to be deleted.
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(Document.this, "DELETE", REST_PATH, null, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

          @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 processor resource name to be deleted. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The processor resource name to be deleted.
           */
          public java.lang.String getName() {
            return name;
          }

          /** Required. The processor resource name to be deleted. */
          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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Disables a processor
         *
         * Create a request for the method "processors.disable".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Disable#execute()} method to invoke the remote operation.
         *
         * @param name Required. The processor resource name to be disabled.
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DisableProcessorRequest}
         * @return the request
         */
        public Disable disable(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DisableProcessorRequest content) throws java.io.IOException {
          Disable result = new Disable(name, content);
          initialize(result);
          return result;
        }

        public class Disable extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v1beta3/{+name}:disable";

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

          /**
           * Disables a processor
           *
           * Create a request for the method "processors.disable".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Disable#execute()} method to invoke the remote operation.
           *
 {@link
           * Disable#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The processor resource name to be disabled.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DisableProcessorRequest}
           * @since 1.13
           */
          protected Disable(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DisableProcessorRequest content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /** Required. The processor resource name to be disabled. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The processor resource name to be disabled.
           */
          public java.lang.String getName() {
            return name;
          }

          /** Required. The processor resource name to be disabled. */
          public Disable 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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Disable set(String parameterName, Object value) {
            return (Disable) super.set(parameterName, value);
          }
        }
        /**
         * Enables a processor
         *
         * Create a request for the method "processors.enable".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Enable#execute()} method to invoke the remote operation.
         *
         * @param name Required. The processor resource name to be enabled.
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3EnableProcessorRequest}
         * @return the request
         */
        public Enable enable(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3EnableProcessorRequest content) throws java.io.IOException {
          Enable result = new Enable(name, content);
          initialize(result);
          return result;
        }

        public class Enable extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v1beta3/{+name}:enable";

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

          /**
           * Enables a processor
           *
           * Create a request for the method "processors.enable".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Enable#execute()} method to invoke the remote operation.
           *
 {@link
           * Enable#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The processor resource name to be enabled.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3EnableProcessorRequest}
           * @since 1.13
           */
          protected Enable(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3EnableProcessorRequest content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /** Required. The processor resource name to be enabled. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The processor resource name to be enabled.
           */
          public java.lang.String getName() {
            return name;
          }

          /** Required. The processor resource name to be enabled. */
          public Enable 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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Enable set(String parameterName, Object value) {
            return (Enable) super.set(parameterName, value);
          }
        }
        /**
         * Gets a processor detail.
         *
         * Create a request for the method "processors.get".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The processor resource name.
         * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor> {

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

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

          /**
           * Gets a processor detail.
           *
           * Create a request for the method "processors.get".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.

           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The processor resource name.
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3Processor.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

          @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 processor resource name. */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The processor resource name.
           */
          public java.lang.String getName() {
            return name;
          }

          /** Required. The processor resource name. */
          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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Lists all processors which belong to this project.
         *
         * Create a request for the method "processors.list".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The parent (project and location) which owns this collection of Processors. Format:
         *        `projects/{project}/locations/{location}`
         * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorsResponse> {

          private static final String REST_PATH = "v1beta3/{+parent}/processors";

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

          /**
           * Lists all processors which belong to this project.
           *
           * Create a request for the method "processors.list".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation.

           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor.

           *
           * @param parent Required. The parent (project and location) which owns this collection of Processors. Format:
         *        `projects/{project}/locations/{location}`
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorsResponse.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/[^/]+/locations/[^/]+$");
            }
          }

          @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 parent (project and location) which owns this collection of Processors.
           * Format: `projects/{project}/locations/{location}`
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The parent (project and location) which owns this collection of Processors. Format:
         `projects/{project}/locations/{location}`
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The parent (project and location) which owns this collection of Processors.
           * Format: `projects/{project}/locations/{location}`
           */
          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/[^/]+/locations/[^/]+$");
            }
            this.parent = parent;
            return this;
          }

          /**
           * The maximum number of processors to return. If unspecified, at most 50 processors will
           * be returned. The maximum value is 100; values above 100 will be coerced to 100.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** The maximum number of processors to return. If unspecified, at most 50 processors will be returned.
         The maximum value is 100; values above 100 will be coerced to 100.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * The maximum number of processors to return. If unspecified, at most 50 processors will
           * be returned. The maximum value is 100; values above 100 will be coerced to 100.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /**
           * We will return the processors sorted by creation time. The page token will point to the
           * next processor.
           */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** We will return the processors sorted by creation time. The page token will point to the next
         processor.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /**
           * We will return the processors sorted by creation time. The page token will point to the
           * next processor.
           */
          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);
          }
        }
        /**
         * Processes a single document.
         *
         * Create a request for the method "processors.process".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link Process#execute()} method to invoke the remote operation.
         *
         * @param name Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
         *        Processor is specified, the server will use its default version. Format:
         *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
         *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest}
         * @return the request
         */
        public Process process(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest content) throws java.io.IOException {
          Process result = new Process(name, content);
          initialize(result);
          return result;
        }

        public class Process extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessResponse> {

          private static final String REST_PATH = "v1beta3/{+name}:process";

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

          /**
           * Processes a single document.
           *
           * Create a request for the method "processors.process".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link Process#execute()} method to invoke the remote operation.
           *
 {@link
           * Process#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor.

           *
           * @param name Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
         *        Processor is specified, the server will use its default version. Format:
         *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
         *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest}
           * @since 1.13
           */
          protected Process(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessResponse.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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Required. The resource name of the Processor or ProcessorVersion to use for processing.
           * If a Processor is specified, the server will use its default version. Format:
           * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project
           * }/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
         Processor is specified, the server will use its default version. Format:
         `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/
         {location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The resource name of the Processor or ProcessorVersion to use for processing.
           * If a Processor is specified, the server will use its default version. Format:
           * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project
           * }/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           */
          public Process 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/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Process set(String parameterName, Object value) {
            return (Process) super.set(parameterName, value);
          }
        }
        /**
         * Set the default (active) version of a Processor that will be used in ProcessDocument and
         * BatchProcessDocuments.
         *
         * Create a request for the method "processors.setDefaultProcessorVersion".
         *
         * This request holds the parameters needed by the documentai server.  After setting any optional
         * parameters, call the {@link SetDefaultProcessorVersion#execute()} method to invoke the remote
         * operation.
         *
         * @param processor Required. The resource name of the Processor to change default version.
         * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionRequest}
         * @return the request
         */
        public SetDefaultProcessorVersion setDefaultProcessorVersion(java.lang.String processor, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionRequest content) throws java.io.IOException {
          SetDefaultProcessorVersion result = new SetDefaultProcessorVersion(processor, content);
          initialize(result);
          return result;
        }

        public class SetDefaultProcessorVersion extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

          private static final String REST_PATH = "v1beta3/{+processor}:setDefaultProcessorVersion";

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

          /**
           * Set the default (active) version of a Processor that will be used in ProcessDocument and
           * BatchProcessDocuments.
           *
           * Create a request for the method "processors.setDefaultProcessorVersion".
           *
           * This request holds the parameters needed by the the documentai server.  After setting any
           * optional parameters, call the {@link SetDefaultProcessorVersion#execute()} method to invoke the
           * remote operation.
 {@link SetDefaultProcessorVersion#initialize(com.google.api.client.google
           * apis.services.AbstractGoogleClientRequest)} must be called to initialize this instance
           * immediately after invoking the constructor.

           *
           * @param processor Required. The resource name of the Processor to change default version.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionRequest}
           * @since 1.13
           */
          protected SetDefaultProcessorVersion(java.lang.String processor, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3SetDefaultProcessorVersionRequest content) {
            super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation.class);
            this.processor = com.google.api.client.util.Preconditions.checkNotNull(processor, "Required parameter processor must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PROCESSOR_PATTERN.matcher(processor).matches(),
                  "Parameter processor must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /** Required. The resource name of the Processor to change default version. */
          @com.google.api.client.util.Key
          private java.lang.String processor;

          /** Required. The resource name of the Processor to change default version.
           */
          public java.lang.String getProcessor() {
            return processor;
          }

          /** Required. The resource name of the Processor to change default version. */
          public SetDefaultProcessorVersion setProcessor(java.lang.String processor) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(PROCESSOR_PATTERN.matcher(processor).matches(),
                  "Parameter processor must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/processors/[^/]+$");
            }
            this.processor = processor;
            return this;
          }

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

        /**
         * An accessor for creating requests from the HumanReviewConfig collection.
         *
         *
The typical use is:

         *

         *   {@code Document documentai = new Document(...);}
         *   {@code Document.HumanReviewConfig.List request = documentai.humanReviewConfig().list(parameters ...)}
         *

         *
         * @return the resource collection
         */
        public HumanReviewConfig humanReviewConfig() {
          return new HumanReviewConfig();
        }

        /**
         * The "humanReviewConfig" collection of methods.
         */
        public class HumanReviewConfig {

          /**
           * Send a document for Human Review. The input document should be processed by the specified
           * processor.
           *
           * Create a request for the method "humanReviewConfig.reviewDocument".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link ReviewDocument#execute()} method to invoke the remote operation.
           *
           * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document will be reviewed with.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ReviewDocumentRequest}
           * @return the request
           */
          public ReviewDocument reviewDocument(java.lang.String humanReviewConfig, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ReviewDocumentRequest content) throws java.io.IOException {
            ReviewDocument result = new ReviewDocument(humanReviewConfig, content);
            initialize(result);
            return result;
          }

          public class ReviewDocument extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v1beta3/{+humanReviewConfig}:reviewDocument";

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

            /**
             * Send a document for Human Review. The input document should be processed by the specified
             * processor.
             *
             * Create a request for the method "humanReviewConfig.reviewDocument".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link ReviewDocument#execute()} method to invoke the remote
             * operation.
 {@link ReviewDocument#initialize(com.google.api.client.googleapis.services.Abstr
             * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
             * the constructor.

             *
             * @param humanReviewConfig Required. The resource name of the HumanReviewConfig that the document will be reviewed with.
             * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ReviewDocumentRequest}
             * @since 1.13
             */
            protected ReviewDocument(java.lang.String humanReviewConfig, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ReviewDocumentRequest content) {
              super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation.class);
              this.humanReviewConfig = com.google.api.client.util.Preconditions.checkNotNull(humanReviewConfig, "Required parameter humanReviewConfig must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(HUMAN_REVIEW_CONFIG_PATTERN.matcher(humanReviewConfig).matches(),
                    "Parameter humanReviewConfig must conform to the pattern " +
                    "^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /**
             * Required. The resource name of the HumanReviewConfig that the document will be
             * reviewed with.
             */
            @com.google.api.client.util.Key
            private java.lang.String humanReviewConfig;

            /** Required. The resource name of the HumanReviewConfig that the document will be reviewed with.
             */
            public java.lang.String getHumanReviewConfig() {
              return humanReviewConfig;
            }

            /**
             * Required. The resource name of the HumanReviewConfig that the document will be
             * reviewed with.
             */
            public ReviewDocument setHumanReviewConfig(java.lang.String humanReviewConfig) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(HUMAN_REVIEW_CONFIG_PATTERN.matcher(humanReviewConfig).matches(),
                    "Parameter humanReviewConfig must conform to the pattern " +
                    "^projects/[^/]+/locations/[^/]+/processors/[^/]+/humanReviewConfig$");
              }
              this.humanReviewConfig = humanReviewConfig;
              return this;
            }

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

        }
        /**
         * An accessor for creating requests from the ProcessorVersions collection.
         *
         *
The typical use is:

         *

         *   {@code Document documentai = new Document(...);}
         *   {@code Document.ProcessorVersions.List request = documentai.processorVersions().list(parameters ...)}
         *

         *
         * @return the resource collection
         */
        public ProcessorVersions processorVersions() {
          return new ProcessorVersions();
        }

        /**
         * The "processorVersions" collection of methods.
         */
        public class ProcessorVersions {

          /**
           * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in
           * the [Document] format.
           *
           * Create a request for the method "processorVersions.batchProcess".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link BatchProcess#execute()} method to invoke the remote operation.
           *
           * @param name Required. The resource name of Processor or ProcessorVersion. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
           *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest}
           * @return the request
           */
          public BatchProcess batchProcess(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest content) throws java.io.IOException {
            BatchProcess result = new BatchProcess(name, content);
            initialize(result);
            return result;
          }

          public class BatchProcess extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v1beta3/{+name}:batchProcess";

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

            /**
             * LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in
             * the [Document] format.
             *
             * Create a request for the method "processorVersions.batchProcess".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link BatchProcess#execute()} method to invoke the remote
             * operation.
 {@link
             * BatchProcess#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The resource name of Processor or ProcessorVersion. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
           *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
             * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest}
             * @since 1.13
             */
            protected BatchProcess(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3BatchProcessRequest content) {
              super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /**
             * Required. The resource name of Processor or ProcessorVersion. Format:
             * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{proje
             * ct}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The resource name of Processor or ProcessorVersion. Format:
           `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/
           {location}/processors/{processor}/processorVersions/{processorVersion}`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The resource name of Processor or ProcessorVersion. Format:
             * `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{proje
             * ct}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
             */
            public BatchProcess 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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public BatchProcess set(String parameterName, Object value) {
              return (BatchProcess) super.set(parameterName, value);
            }
          }
          /**
           * Deletes the processor version, all artifacts under the processor version will be deleted.
           *
           * Create a request for the method "processorVersions.delete".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name Required. The processor version resource name to be deleted.
           * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

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

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

            /**
             * Deletes the processor version, all artifacts under the processor version will be deleted.
             *
             * Create a request for the method "processorVersions.delete".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             *
 {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The processor version resource name to be deleted.
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(Document.this, "DELETE", REST_PATH, null, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

            @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 processor version resource name to be deleted. */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The processor version resource name to be deleted.
             */
            public java.lang.String getName() {
              return name;
            }

            /** Required. The processor version resource name to be deleted. */
            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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Delete set(String parameterName, Object value) {
              return (Delete) super.set(parameterName, value);
            }
          }
          /**
           * Deploys the processor version.
           *
           * Create a request for the method "processorVersions.deploy".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link Deploy#execute()} method to invoke the remote operation.
           *
           * @param name Required. The processor version resource name to be deployed.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DeployProcessorVersionRequest}
           * @return the request
           */
          public Deploy deploy(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DeployProcessorVersionRequest content) throws java.io.IOException {
            Deploy result = new Deploy(name, content);
            initialize(result);
            return result;
          }

          public class Deploy extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v1beta3/{+name}:deploy";

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

            /**
             * Deploys the processor version.
             *
             * Create a request for the method "processorVersions.deploy".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link Deploy#execute()} method to invoke the remote operation.
             *
 {@link
             * Deploy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The processor version resource name to be deployed.
             * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DeployProcessorVersionRequest}
             * @since 1.13
             */
            protected Deploy(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3DeployProcessorVersionRequest content) {
              super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /** Required. The processor version resource name to be deployed. */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The processor version resource name to be deployed.
             */
            public java.lang.String getName() {
              return name;
            }

            /** Required. The processor version resource name to be deployed. */
            public Deploy 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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Deploy set(String parameterName, Object value) {
              return (Deploy) super.set(parameterName, value);
            }
          }
          /**
           * Gets a processor version detail.
           *
           * Create a request for the method "processorVersions.get".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link Get#execute()} method to invoke the remote operation.
           *
           * @param name Required. The processor resource name.
           * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessorVersion> {

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

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

            /**
             * Gets a processor version detail.
             *
             * Create a request for the method "processorVersions.get".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.

             * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The processor resource name.
             * @since 1.13
             */
            protected Get(java.lang.String name) {
              super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessorVersion.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

            @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 processor resource name. */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The processor resource name.
             */
            public java.lang.String getName() {
              return name;
            }

            /** Required. The processor resource name. */
            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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Get set(String parameterName, Object value) {
              return (Get) super.set(parameterName, value);
            }
          }
          /**
           * Lists all versions of a processor.
           *
           * Create a request for the method "processorVersions.list".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link List#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The parent (project, location and processor) to list all versions. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`
           * @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 DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorVersionsResponse> {

            private static final String REST_PATH = "v1beta3/{+parent}/processorVersions";

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

            /**
             * Lists all versions of a processor.
             *
             * Create a request for the method "processorVersions.list".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link List#execute()} method to invoke the remote operation.

             * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor.

             *
             * @param parent Required. The parent (project, location and processor) to list all versions. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`
             * @since 1.13
             */
            protected List(java.lang.String parent) {
              super(Document.this, "GET", REST_PATH, null, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ListProcessorVersionsResponse.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/[^/]+/locations/[^/]+/processors/[^/]+$");
              }
            }

            @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 parent (project, location and processor) to list all versions. Format:
             * `projects/{project}/locations/{location}/processors/{processor}`
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The parent (project, location and processor) to list all versions. Format:
           `projects/{project}/locations/{location}/processors/{processor}`
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The parent (project, location and processor) to list all versions. Format:
             * `projects/{project}/locations/{location}/processors/{processor}`
             */
            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/[^/]+/locations/[^/]+/processors/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            /**
             * The maximum number of processor versions to return. If unspecified, at most 10
             * processor versions will be returned. The maximum value is 20; values above 20 will be
             * coerced to 20.
             */
            @com.google.api.client.util.Key
            private java.lang.Integer pageSize;

            /** The maximum number of processor versions to return. If unspecified, at most 10 processor versions
           will be returned. The maximum value is 20; values above 20 will be coerced to 20.
             */
            public java.lang.Integer getPageSize() {
              return pageSize;
            }

            /**
             * The maximum number of processor versions to return. If unspecified, at most 10
             * processor versions will be returned. The maximum value is 20; values above 20 will be
             * coerced to 20.
             */
            public List setPageSize(java.lang.Integer pageSize) {
              this.pageSize = pageSize;
              return this;
            }

            /**
             * We will return the processor versions sorted by creation time. The page token will
             * point to the next processor version.
             */
            @com.google.api.client.util.Key
            private java.lang.String pageToken;

            /** We will return the processor versions sorted by creation time. The page token will point to the
           next processor version.
             */
            public java.lang.String getPageToken() {
              return pageToken;
            }

            /**
             * We will return the processor versions sorted by creation time. The page token will
             * point to the next processor version.
             */
            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);
            }
          }
          /**
           * Processes a single document.
           *
           * Create a request for the method "processorVersions.process".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link Process#execute()} method to invoke the remote operation.
           *
           * @param name Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
           *        Processor is specified, the server will use its default version. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
           *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest}
           * @return the request
           */
          public Process process(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest content) throws java.io.IOException {
            Process result = new Process(name, content);
            initialize(result);
            return result;
          }

          public class Process extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessResponse> {

            private static final String REST_PATH = "v1beta3/{+name}:process";

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

            /**
             * Processes a single document.
             *
             * Create a request for the method "processorVersions.process".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link Process#execute()} method to invoke the remote operation.
             *
 {@link
             * Process#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
           *        Processor is specified, the server will use its default version. Format:
           *        `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/l
           *        ocations/{location}/processors/{processor}/processorVersions/{processorVersion}`
             * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest}
             * @since 1.13
             */
            protected Process(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessRequest content) {
              super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3ProcessResponse.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /**
             * Required. The resource name of the Processor or ProcessorVersion to use for
             * processing. If a Processor is specified, the server will use its default version.
             * Format: `projects/{project}/locations/{location}/processors/{processor}`, or `project
             * s/{project}/locations/{location}/processors/{processor}/processorVersions/{processorV
             * ersion}`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The resource name of the Processor or ProcessorVersion to use for processing. If a
           Processor is specified, the server will use its default version. Format:
           `projects/{project}/locations/{location}/processors/{processor}`, or `projects/{project}/locations/
           {location}/processors/{processor}/processorVersions/{processorVersion}`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The resource name of the Processor or ProcessorVersion to use for
             * processing. If a Processor is specified, the server will use its default version.
             * Format: `projects/{project}/locations/{location}/processors/{processor}`, or `project
             * s/{project}/locations/{location}/processors/{processor}/processorVersions/{processorV
             * ersion}`
             */
            public Process 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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Process set(String parameterName, Object value) {
              return (Process) super.set(parameterName, value);
            }
          }
          /**
           * Undeploys the processor version.
           *
           * Create a request for the method "processorVersions.undeploy".
           *
           * This request holds the parameters needed by the documentai server.  After setting any optional
           * parameters, call the {@link Undeploy#execute()} method to invoke the remote operation.
           *
           * @param name Required. The processor version resource name to be undeployed.
           * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3UndeployProcessorVersionRequest}
           * @return the request
           */
          public Undeploy undeploy(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3UndeployProcessorVersionRequest content) throws java.io.IOException {
            Undeploy result = new Undeploy(name, content);
            initialize(result);
            return result;
          }

          public class Undeploy extends DocumentRequest<com.google.api.services.documentai.v1beta3.model.GoogleLongrunningOperation> {

            private static final String REST_PATH = "v1beta3/{+name}:undeploy";

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

            /**
             * Undeploys the processor version.
             *
             * Create a request for the method "processorVersions.undeploy".
             *
             * This request holds the parameters needed by the the documentai server.  After setting any
             * optional parameters, call the {@link Undeploy#execute()} method to invoke the remote operation.
             *
 {@link
             * Undeploy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor.

             *
             * @param name Required. The processor version resource name to be undeployed.
             * @param content the {@link com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3UndeployProcessorVersionRequest}
             * @since 1.13
             */
            protected Undeploy(java.lang.String name, com.google.api.services.documentai.v1beta3.model.GoogleCloudDocumentaiV1beta3UndeployProcessorVersionRequest content) {
              super(Document.this, "POST", REST_PATH, content, com.google.api.services.documentai.v1beta3.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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /** Required. The processor version resource name to be undeployed. */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The processor version resource name to be undeployed.
             */
            public java.lang.String getName() {
              return name;
            }

            /** Required. The processor version resource name to be undeployed. */
            public Undeploy 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/[^/]+/locations/[^/]+/processors/[^/]+/processorVersions/[^/]+$");
              }
              this.name = name;
              return this;
            }

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

        }
      }
    }
  }

  /**
   * Builder for {@link Document}.
   *
   *

   * Implementation is not thread-safe.
   *

   *
   * @since 1.3.0
   */
  public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {

    private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) {
      // If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint.
      // If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS.
      // Use the regular endpoint for all other cases.
      String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT");
      useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint;
      if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) {
        return DEFAULT_MTLS_ROOT_URL;
      }
      return DEFAULT_ROOT_URL;
    }

    /**
     * Returns an instance of a new builder.
     *
     * @param transport HTTP transport, which should normally be:
     *

     *
Google App Engine:
     *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}

     *
Android: {@code newCompatibleTransport} from
     *        {@code com.google.api.client.extensions.android.http.AndroidHttp}

     *
Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
     *

     *

     * @param jsonFactory JSON factory, which may be:
     *

     *
Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}

     *
Google GSON: {@code com.google.api.client.json.gson.GsonFactory}

     *
Android Honeycomb or higher:
     *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}

     *

     * @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,
          Builder.chooseEndpoint(transport),
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Document}. */
    @Override
    public Document build() {
      return new Document(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 DocumentRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setDocumentRequestInitializer(
        DocumentRequestInitializer documentRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(documentRequestInitializer);
    }

    @Override
    public Builder setGoogleClientRequestInitializer(
        com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
    }
  }
}