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

package com.google.cloud.tasks.v2beta2;

/**
 * <pre>
 * Status of the task.
 * </pre>
 *
 * Protobuf type {@code google.cloud.tasks.v2beta2.TaskStatus}
 */
public  final class TaskStatus extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta2.TaskStatus)
    TaskStatusOrBuilder {
private static final long serialVersionUID = 0L;
  // Use TaskStatus.newBuilder() to construct.
  private TaskStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private TaskStatus() {
    attemptDispatchCount_ = 0;
    attemptResponseCount_ = 0;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private TaskStatus(
      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 8: {

            attemptDispatchCount_ = input.readInt32();
            break;
          }
          case 16: {

            attemptResponseCount_ = input.readInt32();
            break;
          }
          case 26: {
            com.google.cloud.tasks.v2beta2.AttemptStatus.Builder subBuilder = null;
            if (firstAttemptStatus_ != null) {
              subBuilder = firstAttemptStatus_.toBuilder();
            }
            firstAttemptStatus_ = input.readMessage(com.google.cloud.tasks.v2beta2.AttemptStatus.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(firstAttemptStatus_);
              firstAttemptStatus_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            com.google.cloud.tasks.v2beta2.AttemptStatus.Builder subBuilder = null;
            if (lastAttemptStatus_ != null) {
              subBuilder = lastAttemptStatus_.toBuilder();
            }
            lastAttemptStatus_ = input.readMessage(com.google.cloud.tasks.v2beta2.AttemptStatus.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(lastAttemptStatus_);
              lastAttemptStatus_ = 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.TaskProto.internal_static_google_cloud_tasks_v2beta2_TaskStatus_descriptor;
  }

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

  public static final int ATTEMPT_DISPATCH_COUNT_FIELD_NUMBER = 1;
  private int attemptDispatchCount_;
  /**
   * <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 attempt_dispatch_count = 1;</code>
   */
  public int getAttemptDispatchCount() {
    return attemptDispatchCount_;
  }

  public static final int ATTEMPT_RESPONSE_COUNT_FIELD_NUMBER = 2;
  private int attemptResponseCount_;
  /**
   * <pre>
   * Output only. The number of attempts which have received a response.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>int32 attempt_response_count = 2;</code>
   */
  public int getAttemptResponseCount() {
    return attemptResponseCount_;
  }

  public static final int FIRST_ATTEMPT_STATUS_FIELD_NUMBER = 3;
  private com.google.cloud.tasks.v2beta2.AttemptStatus firstAttemptStatus_;
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
   * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
   */
  public boolean hasFirstAttemptStatus() {
    return firstAttemptStatus_ != null;
  }
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
   * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
   */
  public com.google.cloud.tasks.v2beta2.AttemptStatus getFirstAttemptStatus() {
    return firstAttemptStatus_ == null ? com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : firstAttemptStatus_;
  }
  /**
   * <pre>
   * Output only. The status of the task's first attempt.
   * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
   * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
   */
  public com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder getFirstAttemptStatusOrBuilder() {
    return getFirstAttemptStatus();
  }

  public static final int LAST_ATTEMPT_STATUS_FIELD_NUMBER = 4;
  private com.google.cloud.tasks.v2beta2.AttemptStatus lastAttemptStatus_;
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
   */
  public boolean hasLastAttemptStatus() {
    return lastAttemptStatus_ != null;
  }
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
   */
  public com.google.cloud.tasks.v2beta2.AttemptStatus getLastAttemptStatus() {
    return lastAttemptStatus_ == null ? com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : lastAttemptStatus_;
  }
  /**
   * <pre>
   * Output only. The status of the task's last attempt.
   * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
   * </pre>
   *
   * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
   */
  public com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder getLastAttemptStatusOrBuilder() {
    return getLastAttemptStatus();
  }

  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 (attemptDispatchCount_ != 0) {
      output.writeInt32(1, attemptDispatchCount_);
    }
    if (attemptResponseCount_ != 0) {
      output.writeInt32(2, attemptResponseCount_);
    }
    if (firstAttemptStatus_ != null) {
      output.writeMessage(3, getFirstAttemptStatus());
    }
    if (lastAttemptStatus_ != null) {
      output.writeMessage(4, getLastAttemptStatus());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (attemptDispatchCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(1, attemptDispatchCount_);
    }
    if (attemptResponseCount_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, attemptResponseCount_);
    }
    if (firstAttemptStatus_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getFirstAttemptStatus());
    }
    if (lastAttemptStatus_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getLastAttemptStatus());
    }
    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.TaskStatus)) {
      return super.equals(obj);
    }
    com.google.cloud.tasks.v2beta2.TaskStatus other = (com.google.cloud.tasks.v2beta2.TaskStatus) obj;

    boolean result = true;
    result = result && (getAttemptDispatchCount()
        == other.getAttemptDispatchCount());
    result = result && (getAttemptResponseCount()
        == other.getAttemptResponseCount());
    result = result && (hasFirstAttemptStatus() == other.hasFirstAttemptStatus());
    if (hasFirstAttemptStatus()) {
      result = result && getFirstAttemptStatus()
          .equals(other.getFirstAttemptStatus());
    }
    result = result && (hasLastAttemptStatus() == other.hasLastAttemptStatus());
    if (hasLastAttemptStatus()) {
      result = result && getLastAttemptStatus()
          .equals(other.getLastAttemptStatus());
    }
    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) + ATTEMPT_DISPATCH_COUNT_FIELD_NUMBER;
    hash = (53 * hash) + getAttemptDispatchCount();
    hash = (37 * hash) + ATTEMPT_RESPONSE_COUNT_FIELD_NUMBER;
    hash = (53 * hash) + getAttemptResponseCount();
    if (hasFirstAttemptStatus()) {
      hash = (37 * hash) + FIRST_ATTEMPT_STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getFirstAttemptStatus().hashCode();
    }
    if (hasLastAttemptStatus()) {
      hash = (37 * hash) + LAST_ATTEMPT_STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getLastAttemptStatus().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.tasks.v2beta2.TaskStatus parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.TaskStatus 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.TaskStatus parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.TaskStatus 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.TaskStatus parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.tasks.v2beta2.TaskStatus 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.TaskStatus parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta2.TaskStatus 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.TaskStatus parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.tasks.v2beta2.TaskStatus 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.TaskStatus 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.TaskStatus 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.TaskStatus 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>
   * Status of the task.
   * </pre>
   *
   * Protobuf type {@code google.cloud.tasks.v2beta2.TaskStatus}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta2.TaskStatus)
      com.google.cloud.tasks.v2beta2.TaskStatusOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.tasks.v2beta2.TaskProto.internal_static_google_cloud_tasks_v2beta2_TaskStatus_descriptor;
    }

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

    // Construct using com.google.cloud.tasks.v2beta2.TaskStatus.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();
      attemptDispatchCount_ = 0;

      attemptResponseCount_ = 0;

      if (firstAttemptStatusBuilder_ == null) {
        firstAttemptStatus_ = null;
      } else {
        firstAttemptStatus_ = null;
        firstAttemptStatusBuilder_ = null;
      }
      if (lastAttemptStatusBuilder_ == null) {
        lastAttemptStatus_ = null;
      } else {
        lastAttemptStatus_ = null;
        lastAttemptStatusBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.tasks.v2beta2.TaskStatus buildPartial() {
      com.google.cloud.tasks.v2beta2.TaskStatus result = new com.google.cloud.tasks.v2beta2.TaskStatus(this);
      result.attemptDispatchCount_ = attemptDispatchCount_;
      result.attemptResponseCount_ = attemptResponseCount_;
      if (firstAttemptStatusBuilder_ == null) {
        result.firstAttemptStatus_ = firstAttemptStatus_;
      } else {
        result.firstAttemptStatus_ = firstAttemptStatusBuilder_.build();
      }
      if (lastAttemptStatusBuilder_ == null) {
        result.lastAttemptStatus_ = lastAttemptStatus_;
      } else {
        result.lastAttemptStatus_ = lastAttemptStatusBuilder_.build();
      }
      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.TaskStatus) {
        return mergeFrom((com.google.cloud.tasks.v2beta2.TaskStatus)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.tasks.v2beta2.TaskStatus other) {
      if (other == com.google.cloud.tasks.v2beta2.TaskStatus.getDefaultInstance()) return this;
      if (other.getAttemptDispatchCount() != 0) {
        setAttemptDispatchCount(other.getAttemptDispatchCount());
      }
      if (other.getAttemptResponseCount() != 0) {
        setAttemptResponseCount(other.getAttemptResponseCount());
      }
      if (other.hasFirstAttemptStatus()) {
        mergeFirstAttemptStatus(other.getFirstAttemptStatus());
      }
      if (other.hasLastAttemptStatus()) {
        mergeLastAttemptStatus(other.getLastAttemptStatus());
      }
      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.TaskStatus parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.tasks.v2beta2.TaskStatus) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int attemptDispatchCount_ ;
    /**
     * <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 attempt_dispatch_count = 1;</code>
     */
    public int getAttemptDispatchCount() {
      return attemptDispatchCount_;
    }
    /**
     * <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 attempt_dispatch_count = 1;</code>
     */
    public Builder setAttemptDispatchCount(int value) {
      
      attemptDispatchCount_ = 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 attempt_dispatch_count = 1;</code>
     */
    public Builder clearAttemptDispatchCount() {
      
      attemptDispatchCount_ = 0;
      onChanged();
      return this;
    }

    private int attemptResponseCount_ ;
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>int32 attempt_response_count = 2;</code>
     */
    public int getAttemptResponseCount() {
      return attemptResponseCount_;
    }
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>int32 attempt_response_count = 2;</code>
     */
    public Builder setAttemptResponseCount(int value) {
      
      attemptResponseCount_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The number of attempts which have received a response.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>int32 attempt_response_count = 2;</code>
     */
    public Builder clearAttemptResponseCount() {
      
      attemptResponseCount_ = 0;
      onChanged();
      return this;
    }

    private com.google.cloud.tasks.v2beta2.AttemptStatus firstAttemptStatus_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder> firstAttemptStatusBuilder_;
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public boolean hasFirstAttemptStatus() {
      return firstAttemptStatusBuilder_ != null || firstAttemptStatus_ != null;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatus getFirstAttemptStatus() {
      if (firstAttemptStatusBuilder_ == null) {
        return firstAttemptStatus_ == null ? com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : firstAttemptStatus_;
      } else {
        return firstAttemptStatusBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public Builder setFirstAttemptStatus(com.google.cloud.tasks.v2beta2.AttemptStatus value) {
      if (firstAttemptStatusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        firstAttemptStatus_ = value;
        onChanged();
      } else {
        firstAttemptStatusBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public Builder setFirstAttemptStatus(
        com.google.cloud.tasks.v2beta2.AttemptStatus.Builder builderForValue) {
      if (firstAttemptStatusBuilder_ == null) {
        firstAttemptStatus_ = builderForValue.build();
        onChanged();
      } else {
        firstAttemptStatusBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public Builder mergeFirstAttemptStatus(com.google.cloud.tasks.v2beta2.AttemptStatus value) {
      if (firstAttemptStatusBuilder_ == null) {
        if (firstAttemptStatus_ != null) {
          firstAttemptStatus_ =
            com.google.cloud.tasks.v2beta2.AttemptStatus.newBuilder(firstAttemptStatus_).mergeFrom(value).buildPartial();
        } else {
          firstAttemptStatus_ = value;
        }
        onChanged();
      } else {
        firstAttemptStatusBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public Builder clearFirstAttemptStatus() {
      if (firstAttemptStatusBuilder_ == null) {
        firstAttemptStatus_ = null;
        onChanged();
      } else {
        firstAttemptStatus_ = null;
        firstAttemptStatusBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatus.Builder getFirstAttemptStatusBuilder() {
      
      onChanged();
      return getFirstAttemptStatusFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder getFirstAttemptStatusOrBuilder() {
      if (firstAttemptStatusBuilder_ != null) {
        return firstAttemptStatusBuilder_.getMessageOrBuilder();
      } else {
        return firstAttemptStatus_ == null ?
            com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : firstAttemptStatus_;
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's first attempt.
     * Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set.
     * The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus first_attempt_status = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder> 
        getFirstAttemptStatusFieldBuilder() {
      if (firstAttemptStatusBuilder_ == null) {
        firstAttemptStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder>(
                getFirstAttemptStatus(),
                getParentForChildren(),
                isClean());
        firstAttemptStatus_ = null;
      }
      return firstAttemptStatusBuilder_;
    }

    private com.google.cloud.tasks.v2beta2.AttemptStatus lastAttemptStatus_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder> lastAttemptStatusBuilder_;
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public boolean hasLastAttemptStatus() {
      return lastAttemptStatusBuilder_ != null || lastAttemptStatus_ != null;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatus getLastAttemptStatus() {
      if (lastAttemptStatusBuilder_ == null) {
        return lastAttemptStatus_ == null ? com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : lastAttemptStatus_;
      } else {
        return lastAttemptStatusBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public Builder setLastAttemptStatus(com.google.cloud.tasks.v2beta2.AttemptStatus value) {
      if (lastAttemptStatusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lastAttemptStatus_ = value;
        onChanged();
      } else {
        lastAttemptStatusBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public Builder setLastAttemptStatus(
        com.google.cloud.tasks.v2beta2.AttemptStatus.Builder builderForValue) {
      if (lastAttemptStatusBuilder_ == null) {
        lastAttemptStatus_ = builderForValue.build();
        onChanged();
      } else {
        lastAttemptStatusBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public Builder mergeLastAttemptStatus(com.google.cloud.tasks.v2beta2.AttemptStatus value) {
      if (lastAttemptStatusBuilder_ == null) {
        if (lastAttemptStatus_ != null) {
          lastAttemptStatus_ =
            com.google.cloud.tasks.v2beta2.AttemptStatus.newBuilder(lastAttemptStatus_).mergeFrom(value).buildPartial();
        } else {
          lastAttemptStatus_ = value;
        }
        onChanged();
      } else {
        lastAttemptStatusBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public Builder clearLastAttemptStatus() {
      if (lastAttemptStatusBuilder_ == null) {
        lastAttemptStatus_ = null;
        onChanged();
      } else {
        lastAttemptStatus_ = null;
        lastAttemptStatusBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatus.Builder getLastAttemptStatusBuilder() {
      
      onChanged();
      return getLastAttemptStatusFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    public com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder getLastAttemptStatusOrBuilder() {
      if (lastAttemptStatusBuilder_ != null) {
        return lastAttemptStatusBuilder_.getMessageOrBuilder();
      } else {
        return lastAttemptStatus_ == null ?
            com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance() : lastAttemptStatus_;
      }
    }
    /**
     * <pre>
     * Output only. The status of the task's last attempt.
     * This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage].
     * </pre>
     *
     * <code>.google.cloud.tasks.v2beta2.AttemptStatus last_attempt_status = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder> 
        getLastAttemptStatusFieldBuilder() {
      if (lastAttemptStatusBuilder_ == null) {
        lastAttemptStatusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.tasks.v2beta2.AttemptStatus, com.google.cloud.tasks.v2beta2.AttemptStatus.Builder, com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder>(
                getLastAttemptStatus(),
                getParentForChildren(),
                isClean());
        lastAttemptStatus_ = null;
      }
      return lastAttemptStatusBuilder_;
    }
    @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.TaskStatus)
  }

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

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

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

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

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

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

}

