/*
 * Copyright 2020 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/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;
    relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

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

  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);
  }

  public static final int PARENT_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The parent.
   */
  @java.lang.Override
  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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for parent.
   */
  @java.lang.Override
  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;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList assetNames_;
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets.
   * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
   * Example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * 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>
   *
   * @return A list containing the assetNames.
   */
  public com.google.protobuf.ProtocolStringList getAssetNamesList() {
    return assetNames_;
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets.
   * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
   * Example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * 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>
   *
   * @return The count of assetNames.
   */
  public int getAssetNamesCount() {
    return assetNames_.size();
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets.
   * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
   * Example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * 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>
   *
   * @param index The index of the element to return.
   * @return The assetNames at the given index.
   */
  public java.lang.String getAssetNames(int index) {
    return assetNames_.get(index);
  }
  /**
   *
   *
   * <pre>
   * A list of the full names of the assets.
   * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
   * Example:
   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
   * 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>
   *
   * @param index The index of the value to return.
   * @return The bytes of the assetNames at the given index.
   */
  public com.google.protobuf.ByteString getAssetNamesBytes(int index) {
    return assetNames_.getByteString(index);
  }

  public static final int CONTENT_TYPE_FIELD_NUMBER = 3;
  private int contentType_ = 0;
  /**
   *
   *
   * <pre>
   * Optional. The content type.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The enum numeric value on the wire for contentType.
   */
  @java.lang.Override
  public int getContentTypeValue() {
    return contentType_;
  }
  /**
   *
   *
   * <pre>
   * Optional. The content type.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The contentType.
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.ContentType getContentType() {
    com.google.cloud.asset.v1.ContentType result =
        com.google.cloud.asset.v1.ContentType.forNumber(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 the current time minus
   * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the readTimeWindow field is set.
   */
  @java.lang.Override
  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 the current time minus
   * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The readTimeWindow.
   */
  @java.lang.Override
  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 the current time minus
   * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
    return readTimeWindow_ == null
        ? com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()
        : readTimeWindow_;
  }

  public static final int RELATIONSHIP_TYPES_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList relationshipTypes_;
  /**
   *
   *
   * <pre>
   * Optional. A list of relationship types to output, for example:
   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
   * content_type=RELATIONSHIP.
   * * If specified:
   * it outputs specified relationships' history on the [asset_names]. It
   * returns an error if any of the [relationship_types] doesn't belong to the
   * supported relationship types of the [asset_names] or if any of the
   * [asset_names]'s types doesn't belong to the source types of the
   * [relationship_types].
   * * Otherwise:
   * it outputs the supported relationships' history on the [asset_names] or
   * returns an error if any of the [asset_names]'s types has no relationship
   * support.
   * See [Introduction to Cloud Asset
   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
   * supported asset types and relationship types.
   * </pre>
   *
   * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return A list containing the relationshipTypes.
   */
  public com.google.protobuf.ProtocolStringList getRelationshipTypesList() {
    return relationshipTypes_;
  }
  /**
   *
   *
   * <pre>
   * Optional. A list of relationship types to output, for example:
   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
   * content_type=RELATIONSHIP.
   * * If specified:
   * it outputs specified relationships' history on the [asset_names]. It
   * returns an error if any of the [relationship_types] doesn't belong to the
   * supported relationship types of the [asset_names] or if any of the
   * [asset_names]'s types doesn't belong to the source types of the
   * [relationship_types].
   * * Otherwise:
   * it outputs the supported relationships' history on the [asset_names] or
   * returns an error if any of the [asset_names]'s types has no relationship
   * support.
   * See [Introduction to Cloud Asset
   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
   * supported asset types and relationship types.
   * </pre>
   *
   * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The count of relationshipTypes.
   */
  public int getRelationshipTypesCount() {
    return relationshipTypes_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional. A list of relationship types to output, for example:
   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
   * content_type=RELATIONSHIP.
   * * If specified:
   * it outputs specified relationships' history on the [asset_names]. It
   * returns an error if any of the [relationship_types] doesn't belong to the
   * supported relationship types of the [asset_names] or if any of the
   * [asset_names]'s types doesn't belong to the source types of the
   * [relationship_types].
   * * Otherwise:
   * it outputs the supported relationships' history on the [asset_names] or
   * returns an error if any of the [asset_names]'s types has no relationship
   * support.
   * See [Introduction to Cloud Asset
   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
   * supported asset types and relationship types.
   * </pre>
   *
   * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @param index The index of the element to return.
   * @return The relationshipTypes at the given index.
   */
  public java.lang.String getRelationshipTypes(int index) {
    return relationshipTypes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Optional. A list of relationship types to output, for example:
   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
   * content_type=RELATIONSHIP.
   * * If specified:
   * it outputs specified relationships' history on the [asset_names]. It
   * returns an error if any of the [relationship_types] doesn't belong to the
   * supported relationship types of the [asset_names] or if any of the
   * [asset_names]'s types doesn't belong to the source types of the
   * [relationship_types].
   * * Otherwise:
   * it outputs the supported relationships' history on the [asset_names] or
   * returns an error if any of the [asset_names]'s types has no relationship
   * support.
   * See [Introduction to Cloud Asset
   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
   * supported asset types and relationship types.
   * </pre>
   *
   * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the relationshipTypes at the given index.
   */
  public com.google.protobuf.ByteString getRelationshipTypesBytes(int index) {
    return relationshipTypes_.getByteString(index);
  }

  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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      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());
    }
    for (int i = 0; i < relationshipTypes_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, relationshipTypes_.getRaw(i));
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
      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());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < relationshipTypes_.size(); i++) {
        dataSize += computeStringSizeNoTag(relationshipTypes_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getRelationshipTypesList().size();
    }
    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.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 (!getRelationshipTypesList().equals(other.getRelationshipTypesList())) 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();
    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();
    }
    if (getRelationshipTypesCount() > 0) {
      hash = (37 * hash) + RELATIONSHIP_TYPES_FIELD_NUMBER;
      hash = (53 * hash) + getRelationshipTypesList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().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() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      parent_ = "";
      assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      contentType_ = 0;
      readTimeWindow_ = null;
      if (readTimeWindowBuilder_ != null) {
        readTimeWindowBuilder_.dispose();
        readTimeWindowBuilder_ = null;
      }
      relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000010);
      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);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest result) {
      if (((bitField0_ & 0x00000002) != 0)) {
        assetNames_ = assetNames_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.assetNames_ = assetNames_;
      if (((bitField0_ & 0x00000010) != 0)) {
        relationshipTypes_ = relationshipTypes_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000010);
      }
      result.relationshipTypes_ = relationshipTypes_;
    }

    private void buildPartial0(com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.parent_ = parent_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.contentType_ = contentType_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.readTimeWindow_ =
            readTimeWindowBuilder_ == null ? readTimeWindow_ : readTimeWindowBuilder_.build();
      }
    }

    @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_;
        bitField0_ |= 0x00000001;
        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());
      }
      if (!other.relationshipTypes_.isEmpty()) {
        if (relationshipTypes_.isEmpty()) {
          relationshipTypes_ = other.relationshipTypes_;
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          ensureRelationshipTypesIsMutable();
          relationshipTypes_.addAll(other.relationshipTypes_);
        }
        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 10:
              {
                parent_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureAssetNamesIsMutable();
                assetNames_.add(s);
                break;
              } // case 18
            case 24:
              {
                contentType_ = input.readEnum();
                bitField0_ |= 0x00000004;
                break;
              } // case 24
            case 34:
              {
                input.readMessage(getReadTimeWindowFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureRelationshipTypesIsMutable();
                relationshipTypes_.add(s);
                break;
              } // case 42
            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 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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The parent.
     */
    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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for parent.
     */
    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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The parent to set.
     * @return This builder for chaining.
     */
    public Builder setParent(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      parent_ = value;
      bitField0_ |= 0x00000001;
      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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearParent() {
      parent_ = getDefaultInstance().getParent();
      bitField0_ = (bitField0_ & ~0x00000001);
      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 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for parent to set.
     * @return This builder for chaining.
     */
    public Builder setParentBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      parent_ = value;
      bitField0_ |= 0x00000001;
      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.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @return A list containing the assetNames.
     */
    public com.google.protobuf.ProtocolStringList getAssetNamesList() {
      return assetNames_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @return The count of assetNames.
     */
    public int getAssetNamesCount() {
      return assetNames_.size();
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param index The index of the element to return.
     * @return The assetNames at the given index.
     */
    public java.lang.String getAssetNames(int index) {
      return assetNames_.get(index);
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param index The index of the value to return.
     * @return The bytes of the assetNames at the given index.
     */
    public com.google.protobuf.ByteString getAssetNamesBytes(int index) {
      return assetNames_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * A list of the full names of the assets.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param index The index to set the value at.
     * @param value The assetNames to set.
     * @return This builder for chaining.
     */
    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.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param value The assetNames to add.
     * @return This builder for chaining.
     */
    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.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param values The assetNames to add.
     * @return This builder for chaining.
     */
    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.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @return This builder for chaining.
     */
    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.
     * See: https://cloud.google.com/asset-inventory/docs/resource-name-format
     * Example:
     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
     * 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>
     *
     * @param value The bytes of the assetNames to add.
     * @return This builder for chaining.
     */
    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>
     * Optional. The content type.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The enum numeric value on the wire for contentType.
     */
    @java.lang.Override
    public int getContentTypeValue() {
      return contentType_;
    }
    /**
     *
     *
     * <pre>
     * Optional. The content type.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The enum numeric value on the wire for contentType to set.
     * @return This builder for chaining.
     */
    public Builder setContentTypeValue(int value) {
      contentType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The content type.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The contentType.
     */
    @java.lang.Override
    public com.google.cloud.asset.v1.ContentType getContentType() {
      com.google.cloud.asset.v1.ContentType result =
          com.google.cloud.asset.v1.ContentType.forNumber(contentType_);
      return result == null ? com.google.cloud.asset.v1.ContentType.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * Optional. The content type.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The contentType to set.
     * @return This builder for chaining.
     */
    public Builder setContentType(com.google.cloud.asset.v1.ContentType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000004;
      contentType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The content type.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.ContentType content_type = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearContentType() {
      bitField0_ = (bitField0_ & ~0x00000004);
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the readTimeWindow field is set.
     */
    public boolean hasReadTimeWindow() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. The time window for the asset history. Both start_time and
     * end_time are optional and if set, it must be after the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The readTimeWindow.
     */
    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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setReadTimeWindow(com.google.cloud.asset.v1.TimeWindow value) {
      if (readTimeWindowBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        readTimeWindow_ = value;
      } else {
        readTimeWindowBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setReadTimeWindow(com.google.cloud.asset.v1.TimeWindow.Builder builderForValue) {
      if (readTimeWindowBuilder_ == null) {
        readTimeWindow_ = builderForValue.build();
      } else {
        readTimeWindowBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeReadTimeWindow(com.google.cloud.asset.v1.TimeWindow value) {
      if (readTimeWindowBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && readTimeWindow_ != null
            && readTimeWindow_ != com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()) {
          getReadTimeWindowBuilder().mergeFrom(value);
        } else {
          readTimeWindow_ = value;
        }
      } else {
        readTimeWindowBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearReadTimeWindow() {
      bitField0_ = (bitField0_ & ~0x00000008);
      readTimeWindow_ = null;
      if (readTimeWindowBuilder_ != null) {
        readTimeWindowBuilder_.dispose();
        readTimeWindowBuilder_ = null;
      }
      onChanged();
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.asset.v1.TimeWindow.Builder getReadTimeWindowBuilder() {
      bitField0_ |= 0x00000008;
      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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </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 the current time minus
     * 35 days. 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 [(.google.api.field_behavior) = OPTIONAL];
     * </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_;
    }

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

    private void ensureRelationshipTypesIsMutable() {
      if (!((bitField0_ & 0x00000010) != 0)) {
        relationshipTypes_ = new com.google.protobuf.LazyStringArrayList(relationshipTypes_);
        bitField0_ |= 0x00000010;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return A list containing the relationshipTypes.
     */
    public com.google.protobuf.ProtocolStringList getRelationshipTypesList() {
      return relationshipTypes_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The count of relationshipTypes.
     */
    public int getRelationshipTypesCount() {
      return relationshipTypes_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the element to return.
     * @return The relationshipTypes at the given index.
     */
    public java.lang.String getRelationshipTypes(int index) {
      return relationshipTypes_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the relationshipTypes at the given index.
     */
    public com.google.protobuf.ByteString getRelationshipTypesBytes(int index) {
      return relationshipTypes_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The relationshipTypes to set.
     * @return This builder for chaining.
     */
    public Builder setRelationshipTypes(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureRelationshipTypesIsMutable();
      relationshipTypes_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The relationshipTypes to add.
     * @return This builder for chaining.
     */
    public Builder addRelationshipTypes(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureRelationshipTypesIsMutable();
      relationshipTypes_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param values The relationshipTypes to add.
     * @return This builder for chaining.
     */
    public Builder addAllRelationshipTypes(java.lang.Iterable<java.lang.String> values) {
      ensureRelationshipTypesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relationshipTypes_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearRelationshipTypes() {
      relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A list of relationship types to output, for example:
     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
     * content_type=RELATIONSHIP.
     * * If specified:
     * it outputs specified relationships' history on the [asset_names]. It
     * returns an error if any of the [relationship_types] doesn't belong to the
     * supported relationship types of the [asset_names] or if any of the
     * [asset_names]'s types doesn't belong to the source types of the
     * [relationship_types].
     * * Otherwise:
     * it outputs the supported relationships' history on the [asset_names] or
     * returns an error if any of the [asset_names]'s types has no relationship
     * support.
     * See [Introduction to Cloud Asset
     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
     * supported asset types and relationship types.
     * </pre>
     *
     * <code>repeated string relationship_types = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The bytes of the relationshipTypes to add.
     * @return This builder for chaining.
     */
    public Builder addRelationshipTypesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureRelationshipTypesIsMutable();
      relationshipTypes_.add(value);
      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.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 {
          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<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;
  }
}
