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

package com.google.cloud.tasks.v2beta3;

/**
 * <pre>
 * A unit of scheduled work.
 * </pre>
 *
 * Protobuf type {@code google.cloud.tasks.v2beta3.Task}
 */
public  final class Task extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta3.Task)
    TaskOrBuilder {
private static final long serialVersionUID = 0L;
  // Use Task.newBuilder() to construct.
  private Task(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private Task() {
    name_ = "";
    dispatchCount_ = 0;
    responseCount_ = 0;
    view_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private Task(
      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.v2beta3.AppEngineHttpRequest.Builder subBuilder = null;
            if (payloadTypeCase_ == 3) {
              subBuilder = ((com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_).toBuilder();
            }
            payloadType_ =
                input.readMessage(com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom((com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_);
              payloadType_ = subBuilder.buildPartial();
            }
            payloadTypeCase_ = 3;
            break;
          }
          case 34: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (scheduleTime_ != null) {
              subBuilder = scheduleTime_.toBuilder();
            }
            scheduleTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(scheduleTime_);
              scheduleTime_ = subBuilder.buildPartial();
            }

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

            break;
          }
          case 48: {

            dispatchCount_ = input.readInt32();
            break;
          }
          case 56: {

            responseCount_ = input.readInt32();
            break;
          }
          case 66: {
            com.google.cloud.tasks.v2beta3.Attempt.Builder subBuilder = null;
            if (firstAttempt_ != null) {
              subBuilder = firstAttempt_.toBuilder();
            }
            firstAttempt_ = input.readMessage(com.google.cloud.tasks.v2beta3.Attempt.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(firstAttempt_);
              firstAttempt_ = subBuilder.buildPartial();
            }

            break;
          }
          case 74: {
            com.google.cloud.tasks.v2beta3.Attempt.Builder subBuilder = null;
            if (lastAttempt_ != null) {
              subBuilder = lastAttempt_.toBuilder();
            }
            lastAttempt_ = input.readMessage(com.google.cloud.tasks.v2beta3.Attempt.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(lastAttempt_);
              lastAttempt_ = subBuilder.buildPartial();
            }

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

            view_ = rawValue;
            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.v2beta3.TaskProto.internal_static_google_cloud_tasks_v2beta3_Task_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.tasks.v2beta3.TaskProto.internal_static_google_cloud_tasks_v2beta3_Task_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.tasks.v2beta3.Task.class, com.google.cloud.tasks.v2beta3.Task.Builder.class);
  }

  /**
   * <pre>
   * The view specifies a subset of [Task][google.cloud.tasks.v2beta3.Task] data.
   * When a task is returned in a response, not all
   * information is retrieved by default because some data, such as
   * payloads, might be desirable to return only when needed because
   * of its large size or because of the sensitivity of data that it
   * contains.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.tasks.v2beta3.Task.View}
   */
  public enum View
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * Unspecified. Defaults to BASIC.
     * </pre>
     *
     * <code>VIEW_UNSPECIFIED = 0;</code>
     */
    VIEW_UNSPECIFIED(0),
    /**
     * <pre>
     * The basic view omits fields which can be large or can contain
     * sensitive data.
     * This view does not include the
     * [body in AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body].
     * Bodies are desirable to return only when needed, because they
     * can be large and because of the sensitivity of the data that you
     * choose to store in it.
     * </pre>
     *
     * <code>BASIC = 1;</code>
     */
    BASIC(1),
    /**
     * <pre>
     * All information is returned.
     * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
     * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
     * permission on the [Queue][google.cloud.tasks.v2beta3.Queue] resource.
     * </pre>
     *
     * <code>FULL = 2;</code>
     */
    FULL(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Unspecified. Defaults to BASIC.
     * </pre>
     *
     * <code>VIEW_UNSPECIFIED = 0;</code>
     */
    public static final int VIEW_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * The basic view omits fields which can be large or can contain
     * sensitive data.
     * This view does not include the
     * [body in AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body].
     * Bodies are desirable to return only when needed, because they
     * can be large and because of the sensitivity of the data that you
     * choose to store in it.
     * </pre>
     *
     * <code>BASIC = 1;</code>
     */
    public static final int BASIC_VALUE = 1;
    /**
     * <pre>
     * All information is returned.
     * Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires
     * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
     * permission on the [Queue][google.cloud.tasks.v2beta3.Queue] resource.
     * </pre>
     *
     * <code>FULL = 2;</code>
     */
    public static final int FULL_VALUE = 2;


    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 View valueOf(int value) {
      return forNumber(value);
    }

    public static View forNumber(int value) {
      switch (value) {
        case 0: return VIEW_UNSPECIFIED;
        case 1: return BASIC;
        case 2: return FULL;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<View>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        View> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<View>() {
            public View findValueByNumber(int number) {
              return View.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.v2beta3.Task.getDescriptor().getEnumTypes().get(0);
    }

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

    public static View 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 View(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.tasks.v2beta3.Task.View)
  }

  private int payloadTypeCase_ = 0;
  private java.lang.Object payloadType_;
  public enum PayloadTypeCase
      implements com.google.protobuf.Internal.EnumLite {
    APP_ENGINE_HTTP_REQUEST(3),
    PAYLOADTYPE_NOT_SET(0);
    private final int value;
    private PayloadTypeCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static PayloadTypeCase valueOf(int value) {
      return forNumber(value);
    }

    public static PayloadTypeCase forNumber(int value) {
      switch (value) {
        case 3: return APP_ENGINE_HTTP_REQUEST;
        case 0: return PAYLOADTYPE_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  public PayloadTypeCase
  getPayloadTypeCase() {
    return PayloadTypeCase.forNumber(
        payloadTypeCase_);
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   * <pre>
   * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
   * The task name.
   * The task name must have the following format:
   * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
   * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
   *   hyphens (-), or underscores (_). The maximum length is 500 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>
   * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
   * The task name.
   * The task name must have the following format:
   * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
   * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
   *   hyphens (-), or underscores (_). The maximum length is 500 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_REQUEST_FIELD_NUMBER = 3;
  /**
   * <pre>
   * App Engine HTTP request that is sent to the task's target. Can
   * be set only if
   * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
   * on the queue.
   * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
   */
  public boolean hasAppEngineHttpRequest() {
    return payloadTypeCase_ == 3;
  }
  /**
   * <pre>
   * App Engine HTTP request that is sent to the task's target. Can
   * be set only if
   * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
   * on the queue.
   * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
   */
  public com.google.cloud.tasks.v2beta3.AppEngineHttpRequest getAppEngineHttpRequest() {
    if (payloadTypeCase_ == 3) {
       return (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_;
    }
    return com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
  }
  /**
   * <pre>
   * App Engine HTTP request that is sent to the task's target. Can
   * be set only if
   * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
   * on the queue.
   * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
   */
  public com.google.cloud.tasks.v2beta3.AppEngineHttpRequestOrBuilder getAppEngineHttpRequestOrBuilder() {
    if (payloadTypeCase_ == 3) {
       return (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_;
    }
    return com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
  }

  public static final int SCHEDULE_TIME_FIELD_NUMBER = 4;
  private com.google.protobuf.Timestamp scheduleTime_;
  /**
   * <pre>
   * The time when the task is scheduled to be attempted.
   * For App Engine queues, this is when the task will be attempted or retried.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
   */
  public boolean hasScheduleTime() {
    return scheduleTime_ != null;
  }
  /**
   * <pre>
   * The time when the task is scheduled to be attempted.
   * For App Engine queues, this is when the task will be attempted or retried.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
   */
  public com.google.protobuf.Timestamp getScheduleTime() {
    return scheduleTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_;
  }
  /**
   * <pre>
   * The time when the task is scheduled to be attempted.
   * For App Engine queues, this is when the task will be attempted or retried.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() {
    return getScheduleTime();
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 5;
  private com.google.protobuf.Timestamp createTime_;
  /**
   * <pre>
   * Output only. The time that the task was created.
   * `create_time` will be truncated to the nearest second.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 5;</code>
   */
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   * <pre>
   * Output only. The time that the task was created.
   * `create_time` will be truncated to the nearest second.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 5;</code>
   */
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   * <pre>
   * Output only. The time that the task was created.
   * `create_time` will be truncated to the nearest second.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 5;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    return getCreateTime();
  }

  public static final int DISPATCH_COUNT_FIELD_NUMBER = 6;
  private int dispatchCount_;
  /**
   * <pre>
   * Output only. The number of attempts dispatched.
   * This count includes tasks which have been dispatched but haven't
   * received a response.
   * </pre>
   *
   * <code>int32 dispatch_count = 6;</code>
   */
  public int getDispatchCount() {
    return dispatchCount_;
  }

  public static final int RESPONSE_COUNT_FIELD_NUMBER = 7;
  private int responseCount_;
  /**
   * <pre>
   * Output only. The number of attempts which have received a response.
   * </pre>
   *
   * <code>int32 response_count = 7;</code>
   */
  public int getResponseCount() {
    return responseCount_;
  }

  public static final int FIRST_ATTEMPT_FIELD_NUMBER = 8;
  private com.google.cloud.tasks.v2beta3.Attempt firstAttempt_;
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
   * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
   */
  public boolean hasFirstAttempt() {
    return firstAttempt_ != null;
  }
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
   * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
   */
  public com.google.cloud.tasks.v2beta3.Attempt getFirstAttempt() {
    return firstAttempt_ == null ? com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : firstAttempt_;
  }
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
   * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
   */
  public com.google.cloud.tasks.v2beta3.AttemptOrBuilder getFirstAttemptOrBuilder() {
    return getFirstAttempt();
  }

  public static final int LAST_ATTEMPT_FIELD_NUMBER = 9;
  private com.google.cloud.tasks.v2beta3.Attempt lastAttempt_;
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
   */
  public boolean hasLastAttempt() {
    return lastAttempt_ != null;
  }
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
   */
  public com.google.cloud.tasks.v2beta3.Attempt getLastAttempt() {
    return lastAttempt_ == null ? com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : lastAttempt_;
  }
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
   */
  public com.google.cloud.tasks.v2beta3.AttemptOrBuilder getLastAttemptOrBuilder() {
    return getLastAttempt();
  }

  public static final int VIEW_FIELD_NUMBER = 10;
  private int view_;
  /**
   * <pre>
   * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
   * been returned.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
   */
  public int getViewValue() {
    return view_;
  }
  /**
   * <pre>
   * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
   * been returned.
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
   */
  public com.google.cloud.tasks.v2beta3.Task.View getView() {
    @SuppressWarnings("deprecation")
    com.google.cloud.tasks.v2beta3.Task.View result = com.google.cloud.tasks.v2beta3.Task.View.valueOf(view_);
    return result == null ? com.google.cloud.tasks.v2beta3.Task.View.UNRECOGNIZED : result;
  }

  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 (payloadTypeCase_ == 3) {
      output.writeMessage(3, (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_);
    }
    if (scheduleTime_ != null) {
      output.writeMessage(4, getScheduleTime());
    }
    if (createTime_ != null) {
      output.writeMessage(5, getCreateTime());
    }
    if (dispatchCount_ != 0) {
      output.writeInt32(6, dispatchCount_);
    }
    if (responseCount_ != 0) {
      output.writeInt32(7, responseCount_);
    }
    if (firstAttempt_ != null) {
      output.writeMessage(8, getFirstAttempt());
    }
    if (lastAttempt_ != null) {
      output.writeMessage(9, getLastAttempt());
    }
    if (view_ != com.google.cloud.tasks.v2beta3.Task.View.VIEW_UNSPECIFIED.getNumber()) {
      output.writeEnum(10, view_);
    }
    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 (payloadTypeCase_ == 3) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_);
    }
    if (scheduleTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getScheduleTime());
    }
    if (createTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getCreateTime());
    }
    if (dispatchCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(6, dispatchCount_);
    }
    if (responseCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(7, responseCount_);
    }
    if (firstAttempt_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(8, getFirstAttempt());
    }
    if (lastAttempt_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(9, getLastAttempt());
    }
    if (view_ != com.google.cloud.tasks.v2beta3.Task.View.VIEW_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(10, view_);
    }
    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.v2beta3.Task)) {
      return super.equals(obj);
    }
    com.google.cloud.tasks.v2beta3.Task other = (com.google.cloud.tasks.v2beta3.Task) obj;

    boolean result = true;
    result = result && getName()
        .equals(other.getName());
    result = result && (hasScheduleTime() == other.hasScheduleTime());
    if (hasScheduleTime()) {
      result = result && getScheduleTime()
          .equals(other.getScheduleTime());
    }
    result = result && (hasCreateTime() == other.hasCreateTime());
    if (hasCreateTime()) {
      result = result && getCreateTime()
          .equals(other.getCreateTime());
    }
    result = result && (getDispatchCount()
        == other.getDispatchCount());
    result = result && (getResponseCount()
        == other.getResponseCount());
    result = result && (hasFirstAttempt() == other.hasFirstAttempt());
    if (hasFirstAttempt()) {
      result = result && getFirstAttempt()
          .equals(other.getFirstAttempt());
    }
    result = result && (hasLastAttempt() == other.hasLastAttempt());
    if (hasLastAttempt()) {
      result = result && getLastAttempt()
          .equals(other.getLastAttempt());
    }
    result = result && view_ == other.view_;
    result = result && getPayloadTypeCase().equals(
        other.getPayloadTypeCase());
    if (!result) return false;
    switch (payloadTypeCase_) {
      case 3:
        result = result && getAppEngineHttpRequest()
            .equals(other.getAppEngineHttpRequest());
        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 (hasScheduleTime()) {
      hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getScheduleTime().hashCode();
    }
    if (hasCreateTime()) {
      hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCreateTime().hashCode();
    }
    hash = (37 * hash) + DISPATCH_COUNT_FIELD_NUMBER;
    hash = (53 * hash) + getDispatchCount();
    hash = (37 * hash) + RESPONSE_COUNT_FIELD_NUMBER;
    hash = (53 * hash) + getResponseCount();
    if (hasFirstAttempt()) {
      hash = (37 * hash) + FIRST_ATTEMPT_FIELD_NUMBER;
      hash = (53 * hash) + getFirstAttempt().hashCode();
    }
    if (hasLastAttempt()) {
      hash = (37 * hash) + LAST_ATTEMPT_FIELD_NUMBER;
      hash = (53 * hash) + getLastAttempt().hashCode();
    }
    hash = (37 * hash) + VIEW_FIELD_NUMBER;
    hash = (53 * hash) + view_;
    switch (payloadTypeCase_) {
      case 3:
        hash = (37 * hash) + APP_ENGINE_HTTP_REQUEST_FIELD_NUMBER;
        hash = (53 * hash) + getAppEngineHttpRequest().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.tasks.v2beta3.Task parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta3.Task 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.v2beta3.Task parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta3.Task 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.v2beta3.Task parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta3.Task parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.tasks.v2beta3.Task parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta3.Task 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.v2beta3.Task parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta3.Task 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.v2beta3.Task parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta3.Task 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.v2beta3.Task 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 unit of scheduled work.
   * </pre>
   *
   * Protobuf type {@code google.cloud.tasks.v2beta3.Task}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta3.Task)
      com.google.cloud.tasks.v2beta3.TaskOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.tasks.v2beta3.TaskProto.internal_static_google_cloud_tasks_v2beta3_Task_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.tasks.v2beta3.TaskProto.internal_static_google_cloud_tasks_v2beta3_Task_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.tasks.v2beta3.Task.class, com.google.cloud.tasks.v2beta3.Task.Builder.class);
    }

    // Construct using com.google.cloud.tasks.v2beta3.Task.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 (scheduleTimeBuilder_ == null) {
        scheduleTime_ = null;
      } else {
        scheduleTime_ = null;
        scheduleTimeBuilder_ = null;
      }
      if (createTimeBuilder_ == null) {
        createTime_ = null;
      } else {
        createTime_ = null;
        createTimeBuilder_ = null;
      }
      dispatchCount_ = 0;

      responseCount_ = 0;

      if (firstAttemptBuilder_ == null) {
        firstAttempt_ = null;
      } else {
        firstAttempt_ = null;
        firstAttemptBuilder_ = null;
      }
      if (lastAttemptBuilder_ == null) {
        lastAttempt_ = null;
      } else {
        lastAttempt_ = null;
        lastAttemptBuilder_ = null;
      }
      view_ = 0;

      payloadTypeCase_ = 0;
      payloadType_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.tasks.v2beta3.TaskProto.internal_static_google_cloud_tasks_v2beta3_Task_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.tasks.v2beta3.Task buildPartial() {
      com.google.cloud.tasks.v2beta3.Task result = new com.google.cloud.tasks.v2beta3.Task(this);
      result.name_ = name_;
      if (payloadTypeCase_ == 3) {
        if (appEngineHttpRequestBuilder_ == null) {
          result.payloadType_ = payloadType_;
        } else {
          result.payloadType_ = appEngineHttpRequestBuilder_.build();
        }
      }
      if (scheduleTimeBuilder_ == null) {
        result.scheduleTime_ = scheduleTime_;
      } else {
        result.scheduleTime_ = scheduleTimeBuilder_.build();
      }
      if (createTimeBuilder_ == null) {
        result.createTime_ = createTime_;
      } else {
        result.createTime_ = createTimeBuilder_.build();
      }
      result.dispatchCount_ = dispatchCount_;
      result.responseCount_ = responseCount_;
      if (firstAttemptBuilder_ == null) {
        result.firstAttempt_ = firstAttempt_;
      } else {
        result.firstAttempt_ = firstAttemptBuilder_.build();
      }
      if (lastAttemptBuilder_ == null) {
        result.lastAttempt_ = lastAttempt_;
      } else {
        result.lastAttempt_ = lastAttemptBuilder_.build();
      }
      result.view_ = view_;
      result.payloadTypeCase_ = payloadTypeCase_;
      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.v2beta3.Task) {
        return mergeFrom((com.google.cloud.tasks.v2beta3.Task)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.tasks.v2beta3.Task other) {
      if (other == com.google.cloud.tasks.v2beta3.Task.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.hasScheduleTime()) {
        mergeScheduleTime(other.getScheduleTime());
      }
      if (other.hasCreateTime()) {
        mergeCreateTime(other.getCreateTime());
      }
      if (other.getDispatchCount() != 0) {
        setDispatchCount(other.getDispatchCount());
      }
      if (other.getResponseCount() != 0) {
        setResponseCount(other.getResponseCount());
      }
      if (other.hasFirstAttempt()) {
        mergeFirstAttempt(other.getFirstAttempt());
      }
      if (other.hasLastAttempt()) {
        mergeLastAttempt(other.getLastAttempt());
      }
      if (other.view_ != 0) {
        setViewValue(other.getViewValue());
      }
      switch (other.getPayloadTypeCase()) {
        case APP_ENGINE_HTTP_REQUEST: {
          mergeAppEngineHttpRequest(other.getAppEngineHttpRequest());
          break;
        }
        case PAYLOADTYPE_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.v2beta3.Task parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.tasks.v2beta3.Task) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int payloadTypeCase_ = 0;
    private java.lang.Object payloadType_;
    public PayloadTypeCase
        getPayloadTypeCase() {
      return PayloadTypeCase.forNumber(
          payloadTypeCase_);
    }

    public Builder clearPayloadType() {
      payloadTypeCase_ = 0;
      payloadType_ = null;
      onChanged();
      return this;
    }


    private java.lang.Object name_ = "";
    /**
     * <pre>
     * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
     * The task name.
     * The task name must have the following format:
     * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
     * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
     *   hyphens (-), or underscores (_). The maximum length is 500 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>
     * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
     * The task name.
     * The task name must have the following format:
     * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
     * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
     *   hyphens (-), or underscores (_). The maximum length is 500 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>
     * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
     * The task name.
     * The task name must have the following format:
     * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
     * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
     *   hyphens (-), or underscores (_). The maximum length is 500 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>
     * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
     * The task name.
     * The task name must have the following format:
     * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
     * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
     *   hyphens (-), or underscores (_). The maximum length is 500 characters.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder clearName() {
      
      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
     * The task name.
     * The task name must have the following format:
     * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_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 task'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.
     * * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
     *   hyphens (-), or underscores (_). The maximum length is 500 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.v2beta3.AppEngineHttpRequest, com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.Builder, com.google.cloud.tasks.v2beta3.AppEngineHttpRequestOrBuilder> appEngineHttpRequestBuilder_;
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public boolean hasAppEngineHttpRequest() {
      return payloadTypeCase_ == 3;
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public com.google.cloud.tasks.v2beta3.AppEngineHttpRequest getAppEngineHttpRequest() {
      if (appEngineHttpRequestBuilder_ == null) {
        if (payloadTypeCase_ == 3) {
          return (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_;
        }
        return com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
      } else {
        if (payloadTypeCase_ == 3) {
          return appEngineHttpRequestBuilder_.getMessage();
        }
        return com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public Builder setAppEngineHttpRequest(com.google.cloud.tasks.v2beta3.AppEngineHttpRequest value) {
      if (appEngineHttpRequestBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        payloadType_ = value;
        onChanged();
      } else {
        appEngineHttpRequestBuilder_.setMessage(value);
      }
      payloadTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public Builder setAppEngineHttpRequest(
        com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.Builder builderForValue) {
      if (appEngineHttpRequestBuilder_ == null) {
        payloadType_ = builderForValue.build();
        onChanged();
      } else {
        appEngineHttpRequestBuilder_.setMessage(builderForValue.build());
      }
      payloadTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public Builder mergeAppEngineHttpRequest(com.google.cloud.tasks.v2beta3.AppEngineHttpRequest value) {
      if (appEngineHttpRequestBuilder_ == null) {
        if (payloadTypeCase_ == 3 &&
            payloadType_ != com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance()) {
          payloadType_ = com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.newBuilder((com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_)
              .mergeFrom(value).buildPartial();
        } else {
          payloadType_ = value;
        }
        onChanged();
      } else {
        if (payloadTypeCase_ == 3) {
          appEngineHttpRequestBuilder_.mergeFrom(value);
        }
        appEngineHttpRequestBuilder_.setMessage(value);
      }
      payloadTypeCase_ = 3;
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public Builder clearAppEngineHttpRequest() {
      if (appEngineHttpRequestBuilder_ == null) {
        if (payloadTypeCase_ == 3) {
          payloadTypeCase_ = 0;
          payloadType_ = null;
          onChanged();
        }
      } else {
        if (payloadTypeCase_ == 3) {
          payloadTypeCase_ = 0;
          payloadType_ = null;
        }
        appEngineHttpRequestBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.Builder getAppEngineHttpRequestBuilder() {
      return getAppEngineHttpRequestFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    public com.google.cloud.tasks.v2beta3.AppEngineHttpRequestOrBuilder getAppEngineHttpRequestOrBuilder() {
      if ((payloadTypeCase_ == 3) && (appEngineHttpRequestBuilder_ != null)) {
        return appEngineHttpRequestBuilder_.getMessageOrBuilder();
      } else {
        if (payloadTypeCase_ == 3) {
          return (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_;
        }
        return com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
      }
    }
    /**
     * <pre>
     * App Engine HTTP request that is sent to the task's target. Can
     * be set only if
     * [app_engine_http_queue][google.cloud.tasks.v2beta3.Queue.app_engine_http_queue] is set
     * on the queue.
     * An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.AppEngineHttpRequest app_engine_http_request = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta3.AppEngineHttpRequest, com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.Builder, com.google.cloud.tasks.v2beta3.AppEngineHttpRequestOrBuilder> 
        getAppEngineHttpRequestFieldBuilder() {
      if (appEngineHttpRequestBuilder_ == null) {
        if (!(payloadTypeCase_ == 3)) {
          payloadType_ = com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.getDefaultInstance();
        }
        appEngineHttpRequestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta3.AppEngineHttpRequest, com.google.cloud.tasks.v2beta3.AppEngineHttpRequest.Builder, com.google.cloud.tasks.v2beta3.AppEngineHttpRequestOrBuilder>(
                (com.google.cloud.tasks.v2beta3.AppEngineHttpRequest) payloadType_,
                getParentForChildren(),
                isClean());
        payloadType_ = null;
      }
      payloadTypeCase_ = 3;
      onChanged();;
      return appEngineHttpRequestBuilder_;
    }

    private com.google.protobuf.Timestamp scheduleTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> scheduleTimeBuilder_;
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public boolean hasScheduleTime() {
      return scheduleTimeBuilder_ != null || scheduleTime_ != null;
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public com.google.protobuf.Timestamp getScheduleTime() {
      if (scheduleTimeBuilder_ == null) {
        return scheduleTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_;
      } else {
        return scheduleTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public Builder setScheduleTime(com.google.protobuf.Timestamp value) {
      if (scheduleTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        scheduleTime_ = value;
        onChanged();
      } else {
        scheduleTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public Builder setScheduleTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (scheduleTimeBuilder_ == null) {
        scheduleTime_ = builderForValue.build();
        onChanged();
      } else {
        scheduleTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public Builder mergeScheduleTime(com.google.protobuf.Timestamp value) {
      if (scheduleTimeBuilder_ == null) {
        if (scheduleTime_ != null) {
          scheduleTime_ =
            com.google.protobuf.Timestamp.newBuilder(scheduleTime_).mergeFrom(value).buildPartial();
        } else {
          scheduleTime_ = value;
        }
        onChanged();
      } else {
        scheduleTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public Builder clearScheduleTime() {
      if (scheduleTimeBuilder_ == null) {
        scheduleTime_ = null;
        onChanged();
      } else {
        scheduleTime_ = null;
        scheduleTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() {
      
      onChanged();
      return getScheduleTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() {
      if (scheduleTimeBuilder_ != null) {
        return scheduleTimeBuilder_.getMessageOrBuilder();
      } else {
        return scheduleTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : scheduleTime_;
      }
    }
    /**
     * <pre>
     * The time when the task is scheduled to be attempted.
     * For App Engine queues, this is when the task will be attempted or retried.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getScheduleTimeFieldBuilder() {
      if (scheduleTimeBuilder_ == null) {
        scheduleTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getScheduleTime(),
                getParentForChildren(),
                isClean());
        scheduleTime_ = null;
      }
      return scheduleTimeBuilder_;
    }

    private com.google.protobuf.Timestamp createTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_;
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public boolean hasCreateTime() {
      return createTimeBuilder_ != null || createTime_ != null;
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public com.google.protobuf.Timestamp getCreateTime() {
      if (createTimeBuilder_ == null) {
        return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
      } else {
        return createTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createTime_ = value;
        onChanged();
      } else {
        createTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public Builder setCreateTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (createTimeBuilder_ == null) {
        createTime_ = builderForValue.build();
        onChanged();
      } else {
        createTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (createTime_ != null) {
          createTime_ =
            com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial();
        } else {
          createTime_ = value;
        }
        onChanged();
      } else {
        createTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public Builder clearCreateTime() {
      if (createTimeBuilder_ == null) {
        createTime_ = null;
        onChanged();
      } else {
        createTime_ = null;
        createTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
      
      onChanged();
      return getCreateTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      if (createTimeBuilder_ != null) {
        return createTimeBuilder_.getMessageOrBuilder();
      } else {
        return createTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
      }
    }
    /**
     * <pre>
     * Output only. The time that the task was created.
     * `create_time` will be truncated to the nearest second.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getCreateTimeFieldBuilder() {
      if (createTimeBuilder_ == null) {
        createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getCreateTime(),
                getParentForChildren(),
                isClean());
        createTime_ = null;
      }
      return createTimeBuilder_;
    }

    private int dispatchCount_ ;
    /**
     * <pre>
     * Output only. The number of attempts dispatched.
     * This count includes tasks which have been dispatched but haven't
     * received a response.
     * </pre>
     *
     * <code>int32 dispatch_count = 6;</code>
     */
    public int getDispatchCount() {
      return dispatchCount_;
    }
    /**
     * <pre>
     * Output only. The number of attempts dispatched.
     * This count includes tasks which have been dispatched but haven't
     * received a response.
     * </pre>
     *
     * <code>int32 dispatch_count = 6;</code>
     */
    public Builder setDispatchCount(int value) {
      
      dispatchCount_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The number of attempts dispatched.
     * This count includes tasks which have been dispatched but haven't
     * received a response.
     * </pre>
     *
     * <code>int32 dispatch_count = 6;</code>
     */
    public Builder clearDispatchCount() {
      
      dispatchCount_ = 0;
      onChanged();
      return this;
    }

    private int responseCount_ ;
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * </pre>
     *
     * <code>int32 response_count = 7;</code>
     */
    public int getResponseCount() {
      return responseCount_;
    }
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * </pre>
     *
     * <code>int32 response_count = 7;</code>
     */
    public Builder setResponseCount(int value) {
      
      responseCount_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * </pre>
     *
     * <code>int32 response_count = 7;</code>
     */
    public Builder clearResponseCount() {
      
      responseCount_ = 0;
      onChanged();
      return this;
    }

    private com.google.cloud.tasks.v2beta3.Attempt firstAttempt_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder> firstAttemptBuilder_;
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public boolean hasFirstAttempt() {
      return firstAttemptBuilder_ != null || firstAttempt_ != null;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public com.google.cloud.tasks.v2beta3.Attempt getFirstAttempt() {
      if (firstAttemptBuilder_ == null) {
        return firstAttempt_ == null ? com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : firstAttempt_;
      } else {
        return firstAttemptBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public Builder setFirstAttempt(com.google.cloud.tasks.v2beta3.Attempt value) {
      if (firstAttemptBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        firstAttempt_ = value;
        onChanged();
      } else {
        firstAttemptBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public Builder setFirstAttempt(
        com.google.cloud.tasks.v2beta3.Attempt.Builder builderForValue) {
      if (firstAttemptBuilder_ == null) {
        firstAttempt_ = builderForValue.build();
        onChanged();
      } else {
        firstAttemptBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public Builder mergeFirstAttempt(com.google.cloud.tasks.v2beta3.Attempt value) {
      if (firstAttemptBuilder_ == null) {
        if (firstAttempt_ != null) {
          firstAttempt_ =
            com.google.cloud.tasks.v2beta3.Attempt.newBuilder(firstAttempt_).mergeFrom(value).buildPartial();
        } else {
          firstAttempt_ = value;
        }
        onChanged();
      } else {
        firstAttemptBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public Builder clearFirstAttempt() {
      if (firstAttemptBuilder_ == null) {
        firstAttempt_ = null;
        onChanged();
      } else {
        firstAttempt_ = null;
        firstAttemptBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public com.google.cloud.tasks.v2beta3.Attempt.Builder getFirstAttemptBuilder() {
      
      onChanged();
      return getFirstAttemptFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    public com.google.cloud.tasks.v2beta3.AttemptOrBuilder getFirstAttemptOrBuilder() {
      if (firstAttemptBuilder_ != null) {
        return firstAttemptBuilder_.getMessageOrBuilder();
      } else {
        return firstAttempt_ == null ?
            com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : firstAttempt_;
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set.
     * The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt first_attempt = 8;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder> 
        getFirstAttemptFieldBuilder() {
      if (firstAttemptBuilder_ == null) {
        firstAttemptBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder>(
                getFirstAttempt(),
                getParentForChildren(),
                isClean());
        firstAttempt_ = null;
      }
      return firstAttemptBuilder_;
    }

    private com.google.cloud.tasks.v2beta3.Attempt lastAttempt_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder> lastAttemptBuilder_;
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public boolean hasLastAttempt() {
      return lastAttemptBuilder_ != null || lastAttempt_ != null;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public com.google.cloud.tasks.v2beta3.Attempt getLastAttempt() {
      if (lastAttemptBuilder_ == null) {
        return lastAttempt_ == null ? com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : lastAttempt_;
      } else {
        return lastAttemptBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public Builder setLastAttempt(com.google.cloud.tasks.v2beta3.Attempt value) {
      if (lastAttemptBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastAttempt_ = value;
        onChanged();
      } else {
        lastAttemptBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public Builder setLastAttempt(
        com.google.cloud.tasks.v2beta3.Attempt.Builder builderForValue) {
      if (lastAttemptBuilder_ == null) {
        lastAttempt_ = builderForValue.build();
        onChanged();
      } else {
        lastAttemptBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public Builder mergeLastAttempt(com.google.cloud.tasks.v2beta3.Attempt value) {
      if (lastAttemptBuilder_ == null) {
        if (lastAttempt_ != null) {
          lastAttempt_ =
            com.google.cloud.tasks.v2beta3.Attempt.newBuilder(lastAttempt_).mergeFrom(value).buildPartial();
        } else {
          lastAttempt_ = value;
        }
        onChanged();
      } else {
        lastAttemptBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public Builder clearLastAttempt() {
      if (lastAttemptBuilder_ == null) {
        lastAttempt_ = null;
        onChanged();
      } else {
        lastAttempt_ = null;
        lastAttemptBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public com.google.cloud.tasks.v2beta3.Attempt.Builder getLastAttemptBuilder() {
      
      onChanged();
      return getLastAttemptFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    public com.google.cloud.tasks.v2beta3.AttemptOrBuilder getLastAttemptOrBuilder() {
      if (lastAttemptBuilder_ != null) {
        return lastAttemptBuilder_.getMessageOrBuilder();
      } else {
        return lastAttempt_ == null ?
            com.google.cloud.tasks.v2beta3.Attempt.getDefaultInstance() : lastAttempt_;
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Attempt last_attempt = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder> 
        getLastAttemptFieldBuilder() {
      if (lastAttemptBuilder_ == null) {
        lastAttemptBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta3.Attempt, com.google.cloud.tasks.v2beta3.Attempt.Builder, com.google.cloud.tasks.v2beta3.AttemptOrBuilder>(
                getLastAttempt(),
                getParentForChildren(),
                isClean());
        lastAttempt_ = null;
      }
      return lastAttemptBuilder_;
    }

    private int view_ = 0;
    /**
     * <pre>
     * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
     * been returned.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
     */
    public int getViewValue() {
      return view_;
    }
    /**
     * <pre>
     * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
     * been returned.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
     */
    public Builder setViewValue(int value) {
      view_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
     * been returned.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
     */
    public com.google.cloud.tasks.v2beta3.Task.View getView() {
      @SuppressWarnings("deprecation")
      com.google.cloud.tasks.v2beta3.Task.View result = com.google.cloud.tasks.v2beta3.Task.View.valueOf(view_);
      return result == null ? com.google.cloud.tasks.v2beta3.Task.View.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
     * been returned.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
     */
    public Builder setView(com.google.cloud.tasks.v2beta3.Task.View value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      view_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has
     * been returned.
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta3.Task.View view = 10;</code>
     */
    public Builder clearView() {
      
      view_ = 0;
      onChanged();
      return this;
    }
    @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.v2beta3.Task)
  }

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

  public static com.google.cloud.tasks.v2beta3.Task getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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

}

