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

package com.google.cloud.tasks.v2beta2;

/**
 *
 *
 * <pre>
 * The status of a task attempt.
 * </pre>
 *
 * Protobuf type {@code google.cloud.tasks.v2beta2.AttemptStatus}
 */
public final class AttemptStatus extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.tasks.v2beta2.AttemptStatus)
    AttemptStatusOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use AttemptStatus.newBuilder() to construct.
  private AttemptStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private AttemptStatus() {}

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private AttemptStatus(
      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:
            {
              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 18:
            {
              com.google.protobuf.Timestamp.Builder subBuilder = null;
              if (dispatchTime_ != null) {
                subBuilder = dispatchTime_.toBuilder();
              }
              dispatchTime_ =
                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(dispatchTime_);
                dispatchTime_ = subBuilder.buildPartial();
              }

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

              break;
            }
          case 34:
            {
              com.google.rpc.Status.Builder subBuilder = null;
              if (responseStatus_ != null) {
                subBuilder = responseStatus_.toBuilder();
              }
              responseStatus_ =
                  input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(responseStatus_);
                responseStatus_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(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_AttemptStatus_descriptor;
  }

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

  public static final int SCHEDULE_TIME_FIELD_NUMBER = 1;
  private com.google.protobuf.Timestamp scheduleTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was scheduled.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
   */
  public boolean hasScheduleTime() {
    return scheduleTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was scheduled.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
   */
  public com.google.protobuf.Timestamp getScheduleTime() {
    return scheduleTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : scheduleTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was scheduled.
   * `schedule_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() {
    return getScheduleTime();
  }

  public static final int DISPATCH_TIME_FIELD_NUMBER = 2;
  private com.google.protobuf.Timestamp dispatchTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was dispatched.
   * `dispatch_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
   */
  public boolean hasDispatchTime() {
    return dispatchTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was dispatched.
   * `dispatch_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
   */
  public com.google.protobuf.Timestamp getDispatchTime() {
    return dispatchTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : dispatchTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt was dispatched.
   * `dispatch_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getDispatchTimeOrBuilder() {
    return getDispatchTime();
  }

  public static final int RESPONSE_TIME_FIELD_NUMBER = 3;
  private com.google.protobuf.Timestamp responseTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt response was received.
   * `response_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp response_time = 3;</code>
   */
  public boolean hasResponseTime() {
    return responseTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt response was received.
   * `response_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp response_time = 3;</code>
   */
  public com.google.protobuf.Timestamp getResponseTime() {
    return responseTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : responseTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time that this attempt response was received.
   * `response_time` will be truncated to the nearest microsecond.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp response_time = 3;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() {
    return getResponseTime();
  }

  public static final int RESPONSE_STATUS_FIELD_NUMBER = 4;
  private com.google.rpc.Status responseStatus_;
  /**
   *
   *
   * <pre>
   * Output only. The response from the target for this attempt.
   * If the task has not been attempted or the task is currently running
   * then the response status is unset.
   * </pre>
   *
   * <code>.google.rpc.Status response_status = 4;</code>
   */
  public boolean hasResponseStatus() {
    return responseStatus_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The response from the target for this attempt.
   * If the task has not been attempted or the task is currently running
   * then the response status is unset.
   * </pre>
   *
   * <code>.google.rpc.Status response_status = 4;</code>
   */
  public com.google.rpc.Status getResponseStatus() {
    return responseStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : responseStatus_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The response from the target for this attempt.
   * If the task has not been attempted or the task is currently running
   * then the response status is unset.
   * </pre>
   *
   * <code>.google.rpc.Status response_status = 4;</code>
   */
  public com.google.rpc.StatusOrBuilder getResponseStatusOrBuilder() {
    return getResponseStatus();
  }

  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 (scheduleTime_ != null) {
      output.writeMessage(1, getScheduleTime());
    }
    if (dispatchTime_ != null) {
      output.writeMessage(2, getDispatchTime());
    }
    if (responseTime_ != null) {
      output.writeMessage(3, getResponseTime());
    }
    if (responseStatus_ != null) {
      output.writeMessage(4, getResponseStatus());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (scheduleTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getScheduleTime());
    }
    if (dispatchTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDispatchTime());
    }
    if (responseTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResponseTime());
    }
    if (responseStatus_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getResponseStatus());
    }
    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.AttemptStatus)) {
      return super.equals(obj);
    }
    com.google.cloud.tasks.v2beta2.AttemptStatus other =
        (com.google.cloud.tasks.v2beta2.AttemptStatus) obj;

    if (hasScheduleTime() != other.hasScheduleTime()) return false;
    if (hasScheduleTime()) {
      if (!getScheduleTime().equals(other.getScheduleTime())) return false;
    }
    if (hasDispatchTime() != other.hasDispatchTime()) return false;
    if (hasDispatchTime()) {
      if (!getDispatchTime().equals(other.getDispatchTime())) return false;
    }
    if (hasResponseTime() != other.hasResponseTime()) return false;
    if (hasResponseTime()) {
      if (!getResponseTime().equals(other.getResponseTime())) return false;
    }
    if (hasResponseStatus() != other.hasResponseStatus()) return false;
    if (hasResponseStatus()) {
      if (!getResponseStatus().equals(other.getResponseStatus())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasScheduleTime()) {
      hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getScheduleTime().hashCode();
    }
    if (hasDispatchTime()) {
      hash = (37 * hash) + DISPATCH_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getDispatchTime().hashCode();
    }
    if (hasResponseTime()) {
      hash = (37 * hash) + RESPONSE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getResponseTime().hashCode();
    }
    if (hasResponseStatus()) {
      hash = (37 * hash) + RESPONSE_STATUS_FIELD_NUMBER;
      hash = (53 * hash) + getResponseStatus().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus 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.AttemptStatus parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus 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.AttemptStatus parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus 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.AttemptStatus parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus 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.AttemptStatus parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.tasks.v2beta2.AttemptStatus 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.AttemptStatus 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.AttemptStatus 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.AttemptStatus 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>
   * The status of a task attempt.
   * </pre>
   *
   * Protobuf type {@code google.cloud.tasks.v2beta2.AttemptStatus}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.tasks.v2beta2.AttemptStatus)
      com.google.cloud.tasks.v2beta2.AttemptStatusOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.tasks.v2beta2.TaskProto
          .internal_static_google_cloud_tasks_v2beta2_AttemptStatus_descriptor;
    }

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

    // Construct using com.google.cloud.tasks.v2beta2.AttemptStatus.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();
      if (scheduleTimeBuilder_ == null) {
        scheduleTime_ = null;
      } else {
        scheduleTime_ = null;
        scheduleTimeBuilder_ = null;
      }
      if (dispatchTimeBuilder_ == null) {
        dispatchTime_ = null;
      } else {
        dispatchTime_ = null;
        dispatchTimeBuilder_ = null;
      }
      if (responseTimeBuilder_ == null) {
        responseTime_ = null;
      } else {
        responseTime_ = null;
        responseTimeBuilder_ = null;
      }
      if (responseStatusBuilder_ == null) {
        responseStatus_ = null;
      } else {
        responseStatus_ = null;
        responseStatusBuilder_ = 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_AttemptStatus_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.tasks.v2beta2.AttemptStatus buildPartial() {
      com.google.cloud.tasks.v2beta2.AttemptStatus result =
          new com.google.cloud.tasks.v2beta2.AttemptStatus(this);
      if (scheduleTimeBuilder_ == null) {
        result.scheduleTime_ = scheduleTime_;
      } else {
        result.scheduleTime_ = scheduleTimeBuilder_.build();
      }
      if (dispatchTimeBuilder_ == null) {
        result.dispatchTime_ = dispatchTime_;
      } else {
        result.dispatchTime_ = dispatchTimeBuilder_.build();
      }
      if (responseTimeBuilder_ == null) {
        result.responseTime_ = responseTime_;
      } else {
        result.responseTime_ = responseTimeBuilder_.build();
      }
      if (responseStatusBuilder_ == null) {
        result.responseStatus_ = responseStatus_;
      } else {
        result.responseStatus_ = responseStatusBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.tasks.v2beta2.AttemptStatus) {
        return mergeFrom((com.google.cloud.tasks.v2beta2.AttemptStatus) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.tasks.v2beta2.AttemptStatus other) {
      if (other == com.google.cloud.tasks.v2beta2.AttemptStatus.getDefaultInstance()) return this;
      if (other.hasScheduleTime()) {
        mergeScheduleTime(other.getScheduleTime());
      }
      if (other.hasDispatchTime()) {
        mergeDispatchTime(other.getDispatchTime());
      }
      if (other.hasResponseTime()) {
        mergeResponseTime(other.getResponseTime());
      }
      if (other.hasResponseStatus()) {
        mergeResponseStatus(other.getResponseStatus());
      }
      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.AttemptStatus parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.tasks.v2beta2.AttemptStatus) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.protobuf.Timestamp scheduleTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        scheduleTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
     */
    public boolean hasScheduleTime() {
      return scheduleTimeBuilder_ != null || scheduleTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
     */
    public com.google.protobuf.Timestamp getScheduleTime() {
      if (scheduleTimeBuilder_ == null) {
        return scheduleTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : scheduleTime_;
      } else {
        return scheduleTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</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>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</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>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</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>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
     */
    public Builder clearScheduleTime() {
      if (scheduleTimeBuilder_ == null) {
        scheduleTime_ = null;
        onChanged();
      } else {
        scheduleTime_ = null;
        scheduleTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
     */
    public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() {

      onChanged();
      return getScheduleTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() {
      if (scheduleTimeBuilder_ != null) {
        return scheduleTimeBuilder_.getMessageOrBuilder();
      } else {
        return scheduleTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : scheduleTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was scheduled.
     * `schedule_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp schedule_time = 1;</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 dispatchTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        dispatchTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public boolean hasDispatchTime() {
      return dispatchTimeBuilder_ != null || dispatchTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public com.google.protobuf.Timestamp getDispatchTime() {
      if (dispatchTimeBuilder_ == null) {
        return dispatchTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : dispatchTime_;
      } else {
        return dispatchTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public Builder setDispatchTime(com.google.protobuf.Timestamp value) {
      if (dispatchTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        dispatchTime_ = value;
        onChanged();
      } else {
        dispatchTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public Builder setDispatchTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (dispatchTimeBuilder_ == null) {
        dispatchTime_ = builderForValue.build();
        onChanged();
      } else {
        dispatchTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public Builder mergeDispatchTime(com.google.protobuf.Timestamp value) {
      if (dispatchTimeBuilder_ == null) {
        if (dispatchTime_ != null) {
          dispatchTime_ =
              com.google.protobuf.Timestamp.newBuilder(dispatchTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          dispatchTime_ = value;
        }
        onChanged();
      } else {
        dispatchTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public Builder clearDispatchTime() {
      if (dispatchTimeBuilder_ == null) {
        dispatchTime_ = null;
        onChanged();
      } else {
        dispatchTime_ = null;
        dispatchTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public com.google.protobuf.Timestamp.Builder getDispatchTimeBuilder() {

      onChanged();
      return getDispatchTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getDispatchTimeOrBuilder() {
      if (dispatchTimeBuilder_ != null) {
        return dispatchTimeBuilder_.getMessageOrBuilder();
      } else {
        return dispatchTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : dispatchTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt was dispatched.
     * `dispatch_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp dispatch_time = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getDispatchTimeFieldBuilder() {
      if (dispatchTimeBuilder_ == null) {
        dispatchTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getDispatchTime(), getParentForChildren(), isClean());
        dispatchTime_ = null;
      }
      return dispatchTimeBuilder_;
    }

    private com.google.protobuf.Timestamp responseTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        responseTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public boolean hasResponseTime() {
      return responseTimeBuilder_ != null || responseTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public com.google.protobuf.Timestamp getResponseTime() {
      if (responseTimeBuilder_ == null) {
        return responseTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : responseTime_;
      } else {
        return responseTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public Builder setResponseTime(com.google.protobuf.Timestamp value) {
      if (responseTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        responseTime_ = value;
        onChanged();
      } else {
        responseTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public Builder setResponseTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (responseTimeBuilder_ == null) {
        responseTime_ = builderForValue.build();
        onChanged();
      } else {
        responseTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public Builder mergeResponseTime(com.google.protobuf.Timestamp value) {
      if (responseTimeBuilder_ == null) {
        if (responseTime_ != null) {
          responseTime_ =
              com.google.protobuf.Timestamp.newBuilder(responseTime_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          responseTime_ = value;
        }
        onChanged();
      } else {
        responseTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public Builder clearResponseTime() {
      if (responseTimeBuilder_ == null) {
        responseTime_ = null;
        onChanged();
      } else {
        responseTime_ = null;
        responseTimeBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public com.google.protobuf.Timestamp.Builder getResponseTimeBuilder() {

      onChanged();
      return getResponseTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getResponseTimeOrBuilder() {
      if (responseTimeBuilder_ != null) {
        return responseTimeBuilder_.getMessageOrBuilder();
      } else {
        return responseTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : responseTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time that this attempt response was received.
     * `response_time` will be truncated to the nearest microsecond.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp response_time = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getResponseTimeFieldBuilder() {
      if (responseTimeBuilder_ == null) {
        responseTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getResponseTime(), getParentForChildren(), isClean());
        responseTime_ = null;
      }
      return responseTimeBuilder_;
    }

    private com.google.rpc.Status responseStatus_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        responseStatusBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public boolean hasResponseStatus() {
      return responseStatusBuilder_ != null || responseStatus_ != null;
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public com.google.rpc.Status getResponseStatus() {
      if (responseStatusBuilder_ == null) {
        return responseStatus_ == null
            ? com.google.rpc.Status.getDefaultInstance()
            : responseStatus_;
      } else {
        return responseStatusBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public Builder setResponseStatus(com.google.rpc.Status value) {
      if (responseStatusBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        responseStatus_ = value;
        onChanged();
      } else {
        responseStatusBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public Builder setResponseStatus(com.google.rpc.Status.Builder builderForValue) {
      if (responseStatusBuilder_ == null) {
        responseStatus_ = builderForValue.build();
        onChanged();
      } else {
        responseStatusBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public Builder mergeResponseStatus(com.google.rpc.Status value) {
      if (responseStatusBuilder_ == null) {
        if (responseStatus_ != null) {
          responseStatus_ =
              com.google.rpc.Status.newBuilder(responseStatus_).mergeFrom(value).buildPartial();
        } else {
          responseStatus_ = value;
        }
        onChanged();
      } else {
        responseStatusBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public Builder clearResponseStatus() {
      if (responseStatusBuilder_ == null) {
        responseStatus_ = null;
        onChanged();
      } else {
        responseStatus_ = null;
        responseStatusBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public com.google.rpc.Status.Builder getResponseStatusBuilder() {

      onChanged();
      return getResponseStatusFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    public com.google.rpc.StatusOrBuilder getResponseStatusOrBuilder() {
      if (responseStatusBuilder_ != null) {
        return responseStatusBuilder_.getMessageOrBuilder();
      } else {
        return responseStatus_ == null
            ? com.google.rpc.Status.getDefaultInstance()
            : responseStatus_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The response from the target for this attempt.
     * If the task has not been attempted or the task is currently running
     * then the response status is unset.
     * </pre>
     *
     * <code>.google.rpc.Status response_status = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
        getResponseStatusFieldBuilder() {
      if (responseStatusBuilder_ == null) {
        responseStatusBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.rpc.Status,
                com.google.rpc.Status.Builder,
                com.google.rpc.StatusOrBuilder>(
                getResponseStatus(), getParentForChildren(), isClean());
        responseStatus_ = null;
      }
      return responseStatusBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(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.AttemptStatus)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.tasks.v2beta2.AttemptStatus)
  private static final com.google.cloud.tasks.v2beta2.AttemptStatus DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.tasks.v2beta2.AttemptStatus();
  }

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

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

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

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

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