/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/compute/v1/compute.proto

package com.google.cloud.compute.v1;

/**
 *
 *
 * <pre>
 * </pre>
 *
 * Protobuf type {@code google.cloud.compute.v1.DiskAsyncReplication}
 */
public final class DiskAsyncReplication extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.DiskAsyncReplication)
    DiskAsyncReplicationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use DiskAsyncReplication.newBuilder() to construct.
  private DiskAsyncReplication(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private DiskAsyncReplication() {
    consistencyGroupPolicy_ = "";
    consistencyGroupPolicyId_ = "";
    disk_ = "";
    diskId_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new DiskAsyncReplication();
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_DiskAsyncReplication_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_DiskAsyncReplication_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.compute.v1.DiskAsyncReplication.class,
            com.google.cloud.compute.v1.DiskAsyncReplication.Builder.class);
  }

  private int bitField0_;
  public static final int CONSISTENCY_GROUP_POLICY_FIELD_NUMBER = 1991097;

  @SuppressWarnings("serial")
  private volatile java.lang.Object consistencyGroupPolicy_ = "";
  /**
   *
   *
   * <pre>
   * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy = 1991097;</code>
   *
   * @return Whether the consistencyGroupPolicy field is set.
   */
  @java.lang.Override
  public boolean hasConsistencyGroupPolicy() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   * <pre>
   * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy = 1991097;</code>
   *
   * @return The consistencyGroupPolicy.
   */
  @java.lang.Override
  public java.lang.String getConsistencyGroupPolicy() {
    java.lang.Object ref = consistencyGroupPolicy_;
    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();
      consistencyGroupPolicy_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy = 1991097;</code>
   *
   * @return The bytes for consistencyGroupPolicy.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getConsistencyGroupPolicyBytes() {
    java.lang.Object ref = consistencyGroupPolicy_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      consistencyGroupPolicy_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONSISTENCY_GROUP_POLICY_ID_FIELD_NUMBER = 261065057;

  @SuppressWarnings("serial")
  private volatile java.lang.Object consistencyGroupPolicyId_ = "";
  /**
   *
   *
   * <pre>
   * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy_id = 261065057;</code>
   *
   * @return Whether the consistencyGroupPolicyId field is set.
   */
  @java.lang.Override
  public boolean hasConsistencyGroupPolicyId() {
    return ((bitField0_ & 0x00000002) != 0);
  }
  /**
   *
   *
   * <pre>
   * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy_id = 261065057;</code>
   *
   * @return The consistencyGroupPolicyId.
   */
  @java.lang.Override
  public java.lang.String getConsistencyGroupPolicyId() {
    java.lang.Object ref = consistencyGroupPolicyId_;
    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();
      consistencyGroupPolicyId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
   * </pre>
   *
   * <code>optional string consistency_group_policy_id = 261065057;</code>
   *
   * @return The bytes for consistencyGroupPolicyId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getConsistencyGroupPolicyIdBytes() {
    java.lang.Object ref = consistencyGroupPolicyId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      consistencyGroupPolicyId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISK_FIELD_NUMBER = 3083677;

  @SuppressWarnings("serial")
  private volatile java.lang.Object disk_ = "";
  /**
   *
   *
   * <pre>
   * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
   * </pre>
   *
   * <code>optional string disk = 3083677;</code>
   *
   * @return Whether the disk field is set.
   */
  @java.lang.Override
  public boolean hasDisk() {
    return ((bitField0_ & 0x00000004) != 0);
  }
  /**
   *
   *
   * <pre>
   * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
   * </pre>
   *
   * <code>optional string disk = 3083677;</code>
   *
   * @return The disk.
   */
  @java.lang.Override
  public java.lang.String getDisk() {
    java.lang.Object ref = disk_;
    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();
      disk_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
   * </pre>
   *
   * <code>optional string disk = 3083677;</code>
   *
   * @return The bytes for disk.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDiskBytes() {
    java.lang.Object ref = disk_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      disk_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DISK_ID_FIELD_NUMBER = 60990205;

  @SuppressWarnings("serial")
  private volatile java.lang.Object diskId_ = "";
  /**
   *
   *
   * <pre>
   * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
   * </pre>
   *
   * <code>optional string disk_id = 60990205;</code>
   *
   * @return Whether the diskId field is set.
   */
  @java.lang.Override
  public boolean hasDiskId() {
    return ((bitField0_ & 0x00000008) != 0);
  }
  /**
   *
   *
   * <pre>
   * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
   * </pre>
   *
   * <code>optional string disk_id = 60990205;</code>
   *
   * @return The diskId.
   */
  @java.lang.Override
  public java.lang.String getDiskId() {
    java.lang.Object ref = diskId_;
    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();
      diskId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
   * </pre>
   *
   * <code>optional string disk_id = 60990205;</code>
   *
   * @return The bytes for diskId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getDiskIdBytes() {
    java.lang.Object ref = diskId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      diskId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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 (((bitField0_ & 0x00000001) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1991097, consistencyGroupPolicy_);
    }
    if (((bitField0_ & 0x00000004) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3083677, disk_);
    }
    if (((bitField0_ & 0x00000008) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 60990205, diskId_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(
          output, 261065057, consistencyGroupPolicyId_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(
              1991097, consistencyGroupPolicy_);
    }
    if (((bitField0_ & 0x00000004) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3083677, disk_);
    }
    if (((bitField0_ & 0x00000008) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(60990205, diskId_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(
              261065057, consistencyGroupPolicyId_);
    }
    size += getUnknownFields().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.compute.v1.DiskAsyncReplication)) {
      return super.equals(obj);
    }
    com.google.cloud.compute.v1.DiskAsyncReplication other =
        (com.google.cloud.compute.v1.DiskAsyncReplication) obj;

    if (hasConsistencyGroupPolicy() != other.hasConsistencyGroupPolicy()) return false;
    if (hasConsistencyGroupPolicy()) {
      if (!getConsistencyGroupPolicy().equals(other.getConsistencyGroupPolicy())) return false;
    }
    if (hasConsistencyGroupPolicyId() != other.hasConsistencyGroupPolicyId()) return false;
    if (hasConsistencyGroupPolicyId()) {
      if (!getConsistencyGroupPolicyId().equals(other.getConsistencyGroupPolicyId())) return false;
    }
    if (hasDisk() != other.hasDisk()) return false;
    if (hasDisk()) {
      if (!getDisk().equals(other.getDisk())) return false;
    }
    if (hasDiskId() != other.hasDiskId()) return false;
    if (hasDiskId()) {
      if (!getDiskId().equals(other.getDiskId())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasConsistencyGroupPolicy()) {
      hash = (37 * hash) + CONSISTENCY_GROUP_POLICY_FIELD_NUMBER;
      hash = (53 * hash) + getConsistencyGroupPolicy().hashCode();
    }
    if (hasConsistencyGroupPolicyId()) {
      hash = (37 * hash) + CONSISTENCY_GROUP_POLICY_ID_FIELD_NUMBER;
      hash = (53 * hash) + getConsistencyGroupPolicyId().hashCode();
    }
    if (hasDisk()) {
      hash = (37 * hash) + DISK_FIELD_NUMBER;
      hash = (53 * hash) + getDisk().hashCode();
    }
    if (hasDiskId()) {
      hash = (37 * hash) + DISK_ID_FIELD_NUMBER;
      hash = (53 * hash) + getDiskId().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.compute.v1.DiskAsyncReplication parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

  public static com.google.cloud.compute.v1.DiskAsyncReplication parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.DiskAsyncReplication parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

  public static com.google.cloud.compute.v1.DiskAsyncReplication 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.compute.v1.DiskAsyncReplication parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.DiskAsyncReplication 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.compute.v1.DiskAsyncReplication 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>
   * </pre>
   *
   * Protobuf type {@code google.cloud.compute.v1.DiskAsyncReplication}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.DiskAsyncReplication)
      com.google.cloud.compute.v1.DiskAsyncReplicationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_DiskAsyncReplication_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_DiskAsyncReplication_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.compute.v1.DiskAsyncReplication.class,
              com.google.cloud.compute.v1.DiskAsyncReplication.Builder.class);
    }

    // Construct using com.google.cloud.compute.v1.DiskAsyncReplication.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      consistencyGroupPolicy_ = "";
      consistencyGroupPolicyId_ = "";
      disk_ = "";
      diskId_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_DiskAsyncReplication_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.DiskAsyncReplication getDefaultInstanceForType() {
      return com.google.cloud.compute.v1.DiskAsyncReplication.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.compute.v1.DiskAsyncReplication buildPartial() {
      com.google.cloud.compute.v1.DiskAsyncReplication result =
          new com.google.cloud.compute.v1.DiskAsyncReplication(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.cloud.compute.v1.DiskAsyncReplication result) {
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.consistencyGroupPolicy_ = consistencyGroupPolicy_;
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.consistencyGroupPolicyId_ = consistencyGroupPolicyId_;
        to_bitField0_ |= 0x00000002;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.disk_ = disk_;
        to_bitField0_ |= 0x00000004;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.diskId_ = diskId_;
        to_bitField0_ |= 0x00000008;
      }
      result.bitField0_ |= to_bitField0_;
    }

    @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.compute.v1.DiskAsyncReplication) {
        return mergeFrom((com.google.cloud.compute.v1.DiskAsyncReplication) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.compute.v1.DiskAsyncReplication other) {
      if (other == com.google.cloud.compute.v1.DiskAsyncReplication.getDefaultInstance())
        return this;
      if (other.hasConsistencyGroupPolicy()) {
        consistencyGroupPolicy_ = other.consistencyGroupPolicy_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.hasConsistencyGroupPolicyId()) {
        consistencyGroupPolicyId_ = other.consistencyGroupPolicyId_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.hasDisk()) {
        disk_ = other.disk_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.hasDiskId()) {
        diskId_ = other.diskId_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      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 {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 15928778:
              {
                consistencyGroupPolicy_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 15928778
            case 24669418:
              {
                disk_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 24669418
            case 487921642:
              {
                diskId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 487921642
            case 2088520458:
              {
                consistencyGroupPolicyId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 2088520458
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object consistencyGroupPolicy_ = "";
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @return Whether the consistencyGroupPolicy field is set.
     */
    public boolean hasConsistencyGroupPolicy() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @return The consistencyGroupPolicy.
     */
    public java.lang.String getConsistencyGroupPolicy() {
      java.lang.Object ref = consistencyGroupPolicy_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        consistencyGroupPolicy_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @return The bytes for consistencyGroupPolicy.
     */
    public com.google.protobuf.ByteString getConsistencyGroupPolicyBytes() {
      java.lang.Object ref = consistencyGroupPolicy_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        consistencyGroupPolicy_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @param value The consistencyGroupPolicy to set.
     * @return This builder for chaining.
     */
    public Builder setConsistencyGroupPolicy(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      consistencyGroupPolicy_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearConsistencyGroupPolicy() {
      consistencyGroupPolicy_ = getDefaultInstance().getConsistencyGroupPolicy();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] URL of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy = 1991097;</code>
     *
     * @param value The bytes for consistencyGroupPolicy to set.
     * @return This builder for chaining.
     */
    public Builder setConsistencyGroupPolicyBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      consistencyGroupPolicy_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object consistencyGroupPolicyId_ = "";
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @return Whether the consistencyGroupPolicyId field is set.
     */
    public boolean hasConsistencyGroupPolicyId() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @return The consistencyGroupPolicyId.
     */
    public java.lang.String getConsistencyGroupPolicyId() {
      java.lang.Object ref = consistencyGroupPolicyId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        consistencyGroupPolicyId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @return The bytes for consistencyGroupPolicyId.
     */
    public com.google.protobuf.ByteString getConsistencyGroupPolicyIdBytes() {
      java.lang.Object ref = consistencyGroupPolicyId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        consistencyGroupPolicyId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @param value The consistencyGroupPolicyId to set.
     * @return This builder for chaining.
     */
    public Builder setConsistencyGroupPolicyId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      consistencyGroupPolicyId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearConsistencyGroupPolicyId() {
      consistencyGroupPolicyId_ = getDefaultInstance().getConsistencyGroupPolicyId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] ID of the DiskConsistencyGroupPolicy if replication was started on the disk as a member of a group.
     * </pre>
     *
     * <code>optional string consistency_group_policy_id = 261065057;</code>
     *
     * @param value The bytes for consistencyGroupPolicyId to set.
     * @return This builder for chaining.
     */
    public Builder setConsistencyGroupPolicyIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      consistencyGroupPolicyId_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object disk_ = "";
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @return Whether the disk field is set.
     */
    public boolean hasDisk() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @return The disk.
     */
    public java.lang.String getDisk() {
      java.lang.Object ref = disk_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        disk_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @return The bytes for disk.
     */
    public com.google.protobuf.ByteString getDiskBytes() {
      java.lang.Object ref = disk_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        disk_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @param value The disk to set.
     * @return This builder for chaining.
     */
    public Builder setDisk(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      disk_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDisk() {
      disk_ = getDefaultInstance().getDisk();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The other disk asynchronously replicated to or from the current disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /disks/disk - projects/project/zones/zone/disks/disk - zones/zone/disks/disk
     * </pre>
     *
     * <code>optional string disk = 3083677;</code>
     *
     * @param value The bytes for disk to set.
     * @return This builder for chaining.
     */
    public Builder setDiskBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      disk_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.lang.Object diskId_ = "";
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @return Whether the diskId field is set.
     */
    public boolean hasDiskId() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @return The diskId.
     */
    public java.lang.String getDiskId() {
      java.lang.Object ref = diskId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        diskId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @return The bytes for diskId.
     */
    public com.google.protobuf.ByteString getDiskIdBytes() {
      java.lang.Object ref = diskId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        diskId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @param value The diskId to set.
     * @return This builder for chaining.
     */
    public Builder setDiskId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      diskId_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDiskId() {
      diskId_ = getDefaultInstance().getDiskId();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * [Output Only] The unique ID of the other disk asynchronously replicated to or from the current disk. This value identifies the exact disk that was used to create this replication. For example, if you started replicating the persistent disk from a disk that was later deleted and recreated under the same name, the disk ID would identify the exact version of the disk that was used.
     * </pre>
     *
     * <code>optional string disk_id = 60990205;</code>
     *
     * @param value The bytes for diskId to set.
     * @return This builder for chaining.
     */
    public Builder setDiskIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      diskId_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    @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.compute.v1.DiskAsyncReplication)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.DiskAsyncReplication)
  private static final com.google.cloud.compute.v1.DiskAsyncReplication DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.compute.v1.DiskAsyncReplication();
  }

  public static com.google.cloud.compute.v1.DiskAsyncReplication getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<DiskAsyncReplication> PARSER =
      new com.google.protobuf.AbstractParser<DiskAsyncReplication>() {
        @java.lang.Override
        public DiskAsyncReplication parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.compute.v1.DiskAsyncReplication getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
