// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/tasks/v2beta2/queue.proto

package com.google.cloud.tasks.v2beta2;

/**
 * <pre>
 * A queue is a container of related tasks. Queues are configured to manage
 * how those tasks are dispatched. Configurable properties include rate limits,
 * retry options, target types, and others.
 * </pre>
 *
 * Protobuf type {@code google.cloud.tasks.v2beta2.Queue}
 */
public  final class Queue extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta2.Queue)
    QueueOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Queue.newBuilder() to construct.
  private Queue(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Queue() {
    name_ = "";
    state_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private Queue(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            name_ = s;
            break;
          }
          case 26: {
            com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder subBuilder = null;
            if (targetTypeCase_ == 3) {
              subBuilder = ((com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_).toBuilder();
            }
            targetType_ =
                input.readMessage(com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_);
              targetType_ = subBuilder.buildPartial();
            }
            targetTypeCase_ = 3;
            break;
          }
          case 34: {
            com.google.cloud.tasks.v2beta2.PullTarget.Builder subBuilder = null;
            if (targetTypeCase_ == 4) {
              subBuilder = ((com.google.cloud.tasks.v2beta2.PullTarget) targetType_).toBuilder();
            }
            targetType_ =
                input.readMessage(com.google.cloud.tasks.v2beta2.PullTarget.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.cloud.tasks.v2beta2.PullTarget) targetType_);
              targetType_ = subBuilder.buildPartial();
            }
            targetTypeCase_ = 4;
            break;
          }
          case 42: {
            com.google.cloud.tasks.v2beta2.RateLimits.Builder subBuilder = null;
            if (rateLimits_ != null) {
              subBuilder = rateLimits_.toBuilder();
            }
            rateLimits_ = input.readMessage(com.google.cloud.tasks.v2beta2.RateLimits.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(rateLimits_);
              rateLimits_ = subBuilder.buildPartial();
            }

            break;
          }
          case 50: {
            com.google.cloud.tasks.v2beta2.RetryConfig.Builder subBuilder = null;
            if (retryConfig_ != null) {
              subBuilder = retryConfig_.toBuilder();
            }
            retryConfig_ = input.readMessage(com.google.cloud.tasks.v2beta2.RetryConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(retryConfig_);
              retryConfig_ = subBuilder.buildPartial();
            }

            break;
          }
          case 56: {
            int rawValue = input.readEnum();

            state_ = rawValue;
            break;
          }
          case 66: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (purgeTime_ != null) {
              subBuilder = purgeTime_.toBuilder();
            }
            purgeTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(purgeTime_);
              purgeTime_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.tasks.v2beta2.QueueProto.internal_static_google_cloud_tasks_v2beta2_Queue_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.tasks.v2beta2.QueueProto.internal_static_google_cloud_tasks_v2beta2_Queue_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.tasks.v2beta2.Queue.class, com.google.cloud.tasks.v2beta2.Queue.Builder.class);
  }

  /**
   * <pre>
   * State of the queue.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.tasks.v2beta2.Queue.State}
   */
  public enum State
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * Unspecified state.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    STATE_UNSPECIFIED(0),
    /**
     * <pre>
     * The queue is running. Tasks can be dispatched.
     * If the queue was created using Cloud Tasks and the queue has
     * had no activity (method calls or task dispatches) for 30 days,
     * the queue may take a few minutes to re-activate. Some method
     * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and
     * tasks may not be dispatched for a few minutes until the queue
     * has been re-activated.
     * </pre>
     *
     * <code>RUNNING = 1;</code>
     */
    RUNNING(1),
    /**
     * <pre>
     * Tasks are paused by the user. If the queue is paused then Cloud
     * Tasks will stop delivering tasks from it, but more tasks can
     * still be added to it by the user. When a pull queue is paused,
     * all [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls will return a
     * [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION].
     * </pre>
     *
     * <code>PAUSED = 2;</code>
     */
    PAUSED(2),
    /**
     * <pre>
     * The queue is disabled.
     * A queue becomes `DISABLED` when
     * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) or
     * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) is uploaded
     * which does not contain the queue. You cannot directly disable a queue.
     * When a queue is disabled, tasks can still be added to a queue
     * but the tasks are not dispatched and
     * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls return a
     * `FAILED_PRECONDITION` error.
     * To permanently delete this queue and all of its tasks, call
     * [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue].
     * </pre>
     *
     * <code>DISABLED = 3;</code>
     */
    DISABLED(3),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Unspecified state.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    public static final int STATE_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * The queue is running. Tasks can be dispatched.
     * If the queue was created using Cloud Tasks and the queue has
     * had no activity (method calls or task dispatches) for 30 days,
     * the queue may take a few minutes to re-activate. Some method
     * calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and
     * tasks may not be dispatched for a few minutes until the queue
     * has been re-activated.
     * </pre>
     *
     * <code>RUNNING = 1;</code>
     */
    public static final int RUNNING_VALUE = 1;
    /**
     * <pre>
     * Tasks are paused by the user. If the queue is paused then Cloud
     * Tasks will stop delivering tasks from it, but more tasks can
     * still be added to it by the user. When a pull queue is paused,
     * all [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls will return a
     * [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION].
     * </pre>
     *
     * <code>PAUSED = 2;</code>
     */
    public static final int PAUSED_VALUE = 2;
    /**
     * <pre>
     * The queue is disabled.
     * A queue becomes `DISABLED` when
     * [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) or
     * [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) is uploaded
     * which does not contain the queue. You cannot directly disable a queue.
     * When a queue is disabled, tasks can still be added to a queue
     * but the tasks are not dispatched and
     * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls return a
     * `FAILED_PRECONDITION` error.
     * To permanently delete this queue and all of its tasks, call
     * [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue].
     * </pre>
     *
     * <code>DISABLED = 3;</code>
     */
    public static final int DISABLED_VALUE = 3;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static State valueOf(int value) {
      return forNumber(value);
    }

    public static State forNumber(int value) {
      switch (value) {
        case 0: return STATE_UNSPECIFIED;
        case 1: return RUNNING;
        case 2: return PAUSED;
        case 3: return DISABLED;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<State>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        State> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<State>() {
            public State findValueByNumber(int number) {
              return State.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return com.google.cloud.tasks.v2beta2.Queue.getDescriptor().getEnumTypes().get(0);
    }

    private static final State[] VALUES = values();

    public static State valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private State(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.tasks.v2beta2.Queue.State)
  }

  private int targetTypeCase_ = 0;
  private java.lang.Object targetType_;
  public enum TargetTypeCase
      implements com.google.protobuf.Internal.EnumLite {
    APP_ENGINE_HTTP_TARGET(3),
    PULL_TARGET(4),
    TARGETTYPE_NOT_SET(0);
    private final int value;
    private TargetTypeCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TargetTypeCase valueOf(int value) {
      return forNumber(value);
    }

    public static TargetTypeCase forNumber(int value) {
      switch (value) {
        case 3: return APP_ENGINE_HTTP_TARGET;
        case 4: return PULL_TARGET;
        case 0: return TARGETTYPE_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public TargetTypeCase
  getTargetTypeCase() {
    return TargetTypeCase.forNumber(
        targetTypeCase_);
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   * <pre>
   * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  public com.google.protobuf.ByteString
      getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int APP_ENGINE_HTTP_TARGET_FIELD_NUMBER = 3;
  /**
   * <pre>
   * App Engine HTTP target.
   * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
   */
  public boolean hasAppEngineHttpTarget() {
    return targetTypeCase_ == 3;
  }
  /**
   * <pre>
   * App Engine HTTP target.
   * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
   */
  public com.google.cloud.tasks.v2beta2.AppEngineHttpTarget getAppEngineHttpTarget() {
    if (targetTypeCase_ == 3) {
       return (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_;
    }
    return com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
  }
  /**
   * <pre>
   * App Engine HTTP target.
   * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
   */
  public com.google.cloud.tasks.v2beta2.AppEngineHttpTargetOrBuilder getAppEngineHttpTargetOrBuilder() {
    if (targetTypeCase_ == 3) {
       return (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_;
    }
    return com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
  }

  public static final int PULL_TARGET_FIELD_NUMBER = 4;
  /**
   * <pre>
   * Pull target.
   * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
   */
  public boolean hasPullTarget() {
    return targetTypeCase_ == 4;
  }
  /**
   * <pre>
   * Pull target.
   * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
   */
  public com.google.cloud.tasks.v2beta2.PullTarget getPullTarget() {
    if (targetTypeCase_ == 4) {
       return (com.google.cloud.tasks.v2beta2.PullTarget) targetType_;
    }
    return com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
  }
  /**
   * <pre>
   * Pull target.
   * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
   */
  public com.google.cloud.tasks.v2beta2.PullTargetOrBuilder getPullTargetOrBuilder() {
    if (targetTypeCase_ == 4) {
       return (com.google.cloud.tasks.v2beta2.PullTarget) targetType_;
    }
    return com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
  }

  public static final int RATE_LIMITS_FIELD_NUMBER = 5;
  private com.google.cloud.tasks.v2beta2.RateLimits rateLimits_;
  /**
   * <pre>
   * Rate limits for task dispatches.
   * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
   * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
   * control task attempts however they control how tasks are
   * attempted in different ways:
   * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
   *   dispatches from a queue (i.e. all traffic dispatched from the
   *   queue, regardless of whether the dispatch is from a first
   *   attempt or a retry).
   * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
   *   particular a task after its first attempt fails. That is,
   *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
   *   second attempt, third attempt, etc).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
   */
  public boolean hasRateLimits() {
    return rateLimits_ != null;
  }
  /**
   * <pre>
   * Rate limits for task dispatches.
   * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
   * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
   * control task attempts however they control how tasks are
   * attempted in different ways:
   * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
   *   dispatches from a queue (i.e. all traffic dispatched from the
   *   queue, regardless of whether the dispatch is from a first
   *   attempt or a retry).
   * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
   *   particular a task after its first attempt fails. That is,
   *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
   *   second attempt, third attempt, etc).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
   */
  public com.google.cloud.tasks.v2beta2.RateLimits getRateLimits() {
    return rateLimits_ == null ? com.google.cloud.tasks.v2beta2.RateLimits.getDefaultInstance() : rateLimits_;
  }
  /**
   * <pre>
   * Rate limits for task dispatches.
   * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
   * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
   * control task attempts however they control how tasks are
   * attempted in different ways:
   * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
   *   dispatches from a queue (i.e. all traffic dispatched from the
   *   queue, regardless of whether the dispatch is from a first
   *   attempt or a retry).
   * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
   *   particular a task after its first attempt fails. That is,
   *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
   *   second attempt, third attempt, etc).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
   */
  public com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder getRateLimitsOrBuilder() {
    return getRateLimits();
  }

  public static final int RETRY_CONFIG_FIELD_NUMBER = 6;
  private com.google.cloud.tasks.v2beta2.RetryConfig retryConfig_;
  /**
   * <pre>
   * Settings that determine the retry behavior.
   * * For tasks created using Cloud Tasks: the queue-level retry settings
   *   apply to all tasks in the queue that were created using Cloud Tasks.
   *   Retry settings cannot be set on individual tasks.
   * * For tasks created using the App Engine SDK: the queue-level retry
   *   settings apply to all tasks in the queue which do not have retry settings
   *   explicitly set on the task and were created by the App Engine SDK. See
   *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
   */
  public boolean hasRetryConfig() {
    return retryConfig_ != null;
  }
  /**
   * <pre>
   * Settings that determine the retry behavior.
   * * For tasks created using Cloud Tasks: the queue-level retry settings
   *   apply to all tasks in the queue that were created using Cloud Tasks.
   *   Retry settings cannot be set on individual tasks.
   * * For tasks created using the App Engine SDK: the queue-level retry
   *   settings apply to all tasks in the queue which do not have retry settings
   *   explicitly set on the task and were created by the App Engine SDK. See
   *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
   */
  public com.google.cloud.tasks.v2beta2.RetryConfig getRetryConfig() {
    return retryConfig_ == null ? com.google.cloud.tasks.v2beta2.RetryConfig.getDefaultInstance() : retryConfig_;
  }
  /**
   * <pre>
   * Settings that determine the retry behavior.
   * * For tasks created using Cloud Tasks: the queue-level retry settings
   *   apply to all tasks in the queue that were created using Cloud Tasks.
   *   Retry settings cannot be set on individual tasks.
   * * For tasks created using the App Engine SDK: the queue-level retry
   *   settings apply to all tasks in the queue which do not have retry settings
   *   explicitly set on the task and were created by the App Engine SDK. See
   *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
   */
  public com.google.cloud.tasks.v2beta2.RetryConfigOrBuilder getRetryConfigOrBuilder() {
    return getRetryConfig();
  }

  public static final int STATE_FIELD_NUMBER = 7;
  private int state_;
  /**
   * <pre>
   * Output only. The state of the queue.
   * `state` can only be changed by called
   * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
   * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
   * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
   * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
   */
  public int getStateValue() {
    return state_;
  }
  /**
   * <pre>
   * Output only. The state of the queue.
   * `state` can only be changed by called
   * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
   * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
   * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
   * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
   */
  public com.google.cloud.tasks.v2beta2.Queue.State getState() {
    @SuppressWarnings("deprecation")
    com.google.cloud.tasks.v2beta2.Queue.State result = com.google.cloud.tasks.v2beta2.Queue.State.valueOf(state_);
    return result == null ? com.google.cloud.tasks.v2beta2.Queue.State.UNRECOGNIZED : result;
  }

  public static final int PURGE_TIME_FIELD_NUMBER = 8;
  private com.google.protobuf.Timestamp purgeTime_;
  /**
   * <pre>
   * Output only. The last time this queue was purged.
   * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
   * were purged.
   * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
   * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
   * Purge time will be truncated to the nearest microsecond. Purge
   * time will be unset if the queue has never been purged.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp purge_time = 8;</code>
   */
  public boolean hasPurgeTime() {
    return purgeTime_ != null;
  }
  /**
   * <pre>
   * Output only. The last time this queue was purged.
   * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
   * were purged.
   * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
   * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
   * Purge time will be truncated to the nearest microsecond. Purge
   * time will be unset if the queue has never been purged.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp purge_time = 8;</code>
   */
  public com.google.protobuf.Timestamp getPurgeTime() {
    return purgeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : purgeTime_;
  }
  /**
   * <pre>
   * Output only. The last time this queue was purged.
   * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
   * were purged.
   * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
   * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
   * Purge time will be truncated to the nearest microsecond. Purge
   * time will be unset if the queue has never been purged.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp purge_time = 8;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getPurgeTimeOrBuilder() {
    return getPurgeTime();
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (targetTypeCase_ == 3) {
      output.writeMessage(3, (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_);
    }
    if (targetTypeCase_ == 4) {
      output.writeMessage(4, (com.google.cloud.tasks.v2beta2.PullTarget) targetType_);
    }
    if (rateLimits_ != null) {
      output.writeMessage(5, getRateLimits());
    }
    if (retryConfig_ != null) {
      output.writeMessage(6, getRetryConfig());
    }
    if (state_ != com.google.cloud.tasks.v2beta2.Queue.State.STATE_UNSPECIFIED.getNumber()) {
      output.writeEnum(7, state_);
    }
    if (purgeTime_ != null) {
      output.writeMessage(8, getPurgeTime());
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (targetTypeCase_ == 3) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_);
    }
    if (targetTypeCase_ == 4) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, (com.google.cloud.tasks.v2beta2.PullTarget) targetType_);
    }
    if (rateLimits_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getRateLimits());
    }
    if (retryConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, getRetryConfig());
    }
    if (state_ != com.google.cloud.tasks.v2beta2.Queue.State.STATE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(7, state_);
    }
    if (purgeTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(8, getPurgeTime());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.cloud.tasks.v2beta2.Queue)) {
      return super.equals(obj);
    }
    com.google.cloud.tasks.v2beta2.Queue other = (com.google.cloud.tasks.v2beta2.Queue) obj;

    boolean result = true;
    result = result && getName()
        .equals(other.getName());
    result = result && (hasRateLimits() == other.hasRateLimits());
    if (hasRateLimits()) {
      result = result && getRateLimits()
          .equals(other.getRateLimits());
    }
    result = result && (hasRetryConfig() == other.hasRetryConfig());
    if (hasRetryConfig()) {
      result = result && getRetryConfig()
          .equals(other.getRetryConfig());
    }
    result = result && state_ == other.state_;
    result = result && (hasPurgeTime() == other.hasPurgeTime());
    if (hasPurgeTime()) {
      result = result && getPurgeTime()
          .equals(other.getPurgeTime());
    }
    result = result && getTargetTypeCase().equals(
        other.getTargetTypeCase());
    if (!result) return false;
    switch (targetTypeCase_) {
      case 3:
        result = result && getAppEngineHttpTarget()
            .equals(other.getAppEngineHttpTarget());
        break;
      case 4:
        result = result && getPullTarget()
            .equals(other.getPullTarget());
        break;
      case 0:
      default:
    }
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (hasRateLimits()) {
      hash = (37 * hash) + RATE_LIMITS_FIELD_NUMBER;
      hash = (53 * hash) + getRateLimits().hashCode();
    }
    if (hasRetryConfig()) {
      hash = (37 * hash) + RETRY_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getRetryConfig().hashCode();
    }
    hash = (37 * hash) + STATE_FIELD_NUMBER;
    hash = (53 * hash) + state_;
    if (hasPurgeTime()) {
      hash = (37 * hash) + PURGE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getPurgeTime().hashCode();
    }
    switch (targetTypeCase_) {
      case 3:
        hash = (37 * hash) + APP_ENGINE_HTTP_TARGET_FIELD_NUMBER;
        hash = (53 * hash) + getAppEngineHttpTarget().hashCode();
        break;
      case 4:
        hash = (37 * hash) + PULL_TARGET_FIELD_NUMBER;
        hash = (53 * hash) + getPullTarget().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta2.Queue parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.tasks.v2beta2.Queue prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * A queue is a container of related tasks. Queues are configured to manage
   * how those tasks are dispatched. Configurable properties include rate limits,
   * retry options, target types, and others.
   * </pre>
   *
   * Protobuf type {@code google.cloud.tasks.v2beta2.Queue}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta2.Queue)
      com.google.cloud.tasks.v2beta2.QueueOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.tasks.v2beta2.QueueProto.internal_static_google_cloud_tasks_v2beta2_Queue_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.tasks.v2beta2.QueueProto.internal_static_google_cloud_tasks_v2beta2_Queue_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.tasks.v2beta2.Queue.class, com.google.cloud.tasks.v2beta2.Queue.Builder.class);
    }

    // Construct using com.google.cloud.tasks.v2beta2.Queue.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      name_ = "";

      if (rateLimitsBuilder_ == null) {
        rateLimits_ = null;
      } else {
        rateLimits_ = null;
        rateLimitsBuilder_ = null;
      }
      if (retryConfigBuilder_ == null) {
        retryConfig_ = null;
      } else {
        retryConfig_ = null;
        retryConfigBuilder_ = null;
      }
      state_ = 0;

      if (purgeTimeBuilder_ == null) {
        purgeTime_ = null;
      } else {
        purgeTime_ = null;
        purgeTimeBuilder_ = null;
      }
      targetTypeCase_ = 0;
      targetType_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.tasks.v2beta2.QueueProto.internal_static_google_cloud_tasks_v2beta2_Queue_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.tasks.v2beta2.Queue getDefaultInstanceForType() {
      return com.google.cloud.tasks.v2beta2.Queue.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.tasks.v2beta2.Queue build() {
      com.google.cloud.tasks.v2beta2.Queue result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.tasks.v2beta2.Queue buildPartial() {
      com.google.cloud.tasks.v2beta2.Queue result = new com.google.cloud.tasks.v2beta2.Queue(this);
      result.name_ = name_;
      if (targetTypeCase_ == 3) {
        if (appEngineHttpTargetBuilder_ == null) {
          result.targetType_ = targetType_;
        } else {
          result.targetType_ = appEngineHttpTargetBuilder_.build();
        }
      }
      if (targetTypeCase_ == 4) {
        if (pullTargetBuilder_ == null) {
          result.targetType_ = targetType_;
        } else {
          result.targetType_ = pullTargetBuilder_.build();
        }
      }
      if (rateLimitsBuilder_ == null) {
        result.rateLimits_ = rateLimits_;
      } else {
        result.rateLimits_ = rateLimitsBuilder_.build();
      }
      if (retryConfigBuilder_ == null) {
        result.retryConfig_ = retryConfig_;
      } else {
        result.retryConfig_ = retryConfigBuilder_.build();
      }
      result.state_ = state_;
      if (purgeTimeBuilder_ == null) {
        result.purgeTime_ = purgeTime_;
      } else {
        result.purgeTime_ = purgeTimeBuilder_.build();
      }
      result.targetTypeCase_ = targetTypeCase_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.tasks.v2beta2.Queue) {
        return mergeFrom((com.google.cloud.tasks.v2beta2.Queue)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.tasks.v2beta2.Queue other) {
      if (other == com.google.cloud.tasks.v2beta2.Queue.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.hasRateLimits()) {
        mergeRateLimits(other.getRateLimits());
      }
      if (other.hasRetryConfig()) {
        mergeRetryConfig(other.getRetryConfig());
      }
      if (other.state_ != 0) {
        setStateValue(other.getStateValue());
      }
      if (other.hasPurgeTime()) {
        mergePurgeTime(other.getPurgeTime());
      }
      switch (other.getTargetTypeCase()) {
        case APP_ENGINE_HTTP_TARGET: {
          mergeAppEngineHttpTarget(other.getAppEngineHttpTarget());
          break;
        }
        case PULL_TARGET: {
          mergePullTarget(other.getPullTarget());
          break;
        }
        case TARGETTYPE_NOT_SET: {
          break;
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.tasks.v2beta2.Queue parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.tasks.v2beta2.Queue) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int targetTypeCase_ = 0;
    private java.lang.Object targetType_;
    public TargetTypeCase
        getTargetTypeCase() {
      return TargetTypeCase.forNumber(
          targetTypeCase_);
    }

    public Builder clearTargetType() {
      targetTypeCase_ = 0;
      targetType_ = null;
      onChanged();
      return this;
    }


    private java.lang.Object name_ = "";
    /**
     * <pre>
     * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      name_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder clearName() {
      
      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.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][google.cloud.location.Locations.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.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      name_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AppEngineHttpTarget, com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder, com.google.cloud.tasks.v2beta2.AppEngineHttpTargetOrBuilder> appEngineHttpTargetBuilder_;
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public boolean hasAppEngineHttpTarget() {
      return targetTypeCase_ == 3;
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AppEngineHttpTarget getAppEngineHttpTarget() {
      if (appEngineHttpTargetBuilder_ == null) {
        if (targetTypeCase_ == 3) {
          return (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_;
        }
        return com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
      } else {
        if (targetTypeCase_ == 3) {
          return appEngineHttpTargetBuilder_.getMessage();
        }
        return com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public Builder setAppEngineHttpTarget(com.google.cloud.tasks.v2beta2.AppEngineHttpTarget value) {
      if (appEngineHttpTargetBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        targetType_ = value;
        onChanged();
      } else {
        appEngineHttpTargetBuilder_.setMessage(value);
      }
      targetTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public Builder setAppEngineHttpTarget(
        com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder builderForValue) {
      if (appEngineHttpTargetBuilder_ == null) {
        targetType_ = builderForValue.build();
        onChanged();
      } else {
        appEngineHttpTargetBuilder_.setMessage(builderForValue.build());
      }
      targetTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public Builder mergeAppEngineHttpTarget(com.google.cloud.tasks.v2beta2.AppEngineHttpTarget value) {
      if (appEngineHttpTargetBuilder_ == null) {
        if (targetTypeCase_ == 3 &&
            targetType_ != com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance()) {
          targetType_ = com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.newBuilder((com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_)
              .mergeFrom(value).buildPartial();
        } else {
          targetType_ = value;
        }
        onChanged();
      } else {
        if (targetTypeCase_ == 3) {
          appEngineHttpTargetBuilder_.mergeFrom(value);
        }
        appEngineHttpTargetBuilder_.setMessage(value);
      }
      targetTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public Builder clearAppEngineHttpTarget() {
      if (appEngineHttpTargetBuilder_ == null) {
        if (targetTypeCase_ == 3) {
          targetTypeCase_ = 0;
          targetType_ = null;
          onChanged();
        }
      } else {
        if (targetTypeCase_ == 3) {
          targetTypeCase_ = 0;
          targetType_ = null;
        }
        appEngineHttpTargetBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder getAppEngineHttpTargetBuilder() {
      return getAppEngineHttpTargetFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AppEngineHttpTargetOrBuilder getAppEngineHttpTargetOrBuilder() {
      if ((targetTypeCase_ == 3) && (appEngineHttpTargetBuilder_ != null)) {
        return appEngineHttpTargetBuilder_.getMessageOrBuilder();
      } else {
        if (targetTypeCase_ == 3) {
          return (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_;
        }
        return com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * App Engine HTTP target.
     * An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AppEngineHttpTarget app_engine_http_target = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AppEngineHttpTarget, com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder, com.google.cloud.tasks.v2beta2.AppEngineHttpTargetOrBuilder> 
        getAppEngineHttpTargetFieldBuilder() {
      if (appEngineHttpTargetBuilder_ == null) {
        if (!(targetTypeCase_ == 3)) {
          targetType_ = com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.getDefaultInstance();
        }
        appEngineHttpTargetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.AppEngineHttpTarget, com.google.cloud.tasks.v2beta2.AppEngineHttpTarget.Builder, com.google.cloud.tasks.v2beta2.AppEngineHttpTargetOrBuilder>(
                (com.google.cloud.tasks.v2beta2.AppEngineHttpTarget) targetType_,
                getParentForChildren(),
                isClean());
        targetType_ = null;
      }
      targetTypeCase_ = 3;
      onChanged();;
      return appEngineHttpTargetBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.PullTarget, com.google.cloud.tasks.v2beta2.PullTarget.Builder, com.google.cloud.tasks.v2beta2.PullTargetOrBuilder> pullTargetBuilder_;
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public boolean hasPullTarget() {
      return targetTypeCase_ == 4;
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.PullTarget getPullTarget() {
      if (pullTargetBuilder_ == null) {
        if (targetTypeCase_ == 4) {
          return (com.google.cloud.tasks.v2beta2.PullTarget) targetType_;
        }
        return com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
      } else {
        if (targetTypeCase_ == 4) {
          return pullTargetBuilder_.getMessage();
        }
        return com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public Builder setPullTarget(com.google.cloud.tasks.v2beta2.PullTarget value) {
      if (pullTargetBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        targetType_ = value;
        onChanged();
      } else {
        pullTargetBuilder_.setMessage(value);
      }
      targetTypeCase_ = 4;
      return this;
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public Builder setPullTarget(
        com.google.cloud.tasks.v2beta2.PullTarget.Builder builderForValue) {
      if (pullTargetBuilder_ == null) {
        targetType_ = builderForValue.build();
        onChanged();
      } else {
        pullTargetBuilder_.setMessage(builderForValue.build());
      }
      targetTypeCase_ = 4;
      return this;
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public Builder mergePullTarget(com.google.cloud.tasks.v2beta2.PullTarget value) {
      if (pullTargetBuilder_ == null) {
        if (targetTypeCase_ == 4 &&
            targetType_ != com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance()) {
          targetType_ = com.google.cloud.tasks.v2beta2.PullTarget.newBuilder((com.google.cloud.tasks.v2beta2.PullTarget) targetType_)
              .mergeFrom(value).buildPartial();
        } else {
          targetType_ = value;
        }
        onChanged();
      } else {
        if (targetTypeCase_ == 4) {
          pullTargetBuilder_.mergeFrom(value);
        }
        pullTargetBuilder_.setMessage(value);
      }
      targetTypeCase_ = 4;
      return this;
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public Builder clearPullTarget() {
      if (pullTargetBuilder_ == null) {
        if (targetTypeCase_ == 4) {
          targetTypeCase_ = 0;
          targetType_ = null;
          onChanged();
        }
      } else {
        if (targetTypeCase_ == 4) {
          targetTypeCase_ = 0;
          targetType_ = null;
        }
        pullTargetBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.PullTarget.Builder getPullTargetBuilder() {
      return getPullTargetFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.PullTargetOrBuilder getPullTargetOrBuilder() {
      if ((targetTypeCase_ == 4) && (pullTargetBuilder_ != null)) {
        return pullTargetBuilder_.getMessageOrBuilder();
      } else {
        if (targetTypeCase_ == 4) {
          return (com.google.cloud.tasks.v2beta2.PullTarget) targetType_;
        }
        return com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * Pull target.
     * A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.PullTarget pull_target = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.PullTarget, com.google.cloud.tasks.v2beta2.PullTarget.Builder, com.google.cloud.tasks.v2beta2.PullTargetOrBuilder> 
        getPullTargetFieldBuilder() {
      if (pullTargetBuilder_ == null) {
        if (!(targetTypeCase_ == 4)) {
          targetType_ = com.google.cloud.tasks.v2beta2.PullTarget.getDefaultInstance();
        }
        pullTargetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.PullTarget, com.google.cloud.tasks.v2beta2.PullTarget.Builder, com.google.cloud.tasks.v2beta2.PullTargetOrBuilder>(
                (com.google.cloud.tasks.v2beta2.PullTarget) targetType_,
                getParentForChildren(),
                isClean());
        targetType_ = null;
      }
      targetTypeCase_ = 4;
      onChanged();;
      return pullTargetBuilder_;
    }

    private com.google.cloud.tasks.v2beta2.RateLimits rateLimits_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.RateLimits, com.google.cloud.tasks.v2beta2.RateLimits.Builder, com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder> rateLimitsBuilder_;
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public boolean hasRateLimits() {
      return rateLimitsBuilder_ != null || rateLimits_ != null;
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public com.google.cloud.tasks.v2beta2.RateLimits getRateLimits() {
      if (rateLimitsBuilder_ == null) {
        return rateLimits_ == null ? com.google.cloud.tasks.v2beta2.RateLimits.getDefaultInstance() : rateLimits_;
      } else {
        return rateLimitsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public Builder setRateLimits(com.google.cloud.tasks.v2beta2.RateLimits value) {
      if (rateLimitsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        rateLimits_ = value;
        onChanged();
      } else {
        rateLimitsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public Builder setRateLimits(
        com.google.cloud.tasks.v2beta2.RateLimits.Builder builderForValue) {
      if (rateLimitsBuilder_ == null) {
        rateLimits_ = builderForValue.build();
        onChanged();
      } else {
        rateLimitsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public Builder mergeRateLimits(com.google.cloud.tasks.v2beta2.RateLimits value) {
      if (rateLimitsBuilder_ == null) {
        if (rateLimits_ != null) {
          rateLimits_ =
            com.google.cloud.tasks.v2beta2.RateLimits.newBuilder(rateLimits_).mergeFrom(value).buildPartial();
        } else {
          rateLimits_ = value;
        }
        onChanged();
      } else {
        rateLimitsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public Builder clearRateLimits() {
      if (rateLimitsBuilder_ == null) {
        rateLimits_ = null;
        onChanged();
      } else {
        rateLimits_ = null;
        rateLimitsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public com.google.cloud.tasks.v2beta2.RateLimits.Builder getRateLimitsBuilder() {
      
      onChanged();
      return getRateLimitsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    public com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder getRateLimitsOrBuilder() {
      if (rateLimitsBuilder_ != null) {
        return rateLimitsBuilder_.getMessageOrBuilder();
      } else {
        return rateLimits_ == null ?
            com.google.cloud.tasks.v2beta2.RateLimits.getDefaultInstance() : rateLimits_;
      }
    }
    /**
     * <pre>
     * Rate limits for task dispatches.
     * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and
     * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both
     * control task attempts however they control how tasks are
     * attempted in different ways:
     * * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of
     *   dispatches from a queue (i.e. all traffic dispatched from the
     *   queue, regardless of whether the dispatch is from a first
     *   attempt or a retry).
     * * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to
     *   particular a task after its first attempt fails. That is,
     *   [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the
     *   second attempt, third attempt, etc).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RateLimits rate_limits = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.RateLimits, com.google.cloud.tasks.v2beta2.RateLimits.Builder, com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder> 
        getRateLimitsFieldBuilder() {
      if (rateLimitsBuilder_ == null) {
        rateLimitsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.RateLimits, com.google.cloud.tasks.v2beta2.RateLimits.Builder, com.google.cloud.tasks.v2beta2.RateLimitsOrBuilder>(
                getRateLimits(),
                getParentForChildren(),
                isClean());
        rateLimits_ = null;
      }
      return rateLimitsBuilder_;
    }

    private com.google.cloud.tasks.v2beta2.RetryConfig retryConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.RetryConfig, com.google.cloud.tasks.v2beta2.RetryConfig.Builder, com.google.cloud.tasks.v2beta2.RetryConfigOrBuilder> retryConfigBuilder_;
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public boolean hasRetryConfig() {
      return retryConfigBuilder_ != null || retryConfig_ != null;
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public com.google.cloud.tasks.v2beta2.RetryConfig getRetryConfig() {
      if (retryConfigBuilder_ == null) {
        return retryConfig_ == null ? com.google.cloud.tasks.v2beta2.RetryConfig.getDefaultInstance() : retryConfig_;
      } else {
        return retryConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public Builder setRetryConfig(com.google.cloud.tasks.v2beta2.RetryConfig value) {
      if (retryConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        retryConfig_ = value;
        onChanged();
      } else {
        retryConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public Builder setRetryConfig(
        com.google.cloud.tasks.v2beta2.RetryConfig.Builder builderForValue) {
      if (retryConfigBuilder_ == null) {
        retryConfig_ = builderForValue.build();
        onChanged();
      } else {
        retryConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public Builder mergeRetryConfig(com.google.cloud.tasks.v2beta2.RetryConfig value) {
      if (retryConfigBuilder_ == null) {
        if (retryConfig_ != null) {
          retryConfig_ =
            com.google.cloud.tasks.v2beta2.RetryConfig.newBuilder(retryConfig_).mergeFrom(value).buildPartial();
        } else {
          retryConfig_ = value;
        }
        onChanged();
      } else {
        retryConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public Builder clearRetryConfig() {
      if (retryConfigBuilder_ == null) {
        retryConfig_ = null;
        onChanged();
      } else {
        retryConfig_ = null;
        retryConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public com.google.cloud.tasks.v2beta2.RetryConfig.Builder getRetryConfigBuilder() {
      
      onChanged();
      return getRetryConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    public com.google.cloud.tasks.v2beta2.RetryConfigOrBuilder getRetryConfigOrBuilder() {
      if (retryConfigBuilder_ != null) {
        return retryConfigBuilder_.getMessageOrBuilder();
      } else {
        return retryConfig_ == null ?
            com.google.cloud.tasks.v2beta2.RetryConfig.getDefaultInstance() : retryConfig_;
      }
    }
    /**
     * <pre>
     * Settings that determine the retry behavior.
     * * For tasks created using Cloud Tasks: the queue-level retry settings
     *   apply to all tasks in the queue that were created using Cloud Tasks.
     *   Retry settings cannot be set on individual tasks.
     * * For tasks created using the App Engine SDK: the queue-level retry
     *   settings apply to all tasks in the queue which do not have retry settings
     *   explicitly set on the task and were created by the App Engine SDK. See
     *   [App Engine documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.RetryConfig retry_config = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.RetryConfig, com.google.cloud.tasks.v2beta2.RetryConfig.Builder, com.google.cloud.tasks.v2beta2.RetryConfigOrBuilder> 
        getRetryConfigFieldBuilder() {
      if (retryConfigBuilder_ == null) {
        retryConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.RetryConfig, com.google.cloud.tasks.v2beta2.RetryConfig.Builder, com.google.cloud.tasks.v2beta2.RetryConfigOrBuilder>(
                getRetryConfig(),
                getParentForChildren(),
                isClean());
        retryConfig_ = null;
      }
      return retryConfigBuilder_;
    }

    private int state_ = 0;
    /**
     * <pre>
     * Output only. The state of the queue.
     * `state` can only be changed by called
     * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
     * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
     * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
     * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
     */
    public int getStateValue() {
      return state_;
    }
    /**
     * <pre>
     * Output only. The state of the queue.
     * `state` can only be changed by called
     * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
     * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
     * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
     * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
     */
    public Builder setStateValue(int value) {
      state_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The state of the queue.
     * `state` can only be changed by called
     * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
     * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
     * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
     * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
     */
    public com.google.cloud.tasks.v2beta2.Queue.State getState() {
      @SuppressWarnings("deprecation")
      com.google.cloud.tasks.v2beta2.Queue.State result = com.google.cloud.tasks.v2beta2.Queue.State.valueOf(state_);
      return result == null ? com.google.cloud.tasks.v2beta2.Queue.State.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Output only. The state of the queue.
     * `state` can only be changed by called
     * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
     * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
     * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
     * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
     */
    public Builder setState(com.google.cloud.tasks.v2beta2.Queue.State value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      state_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The state of the queue.
     * `state` can only be changed by called
     * [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
     * [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading
     * [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
     * [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.Queue.State state = 7;</code>
     */
    public Builder clearState() {
      
      state_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp purgeTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> purgeTimeBuilder_;
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public boolean hasPurgeTime() {
      return purgeTimeBuilder_ != null || purgeTime_ != null;
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public com.google.protobuf.Timestamp getPurgeTime() {
      if (purgeTimeBuilder_ == null) {
        return purgeTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : purgeTime_;
      } else {
        return purgeTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public Builder setPurgeTime(com.google.protobuf.Timestamp value) {
      if (purgeTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        purgeTime_ = value;
        onChanged();
      } else {
        purgeTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public Builder setPurgeTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (purgeTimeBuilder_ == null) {
        purgeTime_ = builderForValue.build();
        onChanged();
      } else {
        purgeTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public Builder mergePurgeTime(com.google.protobuf.Timestamp value) {
      if (purgeTimeBuilder_ == null) {
        if (purgeTime_ != null) {
          purgeTime_ =
            com.google.protobuf.Timestamp.newBuilder(purgeTime_).mergeFrom(value).buildPartial();
        } else {
          purgeTime_ = value;
        }
        onChanged();
      } else {
        purgeTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public Builder clearPurgeTime() {
      if (purgeTimeBuilder_ == null) {
        purgeTime_ = null;
        onChanged();
      } else {
        purgeTime_ = null;
        purgeTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public com.google.protobuf.Timestamp.Builder getPurgeTimeBuilder() {
      
      onChanged();
      return getPurgeTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getPurgeTimeOrBuilder() {
      if (purgeTimeBuilder_ != null) {
        return purgeTimeBuilder_.getMessageOrBuilder();
      } else {
        return purgeTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : purgeTime_;
      }
    }
    /**
     * <pre>
     * Output only. The last time this queue was purged.
     * All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time
     * were purged.
     * A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the
     * [App Engine Task Queue SDK, or the Cloud Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
     * Purge time will be truncated to the nearest microsecond. Purge
     * time will be unset if the queue has never been purged.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp purge_time = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getPurgeTimeFieldBuilder() {
      if (purgeTimeBuilder_ == null) {
        purgeTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getPurgeTime(),
                getParentForChildren(),
                isClean());
        purgeTime_ = null;
      }
      return purgeTimeBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:google.cloud.tasks.v2beta2.Queue)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta2.Queue)
  private static final com.google.cloud.tasks.v2beta2.Queue DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta2.Queue();
  }

  public static com.google.cloud.tasks.v2beta2.Queue getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Queue>
      PARSER = new com.google.protobuf.AbstractParser<Queue>() {
    @java.lang.Override
    public Queue parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new Queue(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<Queue> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Queue> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.tasks.v2beta2.Queue getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

