// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/asset/v1/asset_service.proto

package com.google.cloud.asset.v1;

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

  private BatchGetAssetsHistoryRequest() {
    parent_ = "";
    assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    contentType_ = 0;
  }

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

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

              parent_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
                assetNames_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000002;
              }
              assetNames_.add(s);
              break;
            }
          case 24:
            {
              int rawValue = input.readEnum();

              contentType_ = rawValue;
              break;
            }
          case 34:
            {
              com.google.cloud.asset.v1.TimeWindow.Builder subBuilder = null;
              if (readTimeWindow_ != null) {
                subBuilder = readTimeWindow_.toBuilder();
              }
              readTimeWindow_ =
                  input.readMessage(
                      com.google.cloud.asset.v1.TimeWindow.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(readTimeWindow_);
                readTimeWindow_ = 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 {
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        assetNames_ = assetNames_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.asset.v1.AssetServiceProto
        .internal_static_google_cloud_asset_v1_BatchGetAssetsHistoryRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.asset.v1.AssetServiceProto
        .internal_static_google_cloud_asset_v1_BatchGetAssetsHistoryRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.class,
            com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.Builder.class);
  }

  private int bitField0_;
  public static final int PARENT_FIELD_NUMBER = 1;
  private volatile java.lang.Object parent_;
  /**
   *
   *
   * <pre>
   * Required. The relative name of the root asset. It can only be an
   * organization number (such as "organizations/123"), a project ID (such as
   * "projects/my-project-id")", or a project number (such as "projects/12345").
   * </pre>
   *
   * <code>string parent = 1;</code>
   */
  public java.lang.String getParent() {
    java.lang.Object ref = parent_;
    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();
      parent_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The relative name of the root asset. It can only be an
   * organization number (such as "organizations/123"), a project ID (such as
   * "projects/my-project-id")", or a project number (such as "projects/12345").
   * </pre>
   *
   * <code>string parent = 1;</code>
   */
  public com.google.protobuf.ByteString getParentBytes() {
    java.lang.Object ref = parent_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      parent_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ASSET_NAMES_FIELD_NUMBER = 2;
  private com.google.protobuf.LazyStringList assetNames_;
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets. For example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * See [Resource
   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
   * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
   * for more info.
   * The request becomes a no-op if the asset name list is empty, and the max
   * size of the asset name list is 100 in one request.
   * </pre>
   *
   * <code>repeated string asset_names = 2;</code>
   */
  public com.google.protobuf.ProtocolStringList getAssetNamesList() {
    return assetNames_;
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets. For example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * See [Resource
   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
   * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
   * for more info.
   * The request becomes a no-op if the asset name list is empty, and the max
   * size of the asset name list is 100 in one request.
   * </pre>
   *
   * <code>repeated string asset_names = 2;</code>
   */
  public int getAssetNamesCount() {
    return assetNames_.size();
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets. For example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * See [Resource
   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
   * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
   * for more info.
   * The request becomes a no-op if the asset name list is empty, and the max
   * size of the asset name list is 100 in one request.
   * </pre>
   *
   * <code>repeated string asset_names = 2;</code>
   */
  public java.lang.String getAssetNames(int index) {
    return assetNames_.get(index);
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets. For example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * See [Resource
   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
   * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
   * for more info.
   * The request becomes a no-op if the asset name list is empty, and the max
   * size of the asset name list is 100 in one request.
   * </pre>
   *
   * <code>repeated string asset_names = 2;</code>
   */
  public com.google.protobuf.ByteString getAssetNamesBytes(int index) {
    return assetNames_.getByteString(index);
  }

  public static final int CONTENT_TYPE_FIELD_NUMBER = 3;
  private int contentType_;
  /**
   *
   *
   * <pre>
   * Required. The content type.
   * </pre>
   *
   * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
   */
  public int getContentTypeValue() {
    return contentType_;
  }
  /**
   *
   *
   * <pre>
   * Required. The content type.
   * </pre>
   *
   * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
   */
  public com.google.cloud.asset.v1.ContentType getContentType() {
    @SuppressWarnings("deprecation")
    com.google.cloud.asset.v1.ContentType result =
        com.google.cloud.asset.v1.ContentType.valueOf(contentType_);
    return result == null ? com.google.cloud.asset.v1.ContentType.UNRECOGNIZED : result;
  }

  public static final int READ_TIME_WINDOW_FIELD_NUMBER = 4;
  private com.google.cloud.asset.v1.TimeWindow readTimeWindow_;
  /**
   *
   *
   * <pre>
   * Optional. The time window for the asset history. Both start_time and
   * end_time are optional and if set, it must be after 2018-10-02 UTC. If
   * end_time is not set, it is default to current timestamp. If start_time is
   * not set, the snapshot of the assets at end_time will be returned. The
   * returned results contain all temporal assets whose time window overlap with
   * read_time_window.
   * </pre>
   *
   * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
   */
  public boolean hasReadTimeWindow() {
    return readTimeWindow_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. The time window for the asset history. Both start_time and
   * end_time are optional and if set, it must be after 2018-10-02 UTC. If
   * end_time is not set, it is default to current timestamp. If start_time is
   * not set, the snapshot of the assets at end_time will be returned. The
   * returned results contain all temporal assets whose time window overlap with
   * read_time_window.
   * </pre>
   *
   * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
   */
  public com.google.cloud.asset.v1.TimeWindow getReadTimeWindow() {
    return readTimeWindow_ == null
        ? com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()
        : readTimeWindow_;
  }
  /**
   *
   *
   * <pre>
   * Optional. The time window for the asset history. Both start_time and
   * end_time are optional and if set, it must be after 2018-10-02 UTC. If
   * end_time is not set, it is default to current timestamp. If start_time is
   * not set, the snapshot of the assets at end_time will be returned. The
   * returned results contain all temporal assets whose time window overlap with
   * read_time_window.
   * </pre>
   *
   * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
   */
  public com.google.cloud.asset.v1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
    return getReadTimeWindow();
  }

  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 (!getParentBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    }
    for (int i = 0; i < assetNames_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetNames_.getRaw(i));
    }
    if (contentType_
        != com.google.cloud.asset.v1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
      output.writeEnum(3, contentType_);
    }
    if (readTimeWindow_ != null) {
      output.writeMessage(4, getReadTimeWindow());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getParentBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < assetNames_.size(); i++) {
        dataSize += computeStringSizeNoTag(assetNames_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getAssetNamesList().size();
    }
    if (contentType_
        != com.google.cloud.asset.v1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, contentType_);
    }
    if (readTimeWindow_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReadTimeWindow());
    }
    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.asset.v1.BatchGetAssetsHistoryRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest other =
        (com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (!getAssetNamesList().equals(other.getAssetNamesList())) return false;
    if (contentType_ != other.contentType_) return false;
    if (hasReadTimeWindow() != other.hasReadTimeWindow()) return false;
    if (hasReadTimeWindow()) {
      if (!getReadTimeWindow().equals(other.getReadTimeWindow())) 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();
    hash = (37 * hash) + PARENT_FIELD_NUMBER;
    hash = (53 * hash) + getParent().hashCode();
    if (getAssetNamesCount() > 0) {
      hash = (37 * hash) + ASSET_NAMES_FIELD_NUMBER;
      hash = (53 * hash) + getAssetNamesList().hashCode();
    }
    hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + contentType_;
    if (hasReadTimeWindow()) {
      hash = (37 * hash) + READ_TIME_WINDOW_FIELD_NUMBER;
      hash = (53 * hash) + getReadTimeWindow().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest 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.asset.v1.BatchGetAssetsHistoryRequest 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>
   * Batch get assets history request.
   * </pre>
   *
   * Protobuf type {@code google.cloud.asset.v1.BatchGetAssetsHistoryRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.BatchGetAssetsHistoryRequest)
      com.google.cloud.asset.v1.BatchGetAssetsHistoryRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_BatchGetAssetsHistoryRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_BatchGetAssetsHistoryRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.class,
              com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.Builder.class);
    }

    // Construct using com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.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();
      parent_ = "";

      assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      contentType_ = 0;

      if (readTimeWindowBuilder_ == null) {
        readTimeWindow_ = null;
      } else {
        readTimeWindow_ = null;
        readTimeWindowBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.asset.v1.AssetServiceProto
          .internal_static_google_cloud_asset_v1_BatchGetAssetsHistoryRequest_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest buildPartial() {
      com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest result =
          new com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.parent_ = parent_;
      if (((bitField0_ & 0x00000002) != 0)) {
        assetNames_ = assetNames_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.assetNames_ = assetNames_;
      result.contentType_ = contentType_;
      if (readTimeWindowBuilder_ == null) {
        result.readTimeWindow_ = readTimeWindow_;
      } else {
        result.readTimeWindow_ = readTimeWindowBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      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.asset.v1.BatchGetAssetsHistoryRequest) {
        return mergeFrom((com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest other) {
      if (other == com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest.getDefaultInstance())
        return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        onChanged();
      }
      if (!other.assetNames_.isEmpty()) {
        if (assetNames_.isEmpty()) {
          assetNames_ = other.assetNames_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureAssetNamesIsMutable();
          assetNames_.addAll(other.assetNames_);
        }
        onChanged();
      }
      if (other.contentType_ != 0) {
        setContentTypeValue(other.getContentTypeValue());
      }
      if (other.hasReadTimeWindow()) {
        mergeReadTimeWindow(other.getReadTimeWindow());
      }
      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.asset.v1.BatchGetAssetsHistoryRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. It can only be an
     * organization number (such as "organizations/123"), a project ID (such as
     * "projects/my-project-id")", or a project number (such as "projects/12345").
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public java.lang.String getParent() {
      java.lang.Object ref = parent_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        parent_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. It can only be an
     * organization number (such as "organizations/123"), a project ID (such as
     * "projects/my-project-id")", or a project number (such as "projects/12345").
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public com.google.protobuf.ByteString getParentBytes() {
      java.lang.Object ref = parent_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        parent_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. It can only be an
     * organization number (such as "organizations/123"), a project ID (such as
     * "projects/my-project-id")", or a project number (such as "projects/12345").
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      parent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. It can only be an
     * organization number (such as "organizations/123"), a project ID (such as
     * "projects/my-project-id")", or a project number (such as "projects/12345").
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder clearParent() {

      parent_ = getDefaultInstance().getParent();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. It can only be an
     * organization number (such as "organizations/123"), a project ID (such as
     * "projects/my-project-id")", or a project number (such as "projects/12345").
     * </pre>
     *
     * <code>string parent = 1;</code>
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      parent_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList assetNames_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureAssetNamesIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        assetNames_ = new com.google.protobuf.LazyStringArrayList(assetNames_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public com.google.protobuf.ProtocolStringList getAssetNamesList() {
      return assetNames_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public int getAssetNamesCount() {
      return assetNames_.size();
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public java.lang.String getAssetNames(int index) {
      return assetNames_.get(index);
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public com.google.protobuf.ByteString getAssetNamesBytes(int index) {
      return assetNames_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public Builder setAssetNames(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAssetNamesIsMutable();
      assetNames_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public Builder addAssetNames(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureAssetNamesIsMutable();
      assetNames_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public Builder addAllAssetNames(java.lang.Iterable<java.lang.String> values) {
      ensureAssetNamesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, assetNames_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public Builder clearAssetNames() {
      assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets. For example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * See [Resource
     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
     * and [Resource Name Format](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/resource-name-format)
     * for more info.
     * The request becomes a no-op if the asset name list is empty, and the max
     * size of the asset name list is 100 in one request.
     * </pre>
     *
     * <code>repeated string asset_names = 2;</code>
     */
    public Builder addAssetNamesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureAssetNamesIsMutable();
      assetNames_.add(value);
      onChanged();
      return this;
    }

    private int contentType_ = 0;
    /**
     *
     *
     * <pre>
     * Required. The content type.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
     */
    public int getContentTypeValue() {
      return contentType_;
    }
    /**
     *
     *
     * <pre>
     * Required. The content type.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
     */
    public Builder setContentTypeValue(int value) {
      contentType_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The content type.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
     */
    public com.google.cloud.asset.v1.ContentType getContentType() {
      @SuppressWarnings("deprecation")
      com.google.cloud.asset.v1.ContentType result =
          com.google.cloud.asset.v1.ContentType.valueOf(contentType_);
      return result == null ? com.google.cloud.asset.v1.ContentType.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * Required. The content type.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
     */
    public Builder setContentType(com.google.cloud.asset.v1.ContentType value) {
      if (value == null) {
        throw new NullPointerException();
      }

      contentType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The content type.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.ContentType content_type = 3;</code>
     */
    public Builder clearContentType() {

      contentType_ = 0;
      onChanged();
      return this;
    }

    private com.google.cloud.asset.v1.TimeWindow readTimeWindow_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.TimeWindow,
            com.google.cloud.asset.v1.TimeWindow.Builder,
            com.google.cloud.asset.v1.TimeWindowOrBuilder>
        readTimeWindowBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public boolean hasReadTimeWindow() {
      return readTimeWindowBuilder_ != null || readTimeWindow_ != null;
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public com.google.cloud.asset.v1.TimeWindow getReadTimeWindow() {
      if (readTimeWindowBuilder_ == null) {
        return readTimeWindow_ == null
            ? com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()
            : readTimeWindow_;
      } else {
        return readTimeWindowBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public Builder setReadTimeWindow(com.google.cloud.asset.v1.TimeWindow value) {
      if (readTimeWindowBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        readTimeWindow_ = value;
        onChanged();
      } else {
        readTimeWindowBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public Builder setReadTimeWindow(com.google.cloud.asset.v1.TimeWindow.Builder builderForValue) {
      if (readTimeWindowBuilder_ == null) {
        readTimeWindow_ = builderForValue.build();
        onChanged();
      } else {
        readTimeWindowBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public Builder mergeReadTimeWindow(com.google.cloud.asset.v1.TimeWindow value) {
      if (readTimeWindowBuilder_ == null) {
        if (readTimeWindow_ != null) {
          readTimeWindow_ =
              com.google.cloud.asset.v1.TimeWindow.newBuilder(readTimeWindow_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          readTimeWindow_ = value;
        }
        onChanged();
      } else {
        readTimeWindowBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public Builder clearReadTimeWindow() {
      if (readTimeWindowBuilder_ == null) {
        readTimeWindow_ = null;
        onChanged();
      } else {
        readTimeWindow_ = null;
        readTimeWindowBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public com.google.cloud.asset.v1.TimeWindow.Builder getReadTimeWindowBuilder() {

      onChanged();
      return getReadTimeWindowFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    public com.google.cloud.asset.v1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
      if (readTimeWindowBuilder_ != null) {
        return readTimeWindowBuilder_.getMessageOrBuilder();
      } else {
        return readTimeWindow_ == null
            ? com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()
            : readTimeWindow_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after 2018-10-02 UTC. If
     * end_time is not set, it is default to current timestamp. If start_time is
     * not set, the snapshot of the assets at end_time will be returned. The
     * returned results contain all temporal assets whose time window overlap with
     * read_time_window.
     * </pre>
     *
     * <code>.google.cloud.asset.v1.TimeWindow read_time_window = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.TimeWindow,
            com.google.cloud.asset.v1.TimeWindow.Builder,
            com.google.cloud.asset.v1.TimeWindowOrBuilder>
        getReadTimeWindowFieldBuilder() {
      if (readTimeWindowBuilder_ == null) {
        readTimeWindowBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.asset.v1.TimeWindow,
                com.google.cloud.asset.v1.TimeWindow.Builder,
                com.google.cloud.asset.v1.TimeWindowOrBuilder>(
                getReadTimeWindow(), getParentForChildren(), isClean());
        readTimeWindow_ = null;
      }
      return readTimeWindowBuilder_;
    }

    @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.asset.v1.BatchGetAssetsHistoryRequest)
  }

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

  static {
    DEFAULT_INSTANCE = new com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest();
  }

  public static com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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