/*
 * 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>
 * QueryAssets request.
 * </pre>
 *
 * Protobuf type {@code google.cloud.asset.v1.QueryAssetsRequest}
 */
public final class QueryAssetsRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.QueryAssetsRequest)
    QueryAssetsRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use QueryAssetsRequest.newBuilder() to construct.
  private QueryAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private QueryAssetsRequest() {
    parent_ = "";
    pageToken_ = "";
  }

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

  @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_QueryAssetsRequest_descriptor;
  }

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

  private int queryCase_ = 0;
  private java.lang.Object query_;

  public enum QueryCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    STATEMENT(2),
    JOB_REFERENCE(3),
    QUERY_NOT_SET(0);
    private final int value;

    private QueryCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static QueryCase valueOf(int value) {
      return forNumber(value);
    }

    public static QueryCase forNumber(int value) {
      switch (value) {
        case 2:
          return STATEMENT;
        case 3:
          return JOB_REFERENCE;
        case 0:
          return QUERY_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public QueryCase getQueryCase() {
    return QueryCase.forNumber(queryCase_);
  }

  private int timeCase_ = 0;
  private java.lang.Object time_;

  public enum TimeCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    READ_TIME_WINDOW(7),
    READ_TIME(8),
    TIME_NOT_SET(0);
    private final int value;

    private TimeCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TimeCase valueOf(int value) {
      return forNumber(value);
    }

    public static TimeCase forNumber(int value) {
      switch (value) {
        case 7:
          return READ_TIME_WINDOW;
        case 8:
          return READ_TIME;
        case 0:
          return TIME_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public TimeCase getTimeCase() {
    return TimeCase.forNumber(timeCase_);
  }

  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. This 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"),
   * or a folder number (such as "folders/123").
   * Only assets belonging to the `parent` will be returned.
   * </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. This 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"),
   * or a folder number (such as "folders/123").
   * Only assets belonging to the `parent` will be returned.
   * </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 STATEMENT_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * Optional. A SQL statement that's compatible with [BigQuery Standard
   * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
   * </pre>
   *
   * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return Whether the statement field is set.
   */
  public boolean hasStatement() {
    return queryCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * Optional. A SQL statement that's compatible with [BigQuery Standard
   * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
   * </pre>
   *
   * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The statement.
   */
  public java.lang.String getStatement() {
    java.lang.Object ref = "";
    if (queryCase_ == 2) {
      ref = query_;
    }
    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();
      if (queryCase_ == 2) {
        query_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. A SQL statement that's compatible with [BigQuery Standard
   * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
   * </pre>
   *
   * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for statement.
   */
  public com.google.protobuf.ByteString getStatementBytes() {
    java.lang.Object ref = "";
    if (queryCase_ == 2) {
      ref = query_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (queryCase_ == 2) {
        query_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int JOB_REFERENCE_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * Optional. Reference to the query job, which is from the
   * `QueryAssetsResponse` of previous `QueryAssets` call.
   * </pre>
   *
   * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return Whether the jobReference field is set.
   */
  public boolean hasJobReference() {
    return queryCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * Optional. Reference to the query job, which is from the
   * `QueryAssetsResponse` of previous `QueryAssets` call.
   * </pre>
   *
   * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The jobReference.
   */
  public java.lang.String getJobReference() {
    java.lang.Object ref = "";
    if (queryCase_ == 3) {
      ref = query_;
    }
    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();
      if (queryCase_ == 3) {
        query_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. Reference to the query job, which is from the
   * `QueryAssetsResponse` of previous `QueryAssets` call.
   * </pre>
   *
   * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for jobReference.
   */
  public com.google.protobuf.ByteString getJobReferenceBytes() {
    java.lang.Object ref = "";
    if (queryCase_ == 3) {
      ref = query_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (queryCase_ == 3) {
        query_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PAGE_SIZE_FIELD_NUMBER = 4;
  private int pageSize_ = 0;
  /**
   *
   *
   * <pre>
   * Optional. The maximum number of rows to return in the results. Responses
   * are limited to 10 MB and 1000 rows.
   * By default, the maximum row count is 1000. When the byte or row count limit
   * is reached, the rest of the query results will be paginated.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The pageSize.
   */
  @java.lang.Override
  public int getPageSize() {
    return pageSize_;
  }

  public static final int PAGE_TOKEN_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pageToken_ = "";
  /**
   *
   *
   * <pre>
   * Optional. A page token received from previous `QueryAssets`.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The pageToken.
   */
  @java.lang.Override
  public java.lang.String getPageToken() {
    java.lang.Object ref = pageToken_;
    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();
      pageToken_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. A page token received from previous `QueryAssets`.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for pageToken.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPageTokenBytes() {
    java.lang.Object ref = pageToken_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pageToken_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TIMEOUT_FIELD_NUMBER = 6;
  private com.google.protobuf.Duration timeout_;
  /**
   *
   *
   * <pre>
   * Optional. Specifies the maximum amount of time that the client is willing
   * to wait for the query to complete. By default, this limit is 5 min for the
   * first query, and 1 minute for the following queries. If the query is
   * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
   * false.
   * Like BigQuery [jobs.query
   * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
   * The call is not guaranteed to wait for the specified timeout; it typically
   * returns after around 200 seconds (200,000 milliseconds), even if the query
   * is not complete.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return Whether the timeout field is set.
   */
  @java.lang.Override
  public boolean hasTimeout() {
    return timeout_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Specifies the maximum amount of time that the client is willing
   * to wait for the query to complete. By default, this limit is 5 min for the
   * first query, and 1 minute for the following queries. If the query is
   * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
   * false.
   * Like BigQuery [jobs.query
   * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
   * The call is not guaranteed to wait for the specified timeout; it typically
   * returns after around 200 seconds (200,000 milliseconds), even if the query
   * is not complete.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The timeout.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getTimeout() {
    return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Specifies the maximum amount of time that the client is willing
   * to wait for the query to complete. By default, this limit is 5 min for the
   * first query, and 1 minute for the following queries. If the query is
   * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
   * false.
   * Like BigQuery [jobs.query
   * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
   * The call is not guaranteed to wait for the specified timeout; it typically
   * returns after around 200 seconds (200,000 milliseconds), even if the query
   * is not complete.
   * The field will be ignored when [output_config] is specified.
   * </pre>
   *
   * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() {
    return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
  }

  public static final int READ_TIME_WINDOW_FIELD_NUMBER = 7;
  /**
   *
   *
   * <pre>
   * Optional. [start_time] is required. [start_time] must be less than
   * [end_time] Defaults [end_time] to now if [start_time] is set and
   * [end_time] isn't. Maximum permitted time range is 7 days.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the readTimeWindow field is set.
   */
  @java.lang.Override
  public boolean hasReadTimeWindow() {
    return timeCase_ == 7;
  }
  /**
   *
   *
   * <pre>
   * Optional. [start_time] is required. [start_time] must be less than
   * [end_time] Defaults [end_time] to now if [start_time] is set and
   * [end_time] isn't. Maximum permitted time range is 7 days.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The readTimeWindow.
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.TimeWindow getReadTimeWindow() {
    if (timeCase_ == 7) {
      return (com.google.cloud.asset.v1.TimeWindow) time_;
    }
    return com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Optional. [start_time] is required. [start_time] must be less than
   * [end_time] Defaults [end_time] to now if [start_time] is set and
   * [end_time] isn't. Maximum permitted time range is 7 days.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
    if (timeCase_ == 7) {
      return (com.google.cloud.asset.v1.TimeWindow) time_;
    }
    return com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
  }

  public static final int READ_TIME_FIELD_NUMBER = 8;
  /**
   *
   *
   * <pre>
   * Optional. Queries cloud assets as they appeared at the specified point in
   * time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the readTime field is set.
   */
  @java.lang.Override
  public boolean hasReadTime() {
    return timeCase_ == 8;
  }
  /**
   *
   *
   * <pre>
   * Optional. Queries cloud assets as they appeared at the specified point in
   * time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The readTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getReadTime() {
    if (timeCase_ == 8) {
      return (com.google.protobuf.Timestamp) time_;
    }
    return com.google.protobuf.Timestamp.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Optional. Queries cloud assets as they appeared at the specified point in
   * time.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
    if (timeCase_ == 8) {
      return (com.google.protobuf.Timestamp) time_;
    }
    return com.google.protobuf.Timestamp.getDefaultInstance();
  }

  public static final int OUTPUT_CONFIG_FIELD_NUMBER = 9;
  private com.google.cloud.asset.v1.QueryAssetsOutputConfig outputConfig_;
  /**
   *
   *
   * <pre>
   * Optional. Destination where the query results will be saved.
   * When this field is specified, the query results won't be saved in the
   * [QueryAssetsResponse.query_result]. Instead
   * [QueryAssetsResponse.output_config] will be set.
   * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
   * to check the status of the query job when passed to a following
   * [QueryAssets] API call.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the outputConfig field is set.
   */
  @java.lang.Override
  public boolean hasOutputConfig() {
    return outputConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Optional. Destination where the query results will be saved.
   * When this field is specified, the query results won't be saved in the
   * [QueryAssetsResponse.query_result]. Instead
   * [QueryAssetsResponse.output_config] will be set.
   * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
   * to check the status of the query job when passed to a following
   * [QueryAssets] API call.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The outputConfig.
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.QueryAssetsOutputConfig getOutputConfig() {
    return outputConfig_ == null
        ? com.google.cloud.asset.v1.QueryAssetsOutputConfig.getDefaultInstance()
        : outputConfig_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Destination where the query results will be saved.
   * When this field is specified, the query results won't be saved in the
   * [QueryAssetsResponse.query_result]. Instead
   * [QueryAssetsResponse.output_config] will be set.
   * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
   * to check the status of the query job when passed to a following
   * [QueryAssets] API call.
   * </pre>
   *
   * <code>
   * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.asset.v1.QueryAssetsOutputConfigOrBuilder getOutputConfigOrBuilder() {
    return outputConfig_ == null
        ? com.google.cloud.asset.v1.QueryAssetsOutputConfig.getDefaultInstance()
        : outputConfig_;
  }

  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_);
    }
    if (queryCase_ == 2) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_);
    }
    if (queryCase_ == 3) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_);
    }
    if (pageSize_ != 0) {
      output.writeInt32(4, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_);
    }
    if (timeout_ != null) {
      output.writeMessage(6, getTimeout());
    }
    if (timeCase_ == 7) {
      output.writeMessage(7, (com.google.cloud.asset.v1.TimeWindow) time_);
    }
    if (timeCase_ == 8) {
      output.writeMessage(8, (com.google.protobuf.Timestamp) time_);
    }
    if (outputConfig_ != null) {
      output.writeMessage(9, getOutputConfig());
    }
    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_);
    }
    if (queryCase_ == 2) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_);
    }
    if (queryCase_ == 3) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, query_);
    }
    if (pageSize_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_);
    }
    if (timeout_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getTimeout());
    }
    if (timeCase_ == 7) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              7, (com.google.cloud.asset.v1.TimeWindow) time_);
    }
    if (timeCase_ == 8) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              8, (com.google.protobuf.Timestamp) time_);
    }
    if (outputConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getOutputConfig());
    }
    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.QueryAssetsRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.asset.v1.QueryAssetsRequest other =
        (com.google.cloud.asset.v1.QueryAssetsRequest) obj;

    if (!getParent().equals(other.getParent())) return false;
    if (getPageSize() != other.getPageSize()) return false;
    if (!getPageToken().equals(other.getPageToken())) return false;
    if (hasTimeout() != other.hasTimeout()) return false;
    if (hasTimeout()) {
      if (!getTimeout().equals(other.getTimeout())) return false;
    }
    if (hasOutputConfig() != other.hasOutputConfig()) return false;
    if (hasOutputConfig()) {
      if (!getOutputConfig().equals(other.getOutputConfig())) return false;
    }
    if (!getQueryCase().equals(other.getQueryCase())) return false;
    switch (queryCase_) {
      case 2:
        if (!getStatement().equals(other.getStatement())) return false;
        break;
      case 3:
        if (!getJobReference().equals(other.getJobReference())) return false;
        break;
      case 0:
      default:
    }
    if (!getTimeCase().equals(other.getTimeCase())) return false;
    switch (timeCase_) {
      case 7:
        if (!getReadTimeWindow().equals(other.getReadTimeWindow())) return false;
        break;
      case 8:
        if (!getReadTime().equals(other.getReadTime())) return false;
        break;
      case 0:
      default:
    }
    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();
    hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + getPageSize();
    hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
    hash = (53 * hash) + getPageToken().hashCode();
    if (hasTimeout()) {
      hash = (37 * hash) + TIMEOUT_FIELD_NUMBER;
      hash = (53 * hash) + getTimeout().hashCode();
    }
    if (hasOutputConfig()) {
      hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getOutputConfig().hashCode();
    }
    switch (queryCase_) {
      case 2:
        hash = (37 * hash) + STATEMENT_FIELD_NUMBER;
        hash = (53 * hash) + getStatement().hashCode();
        break;
      case 3:
        hash = (37 * hash) + JOB_REFERENCE_FIELD_NUMBER;
        hash = (53 * hash) + getJobReference().hashCode();
        break;
      case 0:
      default:
    }
    switch (timeCase_) {
      case 7:
        hash = (37 * hash) + READ_TIME_WINDOW_FIELD_NUMBER;
        hash = (53 * hash) + getReadTimeWindow().hashCode();
        break;
      case 8:
        hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
        hash = (53 * hash) + getReadTime().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

    // Construct using com.google.cloud.asset.v1.QueryAssetsRequest.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      parent_ = "";
      pageSize_ = 0;
      pageToken_ = "";
      timeout_ = null;
      if (timeoutBuilder_ != null) {
        timeoutBuilder_.dispose();
        timeoutBuilder_ = null;
      }
      if (readTimeWindowBuilder_ != null) {
        readTimeWindowBuilder_.clear();
      }
      if (readTimeBuilder_ != null) {
        readTimeBuilder_.clear();
      }
      outputConfig_ = null;
      if (outputConfigBuilder_ != null) {
        outputConfigBuilder_.dispose();
        outputConfigBuilder_ = null;
      }
      queryCase_ = 0;
      query_ = null;
      timeCase_ = 0;
      time_ = 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_QueryAssetsRequest_descriptor;
    }

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

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

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

    private void buildPartial0(com.google.cloud.asset.v1.QueryAssetsRequest result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.parent_ = parent_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.pageSize_ = pageSize_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.pageToken_ = pageToken_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.timeout_ = timeoutBuilder_ == null ? timeout_ : timeoutBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.outputConfig_ =
            outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build();
      }
    }

    private void buildPartialOneofs(com.google.cloud.asset.v1.QueryAssetsRequest result) {
      result.queryCase_ = queryCase_;
      result.query_ = this.query_;
      result.timeCase_ = timeCase_;
      result.time_ = this.time_;
      if (timeCase_ == 7 && readTimeWindowBuilder_ != null) {
        result.time_ = readTimeWindowBuilder_.build();
      }
      if (timeCase_ == 8 && readTimeBuilder_ != null) {
        result.time_ = readTimeBuilder_.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.QueryAssetsRequest) {
        return mergeFrom((com.google.cloud.asset.v1.QueryAssetsRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.asset.v1.QueryAssetsRequest other) {
      if (other == com.google.cloud.asset.v1.QueryAssetsRequest.getDefaultInstance()) return this;
      if (!other.getParent().isEmpty()) {
        parent_ = other.parent_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.getPageSize() != 0) {
        setPageSize(other.getPageSize());
      }
      if (!other.getPageToken().isEmpty()) {
        pageToken_ = other.pageToken_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (other.hasTimeout()) {
        mergeTimeout(other.getTimeout());
      }
      if (other.hasOutputConfig()) {
        mergeOutputConfig(other.getOutputConfig());
      }
      switch (other.getQueryCase()) {
        case STATEMENT:
          {
            queryCase_ = 2;
            query_ = other.query_;
            onChanged();
            break;
          }
        case JOB_REFERENCE:
          {
            queryCase_ = 3;
            query_ = other.query_;
            onChanged();
            break;
          }
        case QUERY_NOT_SET:
          {
            break;
          }
      }
      switch (other.getTimeCase()) {
        case READ_TIME_WINDOW:
          {
            mergeReadTimeWindow(other.getReadTimeWindow());
            break;
          }
        case READ_TIME:
          {
            mergeReadTime(other.getReadTime());
            break;
          }
        case TIME_NOT_SET:
          {
            break;
          }
      }
      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();
                queryCase_ = 2;
                query_ = s;
                break;
              } // case 18
            case 26:
              {
                java.lang.String s = input.readStringRequireUtf8();
                queryCase_ = 3;
                query_ = s;
                break;
              } // case 26
            case 32:
              {
                pageSize_ = input.readInt32();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
            case 42:
              {
                pageToken_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 50:
              {
                input.readMessage(getTimeoutFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000020;
                break;
              } // case 50
            case 58:
              {
                input.readMessage(getReadTimeWindowFieldBuilder().getBuilder(), extensionRegistry);
                timeCase_ = 7;
                break;
              } // case 58
            case 66:
              {
                input.readMessage(getReadTimeFieldBuilder().getBuilder(), extensionRegistry);
                timeCase_ = 8;
                break;
              } // case 66
            case 74:
              {
                input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000100;
                break;
              } // case 74
            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 queryCase_ = 0;
    private java.lang.Object query_;

    public QueryCase getQueryCase() {
      return QueryCase.forNumber(queryCase_);
    }

    public Builder clearQuery() {
      queryCase_ = 0;
      query_ = null;
      onChanged();
      return this;
    }

    private int timeCase_ = 0;
    private java.lang.Object time_;

    public TimeCase getTimeCase() {
      return TimeCase.forNumber(timeCase_);
    }

    public Builder clearTime() {
      timeCase_ = 0;
      time_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object parent_ = "";
    /**
     *
     *
     * <pre>
     * Required. The relative name of the root asset. This 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"),
     * or a folder number (such as "folders/123").
     * Only assets belonging to the `parent` will be returned.
     * </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. This 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"),
     * or a folder number (such as "folders/123").
     * Only assets belonging to the `parent` will be returned.
     * </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. This 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"),
     * or a folder number (such as "folders/123").
     * Only assets belonging to the `parent` will be returned.
     * </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. This 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"),
     * or a folder number (such as "folders/123").
     * Only assets belonging to the `parent` will be returned.
     * </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. This 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"),
     * or a folder number (such as "folders/123").
     * Only assets belonging to the `parent` will be returned.
     * </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;
    }

    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return Whether the statement field is set.
     */
    @java.lang.Override
    public boolean hasStatement() {
      return queryCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The statement.
     */
    @java.lang.Override
    public java.lang.String getStatement() {
      java.lang.Object ref = "";
      if (queryCase_ == 2) {
        ref = query_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (queryCase_ == 2) {
          query_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for statement.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getStatementBytes() {
      java.lang.Object ref = "";
      if (queryCase_ == 2) {
        ref = query_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (queryCase_ == 2) {
          query_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The statement to set.
     * @return This builder for chaining.
     */
    public Builder setStatement(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      queryCase_ = 2;
      query_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearStatement() {
      if (queryCase_ == 2) {
        queryCase_ = 0;
        query_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A SQL statement that's compatible with [BigQuery Standard
     * SQL](http://cloud/bigquery/docs/reference/standard-sql/enabling-standard-sql).
     * </pre>
     *
     * <code>string statement = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for statement to set.
     * @return This builder for chaining.
     */
    public Builder setStatementBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      queryCase_ = 2;
      query_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return Whether the jobReference field is set.
     */
    @java.lang.Override
    public boolean hasJobReference() {
      return queryCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The jobReference.
     */
    @java.lang.Override
    public java.lang.String getJobReference() {
      java.lang.Object ref = "";
      if (queryCase_ == 3) {
        ref = query_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (queryCase_ == 3) {
          query_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for jobReference.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getJobReferenceBytes() {
      java.lang.Object ref = "";
      if (queryCase_ == 3) {
        ref = query_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (queryCase_ == 3) {
          query_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The jobReference to set.
     * @return This builder for chaining.
     */
    public Builder setJobReference(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      queryCase_ = 3;
      query_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearJobReference() {
      if (queryCase_ == 3) {
        queryCase_ = 0;
        query_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Reference to the query job, which is from the
     * `QueryAssetsResponse` of previous `QueryAssets` call.
     * </pre>
     *
     * <code>string job_reference = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for jobReference to set.
     * @return This builder for chaining.
     */
    public Builder setJobReferenceBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      queryCase_ = 3;
      query_ = value;
      onChanged();
      return this;
    }

    private int pageSize_;
    /**
     *
     *
     * <pre>
     * Optional. The maximum number of rows to return in the results. Responses
     * are limited to 10 MB and 1000 rows.
     * By default, the maximum row count is 1000. When the byte or row count limit
     * is reached, the rest of the query results will be paginated.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The pageSize.
     */
    @java.lang.Override
    public int getPageSize() {
      return pageSize_;
    }
    /**
     *
     *
     * <pre>
     * Optional. The maximum number of rows to return in the results. Responses
     * are limited to 10 MB and 1000 rows.
     * By default, the maximum row count is 1000. When the byte or row count limit
     * is reached, the rest of the query results will be paginated.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The pageSize to set.
     * @return This builder for chaining.
     */
    public Builder setPageSize(int value) {

      pageSize_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The maximum number of rows to return in the results. Responses
     * are limited to 10 MB and 1000 rows.
     * By default, the maximum row count is 1000. When the byte or row count limit
     * is reached, the rest of the query results will be paginated.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageSize() {
      bitField0_ = (bitField0_ & ~0x00000008);
      pageSize_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object pageToken_ = "";
    /**
     *
     *
     * <pre>
     * Optional. A page token received from previous `QueryAssets`.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The pageToken.
     */
    public java.lang.String getPageToken() {
      java.lang.Object ref = pageToken_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pageToken_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A page token received from previous `QueryAssets`.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for pageToken.
     */
    public com.google.protobuf.ByteString getPageTokenBytes() {
      java.lang.Object ref = pageToken_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pageToken_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. A page token received from previous `QueryAssets`.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageToken(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      pageToken_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A page token received from previous `QueryAssets`.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPageToken() {
      pageToken_ = getDefaultInstance().getPageToken();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. A page token received from previous `QueryAssets`.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>string page_token = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for pageToken to set.
     * @return This builder for chaining.
     */
    public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      pageToken_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private com.google.protobuf.Duration timeout_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        timeoutBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return Whether the timeout field is set.
     */
    public boolean hasTimeout() {
      return ((bitField0_ & 0x00000020) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The timeout.
     */
    public com.google.protobuf.Duration getTimeout() {
      if (timeoutBuilder_ == null) {
        return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
      } else {
        return timeoutBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setTimeout(com.google.protobuf.Duration value) {
      if (timeoutBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        timeout_ = value;
      } else {
        timeoutBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) {
      if (timeoutBuilder_ == null) {
        timeout_ = builderForValue.build();
      } else {
        timeoutBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder mergeTimeout(com.google.protobuf.Duration value) {
      if (timeoutBuilder_ == null) {
        if (((bitField0_ & 0x00000020) != 0)
            && timeout_ != null
            && timeout_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getTimeoutBuilder().mergeFrom(value);
        } else {
          timeout_ = value;
        }
      } else {
        timeoutBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder clearTimeout() {
      bitField0_ = (bitField0_ & ~0x00000020);
      timeout_ = null;
      if (timeoutBuilder_ != null) {
        timeoutBuilder_.dispose();
        timeoutBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public com.google.protobuf.Duration.Builder getTimeoutBuilder() {
      bitField0_ |= 0x00000020;
      onChanged();
      return getTimeoutFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() {
      if (timeoutBuilder_ != null) {
        return timeoutBuilder_.getMessageOrBuilder();
      } else {
        return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Specifies the maximum amount of time that the client is willing
     * to wait for the query to complete. By default, this limit is 5 min for the
     * first query, and 1 minute for the following queries. If the query is
     * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise
     * false.
     * Like BigQuery [jobs.query
     * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest)
     * The call is not guaranteed to wait for the specified timeout; it typically
     * returns after around 200 seconds (200,000 milliseconds), even if the query
     * is not complete.
     * The field will be ignored when [output_config] is specified.
     * </pre>
     *
     * <code>.google.protobuf.Duration timeout = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getTimeoutFieldBuilder() {
      if (timeoutBuilder_ == null) {
        timeoutBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getTimeout(), getParentForChildren(), isClean());
        timeout_ = null;
      }
      return timeoutBuilder_;
    }

    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. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the readTimeWindow field is set.
     */
    @java.lang.Override
    public boolean hasReadTimeWindow() {
      return timeCase_ == 7;
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The readTimeWindow.
     */
    @java.lang.Override
    public com.google.cloud.asset.v1.TimeWindow getReadTimeWindow() {
      if (readTimeWindowBuilder_ == null) {
        if (timeCase_ == 7) {
          return (com.google.cloud.asset.v1.TimeWindow) time_;
        }
        return com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
      } else {
        if (timeCase_ == 7) {
          return readTimeWindowBuilder_.getMessage();
        }
        return com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.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();
        }
        time_ = value;
        onChanged();
      } else {
        readTimeWindowBuilder_.setMessage(value);
      }
      timeCase_ = 7;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setReadTimeWindow(com.google.cloud.asset.v1.TimeWindow.Builder builderForValue) {
      if (readTimeWindowBuilder_ == null) {
        time_ = builderForValue.build();
        onChanged();
      } else {
        readTimeWindowBuilder_.setMessage(builderForValue.build());
      }
      timeCase_ = 7;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeReadTimeWindow(com.google.cloud.asset.v1.TimeWindow value) {
      if (readTimeWindowBuilder_ == null) {
        if (timeCase_ == 7 && time_ != com.google.cloud.asset.v1.TimeWindow.getDefaultInstance()) {
          time_ =
              com.google.cloud.asset.v1.TimeWindow.newBuilder(
                      (com.google.cloud.asset.v1.TimeWindow) time_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          time_ = value;
        }
        onChanged();
      } else {
        if (timeCase_ == 7) {
          readTimeWindowBuilder_.mergeFrom(value);
        } else {
          readTimeWindowBuilder_.setMessage(value);
        }
      }
      timeCase_ = 7;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearReadTimeWindow() {
      if (readTimeWindowBuilder_ == null) {
        if (timeCase_ == 7) {
          timeCase_ = 0;
          time_ = null;
          onChanged();
        }
      } else {
        if (timeCase_ == 7) {
          timeCase_ = 0;
          time_ = null;
        }
        readTimeWindowBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.asset.v1.TimeWindow.Builder getReadTimeWindowBuilder() {
      return getReadTimeWindowFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.asset.v1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
      if ((timeCase_ == 7) && (readTimeWindowBuilder_ != null)) {
        return readTimeWindowBuilder_.getMessageOrBuilder();
      } else {
        if (timeCase_ == 7) {
          return (com.google.cloud.asset.v1.TimeWindow) time_;
        }
        return com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. [start_time] is required. [start_time] must be less than
     * [end_time] Defaults [end_time] to now if [start_time] is set and
     * [end_time] isn't. Maximum permitted time range is 7 days.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.TimeWindow read_time_window = 7 [(.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) {
        if (!(timeCase_ == 7)) {
          time_ = com.google.cloud.asset.v1.TimeWindow.getDefaultInstance();
        }
        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>(
                (com.google.cloud.asset.v1.TimeWindow) time_, getParentForChildren(), isClean());
        time_ = null;
      }
      timeCase_ = 7;
      onChanged();
      return readTimeWindowBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        readTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the readTime field is set.
     */
    @java.lang.Override
    public boolean hasReadTime() {
      return timeCase_ == 8;
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The readTime.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getReadTime() {
      if (readTimeBuilder_ == null) {
        if (timeCase_ == 8) {
          return (com.google.protobuf.Timestamp) time_;
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      } else {
        if (timeCase_ == 8) {
          return readTimeBuilder_.getMessage();
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setReadTime(com.google.protobuf.Timestamp value) {
      if (readTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        time_ = value;
        onChanged();
      } else {
        readTimeBuilder_.setMessage(value);
      }
      timeCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (readTimeBuilder_ == null) {
        time_ = builderForValue.build();
        onChanged();
      } else {
        readTimeBuilder_.setMessage(builderForValue.build());
      }
      timeCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
      if (readTimeBuilder_ == null) {
        if (timeCase_ == 8 && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          time_ =
              com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) time_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          time_ = value;
        }
        onChanged();
      } else {
        if (timeCase_ == 8) {
          readTimeBuilder_.mergeFrom(value);
        } else {
          readTimeBuilder_.setMessage(value);
        }
      }
      timeCase_ = 8;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearReadTime() {
      if (readTimeBuilder_ == null) {
        if (timeCase_ == 8) {
          timeCase_ = 0;
          time_ = null;
          onChanged();
        }
      } else {
        if (timeCase_ == 8) {
          timeCase_ = 0;
          time_ = null;
        }
        readTimeBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
      return getReadTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
      if ((timeCase_ == 8) && (readTimeBuilder_ != null)) {
        return readTimeBuilder_.getMessageOrBuilder();
      } else {
        if (timeCase_ == 8) {
          return (com.google.protobuf.Timestamp) time_;
        }
        return com.google.protobuf.Timestamp.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Queries cloud assets as they appeared at the specified point in
     * time.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp read_time = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getReadTimeFieldBuilder() {
      if (readTimeBuilder_ == null) {
        if (!(timeCase_ == 8)) {
          time_ = com.google.protobuf.Timestamp.getDefaultInstance();
        }
        readTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                (com.google.protobuf.Timestamp) time_, getParentForChildren(), isClean());
        time_ = null;
      }
      timeCase_ = 8;
      onChanged();
      return readTimeBuilder_;
    }

    private com.google.cloud.asset.v1.QueryAssetsOutputConfig outputConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.QueryAssetsOutputConfig,
            com.google.cloud.asset.v1.QueryAssetsOutputConfig.Builder,
            com.google.cloud.asset.v1.QueryAssetsOutputConfigOrBuilder>
        outputConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the outputConfig field is set.
     */
    public boolean hasOutputConfig() {
      return ((bitField0_ & 0x00000100) != 0);
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The outputConfig.
     */
    public com.google.cloud.asset.v1.QueryAssetsOutputConfig getOutputConfig() {
      if (outputConfigBuilder_ == null) {
        return outputConfig_ == null
            ? com.google.cloud.asset.v1.QueryAssetsOutputConfig.getDefaultInstance()
            : outputConfig_;
      } else {
        return outputConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setOutputConfig(com.google.cloud.asset.v1.QueryAssetsOutputConfig value) {
      if (outputConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        outputConfig_ = value;
      } else {
        outputConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setOutputConfig(
        com.google.cloud.asset.v1.QueryAssetsOutputConfig.Builder builderForValue) {
      if (outputConfigBuilder_ == null) {
        outputConfig_ = builderForValue.build();
      } else {
        outputConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeOutputConfig(com.google.cloud.asset.v1.QueryAssetsOutputConfig value) {
      if (outputConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)
            && outputConfig_ != null
            && outputConfig_
                != com.google.cloud.asset.v1.QueryAssetsOutputConfig.getDefaultInstance()) {
          getOutputConfigBuilder().mergeFrom(value);
        } else {
          outputConfig_ = value;
        }
      } else {
        outputConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearOutputConfig() {
      bitField0_ = (bitField0_ & ~0x00000100);
      outputConfig_ = null;
      if (outputConfigBuilder_ != null) {
        outputConfigBuilder_.dispose();
        outputConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.asset.v1.QueryAssetsOutputConfig.Builder getOutputConfigBuilder() {
      bitField0_ |= 0x00000100;
      onChanged();
      return getOutputConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.cloud.asset.v1.QueryAssetsOutputConfigOrBuilder getOutputConfigOrBuilder() {
      if (outputConfigBuilder_ != null) {
        return outputConfigBuilder_.getMessageOrBuilder();
      } else {
        return outputConfig_ == null
            ? com.google.cloud.asset.v1.QueryAssetsOutputConfig.getDefaultInstance()
            : outputConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Destination where the query results will be saved.
     * When this field is specified, the query results won't be saved in the
     * [QueryAssetsResponse.query_result]. Instead
     * [QueryAssetsResponse.output_config] will be set.
     * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used
     * to check the status of the query job when passed to a following
     * [QueryAssets] API call.
     * </pre>
     *
     * <code>
     * .google.cloud.asset.v1.QueryAssetsOutputConfig output_config = 9 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.asset.v1.QueryAssetsOutputConfig,
            com.google.cloud.asset.v1.QueryAssetsOutputConfig.Builder,
            com.google.cloud.asset.v1.QueryAssetsOutputConfigOrBuilder>
        getOutputConfigFieldBuilder() {
      if (outputConfigBuilder_ == null) {
        outputConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.asset.v1.QueryAssetsOutputConfig,
                com.google.cloud.asset.v1.QueryAssetsOutputConfig.Builder,
                com.google.cloud.asset.v1.QueryAssetsOutputConfigOrBuilder>(
                getOutputConfig(), getParentForChildren(), isClean());
        outputConfig_ = null;
      }
      return outputConfigBuilder_;
    }

    @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.QueryAssetsRequest)
  }

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

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

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

  private static final com.google.protobuf.Parser<QueryAssetsRequest> PARSER =
      new com.google.protobuf.AbstractParser<QueryAssetsRequest>() {
        @java.lang.Override
        public QueryAssetsRequest 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<QueryAssetsRequest> parser() {
    return PARSER;
  }

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

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