/*
 * 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.cloudtasks.v2beta3;

/**
 * Service definition for CloudTasks (v2beta3).
 *
 * <p>
 * Manages the execution of large numbers of distributed requests.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://cloud.google.com/tasks/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link CloudTasksRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class CloudTasks 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))) ||
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION >= 2,
        "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 " +
        "2.0.0 of the Cloud Tasks 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://cloudtasks.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://cloudtasks.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.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport HTTP transport, which should normally be:
   *        <ul>
   *        <li>Google App Engine:
   *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
   *        <li>Android: {@code newCompatibleTransport} from
   *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
   *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
   *        </li>
   *        </ul>
   * @param jsonFactory JSON factory, which may be:
   *        <ul>
   *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
   *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
   *        <li>Android Honeycomb or higher:
   *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
   *        </ul>
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public CloudTasks(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
   */
  CloudTasks(Builder builder) {
    super(builder);
  }

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

  /**
   * An accessor for creating requests from the Projects collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code CloudTasks cloudtasks = new CloudTasks(...);}
   *   {@code CloudTasks.Projects.List request = cloudtasks.projects().list(parameters ...)}
   * </pre>
   *
   * @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.
     *
     * <p>The typical use is:</p>
     * <pre>
     *   {@code CloudTasks cloudtasks = new CloudTasks(...);}
     *   {@code CloudTasks.Locations.List request = cloudtasks.locations().list(parameters ...)}
     * </pre>
     *
     * @return the resource collection
     */
    public Locations locations() {
      return new Locations();
    }

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

      /**
       * Gets information about a location.
       *
       * Create a request for the method "locations.get".
       *
       * This request holds the parameters needed by the cloudtasks 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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Location> {

        private static final String REST_PATH = "v2beta3/{+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 cloudtasks server.  After setting any
         * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
         * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Resource name for the location.
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.Location.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 cloudtasks 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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.ListLocationsResponse> {

        private static final String REST_PATH = "v2beta3/{+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 cloudtasks server.  After setting any
         * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
         * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
         * must be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name The resource that owns the locations collection, if applicable.
         * @since 1.13
         */
        protected List(java.lang.String name) {
          super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.ListLocationsResponse.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 Queues collection.
       *
       * <p>The typical use is:</p>
       * <pre>
       *   {@code CloudTasks cloudtasks = new CloudTasks(...);}
       *   {@code CloudTasks.Queues.List request = cloudtasks.queues().list(parameters ...)}
       * </pre>
       *
       * @return the resource collection
       */
      public Queues queues() {
        return new Queues();
      }

      /**
       * The "queues" collection of methods.
       */
      public class Queues {

        /**
         * Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days.
         * After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or
         * not. WARNING: Using this method may have unintended side effects if you are using an App Engine
         * `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
         * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
         *
         * Create a request for the method "queues.create".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Create#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The location name in which the queue will be created. For example:
         *        `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained
         *        by calling Cloud Tasks' implementation of ListLocations.
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.Queue}
         * @return the request
         */
        public Create create(java.lang.String parent, com.google.api.services.cloudtasks.v2beta3.model.Queue content) throws java.io.IOException {
          Create result = new Create(parent, content);
          initialize(result);
          return result;
        }

        public class Create extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

          private static final String REST_PATH = "v2beta3/{+parent}/queues";

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

          /**
           * Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days.
           * After a task is 31 days old, the task will be deleted regardless of whether it was dispatched
           * or not. WARNING: Using this method may have unintended side effects if you are using an App
           * Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue
           * Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this
           * method.
           *
           * Create a request for the method "queues.create".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
           * <p> {@link
           * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The location name in which the queue will be created. For example:
         *        `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained
         *        by calling Cloud Tasks' implementation of ListLocations.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.Queue}
           * @since 1.13
           */
          protected Create(java.lang.String parent, com.google.api.services.cloudtasks.v2beta3.model.Queue content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Queue.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 location name in which the queue will be created. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be
           * obtained by calling Cloud Tasks' implementation of ListLocations.
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The location name in which the queue will be created. For example:
         `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by
         calling Cloud Tasks' implementation of ListLocations.
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The location name in which the queue will be created. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be
           * obtained by calling Cloud Tasks' implementation of ListLocations.
           */
          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 a queue. This command will delete the queue even if it has tasks in it. Note: If you
         * delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this
         * method may have unintended side effects if you are using an App Engine `queue.yaml` or
         * `queue.xml` file to manage your queues. Read [Overview of Queue Management and
         * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
         *
         * Create a request for the method "queues.delete".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         *
         * @param name Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
         * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Empty> {

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

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

          /**
           * Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you
           * delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this
           * method may have unintended side effects if you are using an App Engine `queue.yaml` or
           * `queue.xml` file to manage your queues. Read [Overview of Queue Management and
           * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
           *
           * Create a request for the method "queues.delete".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           * <p> {@link
           * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           * @since 1.13
           */
          protected Delete(java.lang.String name) {
            super(CloudTasks.this, "DELETE", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.Empty.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/[^/]+/queues/[^/]+$");
            }
          }

          @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 queue name. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          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/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Delete set(String parameterName, Object value) {
            return (Delete) super.set(parameterName, value);
          }
        }
        /**
         * Gets a queue.
         *
         * Create a request for the method "queues.get".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The resource name of the queue. For example:
         *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
         * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

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

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

          /**
           * Gets a queue.
           *
           * Create a request for the method "queues.get".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
           * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The resource name of the queue. For example:
         *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.Queue.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/[^/]+/queues/[^/]+$");
            }
          }

          @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 resource name of the queue. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The resource name of the queue. For example:
         `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The resource name of the queue. For example:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           */
          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/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * Optional. Read mask is used for a more granular control over what the API returns. If
           * the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats]
           * will be returned only if it was explicitly specified in the mask.
           */
          @com.google.api.client.util.Key
          private String readMask;

          /** Optional. Read mask is used for a more granular control over what the API returns. If the mask is
         not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only
         if it was explicitly specified in the mask.
           */
          public String getReadMask() {
            return readMask;
          }

          /**
           * Optional. Read mask is used for a more granular control over what the API returns. If
           * the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats]
           * will be returned only if it was explicitly specified in the mask.
           */
          public Get setReadMask(String readMask) {
            this.readMask = readMask;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Gets the access control policy for a Queue. Returns an empty policy if the resource exists and
         * does not have a policy set. Authorization requires the following [Google
         * IAM](https://cloud.google.com/iam) permission on the specified resource parent: *
         * `cloudtasks.queues.getIamPolicy`
         *
         * Create a request for the method "queues.getIamPolicy".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote operation.
         *
         * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.GetIamPolicyRequest}
         * @return the request
         */
        public GetIamPolicy getIamPolicy(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.GetIamPolicyRequest content) throws java.io.IOException {
          GetIamPolicy result = new GetIamPolicy(resource, content);
          initialize(result);
          return result;
        }

        public class GetIamPolicy extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Policy> {

          private static final String REST_PATH = "v2beta3/{+resource}:getIamPolicy";

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

          /**
           * Gets the access control policy for a Queue. Returns an empty policy if the resource exists and
           * does not have a policy set. Authorization requires the following [Google
           * IAM](https://cloud.google.com/iam) permission on the specified resource parent: *
           * `cloudtasks.queues.getIamPolicy`
           *
           * Create a request for the method "queues.getIamPolicy".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote
           * operation. <p> {@link
           * GetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.GetIamPolicyRequest}
           * @since 1.13
           */
          protected GetIamPolicy(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.GetIamPolicyRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Policy.class);
            this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * REQUIRED: The resource for which the policy is being requested. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          @com.google.api.client.util.Key
          private java.lang.String resource;

          /** REQUIRED: The resource for which the policy is being requested. See [Resource
         names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
         field.
           */
          public java.lang.String getResource() {
            return resource;
          }

          /**
           * REQUIRED: The resource for which the policy is being requested. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          public GetIamPolicy setResource(java.lang.String resource) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
            this.resource = resource;
            return this;
          }

          @Override
          public GetIamPolicy set(String parameterName, Object value) {
            return (GetIamPolicy) super.set(parameterName, value);
          }
        }
        /**
         * Lists queues. Queues are returned in lexicographical order.
         *
         * Create a request for the method "queues.list".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link List#execute()} method to invoke the remote operation.
         *
         * @param parent Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
         * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.ListQueuesResponse> {

          private static final String REST_PATH = "v2beta3/{+parent}/queues";

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

          /**
           * Lists queues. Queues are returned in lexicographical order.
           *
           * Create a request for the method "queues.list".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
           * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param parent Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
           * @since 1.13
           */
          protected List(java.lang.String parent) {
            super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.ListQueuesResponse.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 name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String parent;

          /** Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
           */
          public java.lang.String getParent() {
            return parent;
          }

          /**
           * Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`
           */
          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;
          }

          /**
           * `filter` can be used to specify a subset of queues. Any Queue field can be used as a
           * filter and several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
           * filter syntax is the same as described in [Stackdriver's Advanced Logs
           * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). Sample filter
           * "state: PAUSED". Note that using filters might cause fewer queues than the requested
           * page_size to be returned.
           */
          @com.google.api.client.util.Key
          private java.lang.String filter;

          /**` filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and
        ` several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the
        ` same as described in [Stackdriver's Advanced Logs
        ` Filters](https://cloud.google.com/logging/docs/view/advanced_filters). Sample filter "state:
        ` PAUSED". Note that using filters might cause fewer queues than the requested page_size to be
        ` returned.
        `

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

          /**
           * `filter` can be used to specify a subset of queues. Any Queue field can be used as a
           * filter and several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The
           * filter syntax is the same as described in [Stackdriver's Advanced Logs
           * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). Sample filter
           * "state: PAUSED". Note that using filters might cause fewer queues than the requested
           * page_size to be returned.
           */
          public List setFilter(java.lang.String filter) {
            this.filter = filter;
            return this;
          }

          /**
           * Requested page size. The maximum page size is 9800. If unspecified, the page size will
           * be the maximum. Fewer queues than requested might be returned, even if more queues
           * exist; use the next_page_token in the response to determine if more queues exist.
           */
          @com.google.api.client.util.Key
          private java.lang.Integer pageSize;

          /** Requested page size. The maximum page size is 9800. If unspecified, the page size will be the
         maximum. Fewer queues than requested might be returned, even if more queues exist; use the
         next_page_token in the response to determine if more queues exist.
           */
          public java.lang.Integer getPageSize() {
            return pageSize;
          }

          /**
           * Requested page size. The maximum page size is 9800. If unspecified, the page size will
           * be the maximum. Fewer queues than requested might be returned, even if more queues
           * exist; use the next_page_token in the response to determine if more queues exist.
           */
          public List setPageSize(java.lang.Integer pageSize) {
            this.pageSize = pageSize;
            return this;
          }

          /**
           * A token identifying the page of results to return. To request the first page results,
           * page_token must be empty. To request the next page of results, page_token must be the
           * value of next_page_token returned from the previous call to ListQueues method. It is an
           * error to switch the value of the filter while iterating through pages.
           */
          @com.google.api.client.util.Key
          private java.lang.String pageToken;

          /** A token identifying the page of results to return. To request the first page results, page_token
         must be empty. To request the next page of results, page_token must be the value of next_page_token
         returned from the previous call to ListQueues method. It is an error to switch the value of the
         filter while iterating through pages.
           */
          public java.lang.String getPageToken() {
            return pageToken;
          }

          /**
           * A token identifying the page of results to return. To request the first page results,
           * page_token must be empty. To request the next page of results, page_token must be the
           * value of next_page_token returned from the previous call to ListQueues method. It is an
           * error to switch the value of the filter while iterating through pages.
           */
          public List setPageToken(java.lang.String pageToken) {
            this.pageToken = pageToken;
            return this;
          }

          /**
           * Optional. Read mask is used for a more granular control over what the API returns. If
           * the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats]
           * will be returned only if it was explicitly specified in the mask.
           */
          @com.google.api.client.util.Key
          private String readMask;

          /** Optional. Read mask is used for a more granular control over what the API returns. If the mask is
         not present all fields will be returned except [Queue.stats]. [Queue.stats] will be returned only
         if it was explicitly specified in the mask.
           */
          public String getReadMask() {
            return readMask;
          }

          /**
           * Optional. Read mask is used for a more granular control over what the API returns. If
           * the mask is not present all fields will be returned except [Queue.stats]. [Queue.stats]
           * will be returned only if it was explicitly specified in the mask.
           */
          public List setReadMask(String readMask) {
            this.readMask = readMask;
            return this;
          }

          @Override
          public List set(String parameterName, Object value) {
            return (List) super.set(parameterName, value);
          }
        }
        /**
         * Updates a queue. This method creates the queue if it does not exist and updates the queue if it
         * does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a
         * task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.
         * WARNING: Using this method may have unintended side effects if you are using an App Engine
         * `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
         * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
         *
         * Create a request for the method "queues.patch".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         *
         * @param name Caller-specified and required in CreateQueue, after which it becomes output only. The queue name.
         *        The queue name must have the following format:
         *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain
         *        letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more
         *        information, see [Identifying projects](https://cloud.google.com/resource-manager/docs
         *        /creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for
         *        the queue's location. The list of available locations can be obtained by calling
         *        ListLocations. For more information, see https://cloud.google.com/about/locations/. *
         *        `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum
         *        length is 100 characters.
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.Queue}
         * @return the request
         */
        public Patch patch(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.Queue content) throws java.io.IOException {
          Patch result = new Patch(name, content);
          initialize(result);
          return result;
        }

        public class Patch extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

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

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

          /**
           * Updates a queue. This method creates the queue if it does not exist and updates the queue if it
           * does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After
           * a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not.
           * WARNING: Using this method may have unintended side effects if you are using an App Engine
           * `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
           * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
           *
           * Create a request for the method "queues.patch".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
           * <p> {@link
           * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Caller-specified and required in CreateQueue, after which it becomes output only. The queue name.
         *        The queue name must have the following format:
         *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain
         *        letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more
         *        information, see [Identifying projects](https://cloud.google.com/resource-manager/docs
         *        /creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for
         *        the queue's location. The list of available locations can be obtained by calling
         *        ListLocations. For more information, see https://cloud.google.com/about/locations/. *
         *        `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum
         *        length is 100 characters.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.Queue}
           * @since 1.13
           */
          protected Patch(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.Queue content) {
            super(CloudTasks.this, "PATCH", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Queue.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/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Caller-specified and required in CreateQueue, after which it becomes output only. The
           * queue name. The queue name must have the following format:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain
           * letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more
           * information, see [Identifying projects](https://cloud.google.com/resource-manager/docs
           * /creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID
           * for the queue's location. The list of available locations can be obtained by calling
           * ListLocations. For more information, see https://cloud.google.com/about/locations/. *
           * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum
           * length is 100 characters.
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Caller-specified and required in CreateQueue, after which it becomes output only. The queue name.
         The queue name must have the following format:
         `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters
         ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see
         [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-
         projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The
         list of available locations can be obtained by calling ListLocations. For more information, see
         https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers
         ([0-9]), or hyphens (-). The maximum length is 100 characters.
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Caller-specified and required in CreateQueue, after which it becomes output only. The
           * queue name. The queue name must have the following format:
           * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain
           * letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more
           * information, see [Identifying projects](https://cloud.google.com/resource-manager/docs
           * /creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID
           * for the queue's location. The list of available locations can be obtained by calling
           * ListLocations. For more information, see https://cloud.google.com/about/locations/. *
           * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum
           * length is 100 characters.
           */
          public Patch setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          /**
           * A mask used to specify which fields of the queue are being updated. If empty, then all
           * fields will be updated.
           */
          @com.google.api.client.util.Key
          private String updateMask;

          /** A mask used to specify which fields of the queue are being updated. If empty, then all fields will
         be updated.
           */
          public String getUpdateMask() {
            return updateMask;
          }

          /**
           * A mask used to specify which fields of the queue are being updated. If empty, then all
           * fields will be updated.
           */
          public Patch setUpdateMask(String updateMask) {
            this.updateMask = updateMask;
            return this;
          }

          @Override
          public Patch set(String parameterName, Object value) {
            return (Patch) super.set(parameterName, value);
          }
        }
        /**
         * Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the
         * queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is
         * paused if its state is PAUSED.
         *
         * Create a request for the method "queues.pause".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Pause#execute()} method to invoke the remote operation.
         *
         * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.PauseQueueRequest}
         * @return the request
         */
        public Pause pause(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.PauseQueueRequest content) throws java.io.IOException {
          Pause result = new Pause(name, content);
          initialize(result);
          return result;
        }

        public class Pause extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

          private static final String REST_PATH = "v2beta3/{+name}:pause";

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

          /**
           * Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the
           * queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is
           * paused if its state is PAUSED.
           *
           * Create a request for the method "queues.pause".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Pause#execute()} method to invoke the remote operation.
           * <p> {@link
           * Pause#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.PauseQueueRequest}
           * @since 1.13
           */
          protected Pause(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.PauseQueueRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Queue.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/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public Pause 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/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Pause set(String parameterName, Object value) {
            return (Pause) super.set(parameterName, value);
          }
        }
        /**
         * Purges a queue by deleting all of its tasks. All tasks created before this method is called are
         * permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be
         * dispatched before the purge takes effect. A purge is irreversible.
         *
         * Create a request for the method "queues.purge".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Purge#execute()} method to invoke the remote operation.
         *
         * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.PurgeQueueRequest}
         * @return the request
         */
        public Purge purge(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.PurgeQueueRequest content) throws java.io.IOException {
          Purge result = new Purge(name, content);
          initialize(result);
          return result;
        }

        public class Purge extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

          private static final String REST_PATH = "v2beta3/{+name}:purge";

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

          /**
           * Purges a queue by deleting all of its tasks. All tasks created before this method is called are
           * permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be
           * dispatched before the purge takes effect. A purge is irreversible.
           *
           * Create a request for the method "queues.purge".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Purge#execute()} method to invoke the remote operation.
           * <p> {@link
           * Purge#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.PurgeQueueRequest}
           * @since 1.13
           */
          protected Purge(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.PurgeQueueRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Queue.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/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public Purge 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/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Purge set(String parameterName, Object value) {
            return (Purge) super.set(parameterName, value);
          }
        }
        /**
         * Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a
         * queue is stored in the queue's state; after calling this method it will be set to RUNNING.
         * WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you
         * are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks
         * Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
         *
         * Create a request for the method "queues.resume".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link Resume#execute()} method to invoke the remote operation.
         *
         * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.ResumeQueueRequest}
         * @return the request
         */
        public Resume resume(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.ResumeQueueRequest content) throws java.io.IOException {
          Resume result = new Resume(name, content);
          initialize(result);
          return result;
        }

        public class Resume extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Queue> {

          private static final String REST_PATH = "v2beta3/{+name}:resume";

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

          /**
           * Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of
           * a queue is stored in the queue's state; after calling this method it will be set to RUNNING.
           * WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you
           * are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks
           * Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).
           *
           * Create a request for the method "queues.resume".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link Resume#execute()} method to invoke the remote operation.
           * <p> {@link
           * Resume#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
           * be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.ResumeQueueRequest}
           * @since 1.13
           */
          protected Resume(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.ResumeQueueRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Queue.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/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The queue name. For example:
           * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
           */
          public Resume 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/[^/]+/queues/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Resume set(String parameterName, Object value) {
            return (Resume) super.set(parameterName, value);
          }
        }
        /**
         * Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud Console
         * does not check queue-level IAM permissions yet. Project-level permissions are required to use the
         * Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam)
         * permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`
         *
         * Create a request for the method "queues.setIamPolicy".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote operation.
         *
         * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.SetIamPolicyRequest}
         * @return the request
         */
        public SetIamPolicy setIamPolicy(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.SetIamPolicyRequest content) throws java.io.IOException {
          SetIamPolicy result = new SetIamPolicy(resource, content);
          initialize(result);
          return result;
        }

        public class SetIamPolicy extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Policy> {

          private static final String REST_PATH = "v2beta3/{+resource}:setIamPolicy";

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

          /**
           * Sets the access control policy for a Queue. Replaces any existing policy. Note: The Cloud
           * Console does not check queue-level IAM permissions yet. Project-level permissions are required
           * to use the Cloud Console. Authorization requires the following [Google
           * IAM](https://cloud.google.com/iam) permission on the specified resource parent: *
           * `cloudtasks.queues.setIamPolicy`
           *
           * Create a request for the method "queues.setIamPolicy".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote
           * operation. <p> {@link
           * SetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
           * must be called to initialize this instance immediately after invoking the constructor. </p>
           *
           * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.SetIamPolicyRequest}
           * @since 1.13
           */
          protected SetIamPolicy(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.SetIamPolicyRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Policy.class);
            this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * REQUIRED: The resource for which the policy is being specified. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          @com.google.api.client.util.Key
          private java.lang.String resource;

          /** REQUIRED: The resource for which the policy is being specified. See [Resource
         names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
         field.
           */
          public java.lang.String getResource() {
            return resource;
          }

          /**
           * REQUIRED: The resource for which the policy is being specified. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          public SetIamPolicy setResource(java.lang.String resource) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
            this.resource = resource;
            return this;
          }

          @Override
          public SetIamPolicy set(String parameterName, Object value) {
            return (SetIamPolicy) super.set(parameterName, value);
          }
        }
        /**
         * Returns permissions that a caller has on a Queue. If the resource does not exist, this will
         * return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be
         * used for building permission-aware UIs and command-line tools, not for authorization checking.
         * This operation may "fail open" without warning.
         *
         * Create a request for the method "queues.testIamPermissions".
         *
         * This request holds the parameters needed by the cloudtasks server.  After setting any optional
         * parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote operation.
         *
         * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
         * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsRequest}
         * @return the request
         */
        public TestIamPermissions testIamPermissions(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsRequest content) throws java.io.IOException {
          TestIamPermissions result = new TestIamPermissions(resource, content);
          initialize(result);
          return result;
        }

        public class TestIamPermissions extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsResponse> {

          private static final String REST_PATH = "v2beta3/{+resource}:testIamPermissions";

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

          /**
           * Returns permissions that a caller has on a Queue. If the resource does not exist, this will
           * return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to
           * be used for building permission-aware UIs and command-line tools, not for authorization
           * checking. This operation may "fail open" without warning.
           *
           * Create a request for the method "queues.testIamPermissions".
           *
           * This request holds the parameters needed by the the cloudtasks server.  After setting any
           * optional parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote
           * operation. <p> {@link TestIamPermissions#initialize(com.google.api.client.googleapis.services.A
           * bstractGoogleClientRequest)} must be called to initialize this instance immediately after
           * invoking the constructor. </p>
           *
           * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource
         *        names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
         *        this field.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsRequest}
           * @since 1.13
           */
          protected TestIamPermissions(java.lang.String resource, com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsRequest content) {
            super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.TestIamPermissionsResponse.class);
            this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
          }

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

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

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

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

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

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

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

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

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

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

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

          /**
           * REQUIRED: The resource for which the policy detail is being requested. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          @com.google.api.client.util.Key
          private java.lang.String resource;

          /** REQUIRED: The resource for which the policy detail is being requested. See [Resource
         names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
         field.
           */
          public java.lang.String getResource() {
            return resource;
          }

          /**
           * REQUIRED: The resource for which the policy detail is being requested. See [Resource
           * names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
           * for this field.
           */
          public TestIamPermissions setResource(java.lang.String resource) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
                  "Parameter resource must conform to the pattern " +
                  "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
            }
            this.resource = resource;
            return this;
          }

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

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

        /**
         * The "tasks" collection of methods.
         */
        public class Tasks {

          /**
           * Creates and buffers a new task without the need to explicitly define a Task message. The queue
           * must have HTTP target. To create the task with a custom ID, use the following format and set
           * TASK_ID to your desired ID:
           * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task
           * with an automatically generated ID, use the following format:
           * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is in
           * its experimental stage. You must request access to the API through the [Cloud Tasks BufferTask
           * Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
           *
           * Create a request for the method "tasks.buffer".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link Buffer#execute()} method to invoke the remote operation.
           *
           * @param queue Required. The parent queue name. For example:
           *        projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.
           * @param taskId Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the
           *        task.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.BufferTaskRequest}
           * @return the request
           */
          public Buffer buffer(java.lang.String queue, java.lang.String taskId, com.google.api.services.cloudtasks.v2beta3.model.BufferTaskRequest content) throws java.io.IOException {
            Buffer result = new Buffer(queue, taskId, content);
            initialize(result);
            return result;
          }

          public class Buffer extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.BufferTaskResponse> {

            private static final String REST_PATH = "v2beta3/{+queue}/tasks/{taskId}:buffer";

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

            /**
             * Creates and buffers a new task without the need to explicitly define a Task message. The queue
             * must have HTTP target. To create the task with a custom ID, use the following format and set
             * TASK_ID to your desired ID:
             * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the
             * task with an automatically generated ID, use the following format:
             * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is
             * in its experimental stage. You must request access to the API through the [Cloud Tasks
             * BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
             *
             * Create a request for the method "tasks.buffer".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link Buffer#execute()} method to invoke the remote operation.
             * <p> {@link
             * Buffer#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param queue Required. The parent queue name. For example:
           *        projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.
             * @param taskId Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the
           *        task.
             * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.BufferTaskRequest}
             * @since 1.13
             */
            protected Buffer(java.lang.String queue, java.lang.String taskId, com.google.api.services.cloudtasks.v2beta3.model.BufferTaskRequest content) {
              super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.BufferTaskResponse.class);
              this.queue = com.google.api.client.util.Preconditions.checkNotNull(queue, "Required parameter queue must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(QUEUE_PATTERN.matcher(queue).matches(),
                    "Parameter queue must conform to the pattern " +
                    "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
              }
              this.taskId = com.google.api.client.util.Preconditions.checkNotNull(taskId, "Required parameter taskId must be specified.");
            }

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

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

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

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

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

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

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

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

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

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

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

            /**
             * Required. The parent queue name. For example:
             * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already
             * exist.
             */
            @com.google.api.client.util.Key
            private java.lang.String queue;

            /** Required. The parent queue name. For example:
           projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.
             */
            public java.lang.String getQueue() {
              return queue;
            }

            /**
             * Required. The parent queue name. For example:
             * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already
             * exist.
             */
            public Buffer setQueue(java.lang.String queue) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(QUEUE_PATTERN.matcher(queue).matches(),
                    "Parameter queue must conform to the pattern " +
                    "^projects/[^/]+/locations/[^/]+/queues/[^/]+$");
              }
              this.queue = queue;
              return this;
            }

            /**
             * Optional. Task ID for the task being created. If not provided, a random task ID is
             * assigned to the task.
             */
            @com.google.api.client.util.Key
            private java.lang.String taskId;

            /** Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the
           task.
             */
            public java.lang.String getTaskId() {
              return taskId;
            }

            /**
             * Optional. Task ID for the task being created. If not provided, a random task ID is
             * assigned to the task.
             */
            public Buffer setTaskId(java.lang.String taskId) {
              this.taskId = taskId;
              return this;
            }

            @Override
            public Buffer set(String parameterName, Object value) {
              return (Buffer) super.set(parameterName, value);
            }
          }
          /**
           * Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no
           * UpdateTask command. * The maximum task size is 100KB.
           *
           * Create a request for the method "tasks.create".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           *        The queue must already exist.
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.CreateTaskRequest}
           * @return the request
           */
          public Create create(java.lang.String parent, com.google.api.services.cloudtasks.v2beta3.model.CreateTaskRequest content) throws java.io.IOException {
            Create result = new Create(parent, content);
            initialize(result);
            return result;
          }

          public class Create extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Task> {

            private static final String REST_PATH = "v2beta3/{+parent}/tasks";

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

            /**
             * Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no
             * UpdateTask command. * The maximum task size is 100KB.
             *
             * Create a request for the method "tasks.create".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
             * <p> {@link
             * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           *        The queue must already exist.
             * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.CreateTaskRequest}
             * @since 1.13
             */
            protected Create(java.lang.String parent, com.google.api.services.cloudtasks.v2beta3.model.CreateTaskRequest content) {
              super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Task.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/[^/]+/queues/[^/]+$");
              }
            }

            @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 queue name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already
             * exist.
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           The queue must already exist.
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The queue name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already
             * exist.
             */
            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/[^/]+/queues/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public Create set(String parameterName, Object value) {
              return (Create) super.set(parameterName, value);
            }
          }
          /**
           * Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted
           * if it has executed successfully or permanently failed.
           *
           * Create a request for the method "tasks.delete".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
           * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Empty> {

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

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

            /**
             * Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be
             * deleted if it has executed successfully or permanently failed.
             *
             * Create a request for the method "tasks.delete".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             * <p> {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(CloudTasks.this, "DELETE", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.Empty.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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
            }

            @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 task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The task name. For example:
           `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
              this.name = name;
              return this;
            }

            @Override
            public Delete set(String parameterName, Object value) {
              return (Delete) super.set(parameterName, value);
            }
          }
          /**
           * Gets a task.
           *
           * Create a request for the method "tasks.get".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link Get#execute()} method to invoke the remote operation.
           *
           * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
           * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Task> {

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

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

            /**
             * Gets a task.
             *
             * Create a request for the method "tasks.get".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link Get#execute()} method to invoke the remote operation. <p>
             * {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             * @since 1.13
             */
            protected Get(java.lang.String name) {
              super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.Task.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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
            }

            @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 task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The task name. For example:
           `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
              this.name = name;
              return this;
            }

            /**
             * The response_view specifies which subset of the Task will be returned. By default
             * response_view is BASIC; not all information is retrieved by default because some
             * data, such as payloads, might be desirable to return only when needed because of its
             * large size or because of the sensitivity of data that it contains. Authorization for
             * FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
             * permission on the Task resource.
             */
            @com.google.api.client.util.Key
            private java.lang.String responseView;

            /** The response_view specifies which subset of the Task will be returned. By default response_view is
           BASIC; not all information is retrieved by default because some data, such as payloads, might be
           desirable to return only when needed because of its large size or because of the sensitivity of
           data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google
           IAM](https://cloud.google.com/iam/) permission on the Task resource.
             */
            public java.lang.String getResponseView() {
              return responseView;
            }

            /**
             * The response_view specifies which subset of the Task will be returned. By default
             * response_view is BASIC; not all information is retrieved by default because some
             * data, such as payloads, might be desirable to return only when needed because of its
             * large size or because of the sensitivity of data that it contains. Authorization for
             * FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
             * permission on the Task resource.
             */
            public Get setResponseView(java.lang.String responseView) {
              this.responseView = responseView;
              return this;
            }

            @Override
            public Get set(String parameterName, Object value) {
              return (Get) super.set(parameterName, value);
            }
          }
          /**
           * Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance
           * considerations; response_view controls the subset of information which is returned. The tasks may
           * be returned in any order. The ordering may change at any time.
           *
           * Create a request for the method "tasks.list".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link List#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
           * @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 CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.ListTasksResponse> {

            private static final String REST_PATH = "v2beta3/{+parent}/tasks";

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

            /**
             * Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance
             * considerations; response_view controls the subset of information which is returned. The tasks
             * may be returned in any order. The ordering may change at any time.
             *
             * Create a request for the method "tasks.list".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link List#execute()} method to invoke the remote operation. <p>
             * {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
             * @since 1.13
             */
            protected List(java.lang.String parent) {
              super(CloudTasks.this, "GET", REST_PATH, null, com.google.api.services.cloudtasks.v2beta3.model.ListTasksResponse.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/[^/]+/queues/[^/]+$");
              }
            }

            @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 queue name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The queue name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
             */
            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/[^/]+/queues/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            /**
             * Maximum page size. Fewer tasks than requested might be returned, even if more tasks
             * exist; use next_page_token in the response to determine if more tasks exist. The
             * maximum page size is 1000. If unspecified, the page size will be the maximum.
             */
            @com.google.api.client.util.Key
            private java.lang.Integer pageSize;

            /** Maximum page size. Fewer tasks than requested might be returned, even if more tasks exist; use
           next_page_token in the response to determine if more tasks exist. The maximum page size is 1000. If
           unspecified, the page size will be the maximum.
             */
            public java.lang.Integer getPageSize() {
              return pageSize;
            }

            /**
             * Maximum page size. Fewer tasks than requested might be returned, even if more tasks
             * exist; use next_page_token in the response to determine if more tasks exist. The
             * maximum page size is 1000. If unspecified, the page size will be the maximum.
             */
            public List setPageSize(java.lang.Integer pageSize) {
              this.pageSize = pageSize;
              return this;
            }

            /**
             * A token identifying the page of results to return. To request the first page results,
             * page_token must be empty. To request the next page of results, page_token must be the
             * value of next_page_token returned from the previous call to ListTasks method. The
             * page token is valid for only 2 hours.
             */
            @com.google.api.client.util.Key
            private java.lang.String pageToken;

            /** A token identifying the page of results to return. To request the first page results, page_token
           must be empty. To request the next page of results, page_token must be the value of next_page_token
           returned from the previous call to ListTasks method. The page token is valid for only 2 hours.
             */
            public java.lang.String getPageToken() {
              return pageToken;
            }

            /**
             * A token identifying the page of results to return. To request the first page results,
             * page_token must be empty. To request the next page of results, page_token must be the
             * value of next_page_token returned from the previous call to ListTasks method. The
             * page token is valid for only 2 hours.
             */
            public List setPageToken(java.lang.String pageToken) {
              this.pageToken = pageToken;
              return this;
            }

            /**
             * The response_view specifies which subset of the Task will be returned. By default
             * response_view is BASIC; not all information is retrieved by default because some
             * data, such as payloads, might be desirable to return only when needed because of its
             * large size or because of the sensitivity of data that it contains. Authorization for
             * FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
             * permission on the Task resource.
             */
            @com.google.api.client.util.Key
            private java.lang.String responseView;

            /** The response_view specifies which subset of the Task will be returned. By default response_view is
           BASIC; not all information is retrieved by default because some data, such as payloads, might be
           desirable to return only when needed because of its large size or because of the sensitivity of
           data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google
           IAM](https://cloud.google.com/iam/) permission on the Task resource.
             */
            public java.lang.String getResponseView() {
              return responseView;
            }

            /**
             * The response_view specifies which subset of the Task will be returned. By default
             * response_view is BASIC; not all information is retrieved by default because some
             * data, such as payloads, might be desirable to return only when needed because of its
             * large size or because of the sensitivity of data that it contains. Authorization for
             * FULL requires `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
             * permission on the Task resource.
             */
            public List setResponseView(java.lang.String responseView) {
              this.responseView = responseView;
              return this;
            }

            @Override
            public List set(String parameterName, Object value) {
              return (List) super.set(parameterName, value);
            }
          }
          /**
           * Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if
           * the task is already running, the queue has reached its RateLimits or is PAUSED. This command is
           * meant to be used for manual debugging. For example, RunTask can be used to retry a failed task
           * after a fix has been made or to manually force a task to be dispatched now. The dispatched task
           * is returned. That is, the task that is returned contains the status after the task is dispatched
           * but before the task is received by its target. If Cloud Tasks receives a successful response from
           * the task's target, then the task will be deleted; otherwise the task's schedule_time will be
           * reset to the time that RunTask was called plus the retry delay specified in the queue's
           * RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or
           * permanently failed.
           *
           * Create a request for the method "tasks.run".
           *
           * This request holds the parameters needed by the cloudtasks server.  After setting any optional
           * parameters, call the {@link Run#execute()} method to invoke the remote operation.
           *
           * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
           * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.RunTaskRequest}
           * @return the request
           */
          public Run run(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.RunTaskRequest content) throws java.io.IOException {
            Run result = new Run(name, content);
            initialize(result);
            return result;
          }

          public class Run extends CloudTasksRequest<com.google.api.services.cloudtasks.v2beta3.model.Task> {

            private static final String REST_PATH = "v2beta3/{+name}:run";

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

            /**
             * Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even
             * if the task is already running, the queue has reached its RateLimits or is PAUSED. This command
             * is meant to be used for manual debugging. For example, RunTask can be used to retry a failed
             * task after a fix has been made or to manually force a task to be dispatched now. The dispatched
             * task is returned. That is, the task that is returned contains the status after the task is
             * dispatched but before the task is received by its target. If Cloud Tasks receives a successful
             * response from the task's target, then the task will be deleted; otherwise the task's
             * schedule_time will be reset to the time that RunTask was called plus the retry delay specified
             * in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has
             * already succeeded or permanently failed.
             *
             * Create a request for the method "tasks.run".
             *
             * This request holds the parameters needed by the the cloudtasks server.  After setting any
             * optional parameters, call the {@link Run#execute()} method to invoke the remote operation. <p>
             * {@link Run#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
             * must be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The task name. For example:
           *        `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             * @param content the {@link com.google.api.services.cloudtasks.v2beta3.model.RunTaskRequest}
             * @since 1.13
             */
            protected Run(java.lang.String name, com.google.api.services.cloudtasks.v2beta3.model.RunTaskRequest content) {
              super(CloudTasks.this, "POST", REST_PATH, content, com.google.api.services.cloudtasks.v2beta3.model.Task.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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
            }

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

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

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

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

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

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

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

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

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

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

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

            /**
             * Required. The task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The task name. For example:
           `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The task name. For example:
             * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
             */
            public Run 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/[^/]+/queues/[^/]+/tasks/[^/]+$");
              }
              this.name = name;
              return this;
            }

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

        }
      }
    }
  }

  /**
   * Builder for {@link CloudTasks}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {

    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:
     *        <ul>
     *        <li>Google App Engine:
     *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
     *        <li>Android: {@code newCompatibleTransport} from
     *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
     *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
     *        </li>
     *        </ul>
     * @param jsonFactory JSON factory, which may be:
     *        <ul>
     *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
     *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
     *        <li>Android Honeycomb or higher:
     *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
     *        </ul>
     * @param httpRequestInitializer HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
        com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      super(
          transport,
          jsonFactory,
          Builder.chooseEndpoint(transport),
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

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

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