/*
 * Copyright 2025 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/bigquery/storage/v1beta1/read_options.proto

// Protobuf Java Version: 3.25.8
package com.google.cloud.bigquery.storage.v1beta1;

public final class ReadOptions {
  private ReadOptions() {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}

  public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
  }

  public interface TableReadOptionsOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.bigquery.storage.v1beta1.TableReadOptions)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @return A list containing the selectedFields.
     */
    java.util.List<java.lang.String> getSelectedFieldsList();

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @return The count of selectedFields.
     */
    int getSelectedFieldsCount();

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The selectedFields at the given index.
     */
    java.lang.String getSelectedFields(int index);

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the selectedFields at the given index.
     */
    com.google.protobuf.ByteString getSelectedFieldsBytes(int index);

    /**
     *
     *
     * <pre>
     * Optional. SQL text filtering statement, similar to a WHERE clause in
     * a SQL query. Aggregates are not supported.
     *
     * Examples: "int_field &gt; 5"
     *           "date_field = CAST('2014-9-27' as DATE)"
     *           "nullable_field is not NULL"
     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
     *           "numeric_field BETWEEN 1.0 AND 5.0"
     *
     * Restricted to a maximum length for 1 MB.
     * </pre>
     *
     * <code>string row_restriction = 2;</code>
     *
     * @return The rowRestriction.
     */
    java.lang.String getRowRestriction();

    /**
     *
     *
     * <pre>
     * Optional. SQL text filtering statement, similar to a WHERE clause in
     * a SQL query. Aggregates are not supported.
     *
     * Examples: "int_field &gt; 5"
     *           "date_field = CAST('2014-9-27' as DATE)"
     *           "nullable_field is not NULL"
     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
     *           "numeric_field BETWEEN 1.0 AND 5.0"
     *
     * Restricted to a maximum length for 1 MB.
     * </pre>
     *
     * <code>string row_restriction = 2;</code>
     *
     * @return The bytes for rowRestriction.
     */
    com.google.protobuf.ByteString getRowRestrictionBytes();
  }

  /**
   *
   *
   * <pre>
   * Options dictating how we read a table.
   * </pre>
   *
   * Protobuf type {@code google.cloud.bigquery.storage.v1beta1.TableReadOptions}
   */
  public static final class TableReadOptions extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.bigquery.storage.v1beta1.TableReadOptions)
      TableReadOptionsOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use TableReadOptions.newBuilder() to construct.
    private TableReadOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private TableReadOptions() {
      selectedFields_ = com.google.protobuf.LazyStringArrayList.emptyList();
      rowRestriction_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.bigquery.storage.v1beta1.ReadOptions
          .internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.bigquery.storage.v1beta1.ReadOptions
          .internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions.class,
              com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions.Builder.class);
    }

    public static final int SELECTED_FIELDS_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private com.google.protobuf.LazyStringArrayList selectedFields_ =
        com.google.protobuf.LazyStringArrayList.emptyList();

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @return A list containing the selectedFields.
     */
    public com.google.protobuf.ProtocolStringList getSelectedFieldsList() {
      return selectedFields_;
    }

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @return The count of selectedFields.
     */
    public int getSelectedFieldsCount() {
      return selectedFields_.size();
    }

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The selectedFields at the given index.
     */
    public java.lang.String getSelectedFields(int index) {
      return selectedFields_.get(index);
    }

    /**
     *
     *
     * <pre>
     * Optional. The names of the fields in the table to be returned. If no
     * field names are specified, then all fields in the table are returned.
     *
     * Nested fields -- the child elements of a STRUCT field -- can be selected
     * individually using their fully-qualified names, and will be returned as
     * record fields containing only the selected nested fields. If a STRUCT
     * field is specified in the selected fields list, all of the child elements
     * will be returned.
     *
     * As an example, consider a table with the following schema:
     *
     *   {
     *       "name": "struct_field",
     *       "type": "RECORD",
     *       "mode": "NULLABLE",
     *       "fields": [
     *           {
     *               "name": "string_field1",
     *               "type": "STRING",
     * .              "mode": "NULLABLE"
     *           },
     *           {
     *               "name": "string_field2",
     *               "type": "STRING",
     *               "mode": "NULLABLE"
     *           }
     *       ]
     *   }
     *
     * Specifying "struct_field" in the selected fields list will result in a
     * read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *       string_field2
     *   }
     *
     * Specifying "struct_field.string_field1" in the selected fields list will
     * result in a read session schema with the following logical structure:
     *
     *   struct_field {
     *       string_field1
     *   }
     *
     * The order of the fields in the read session schema is derived from the
     * table schema and does not correspond to the order in which the fields are
     * specified in this list.
     * </pre>
     *
     * <code>repeated string selected_fields = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the selectedFields at the given index.
     */
    public com.google.protobuf.ByteString getSelectedFieldsBytes(int index) {
      return selectedFields_.getByteString(index);
    }

    public static final int ROW_RESTRICTION_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object rowRestriction_ = "";

    /**
     *
     *
     * <pre>
     * Optional. SQL text filtering statement, similar to a WHERE clause in
     * a SQL query. Aggregates are not supported.
     *
     * Examples: "int_field &gt; 5"
     *           "date_field = CAST('2014-9-27' as DATE)"
     *           "nullable_field is not NULL"
     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
     *           "numeric_field BETWEEN 1.0 AND 5.0"
     *
     * Restricted to a maximum length for 1 MB.
     * </pre>
     *
     * <code>string row_restriction = 2;</code>
     *
     * @return The rowRestriction.
     */
    @java.lang.Override
    public java.lang.String getRowRestriction() {
      java.lang.Object ref = rowRestriction_;
      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();
        rowRestriction_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. SQL text filtering statement, similar to a WHERE clause in
     * a SQL query. Aggregates are not supported.
     *
     * Examples: "int_field &gt; 5"
     *           "date_field = CAST('2014-9-27' as DATE)"
     *           "nullable_field is not NULL"
     *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
     *           "numeric_field BETWEEN 1.0 AND 5.0"
     *
     * Restricted to a maximum length for 1 MB.
     * </pre>
     *
     * <code>string row_restriction = 2;</code>
     *
     * @return The bytes for rowRestriction.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getRowRestrictionBytes() {
      java.lang.Object ref = rowRestriction_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        rowRestriction_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      for (int i = 0; i < selectedFields_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selectedFields_.getRaw(i));
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rowRestriction_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, rowRestriction_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      {
        int dataSize = 0;
        for (int i = 0; i < selectedFields_.size(); i++) {
          dataSize += computeStringSizeNoTag(selectedFields_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getSelectedFieldsList().size();
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(rowRestriction_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, rowRestriction_);
      }
      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.bigquery.storage.v1beta1.ReadOptions.TableReadOptions)) {
        return super.equals(obj);
      }
      com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions other =
          (com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions) obj;

      if (!getSelectedFieldsList().equals(other.getSelectedFieldsList())) return false;
      if (!getRowRestriction().equals(other.getRowRestriction())) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getSelectedFieldsCount() > 0) {
        hash = (37 * hash) + SELECTED_FIELDS_FIELD_NUMBER;
        hash = (53 * hash) + getSelectedFieldsList().hashCode();
      }
      hash = (37 * hash) + ROW_RESTRICTION_FIELD_NUMBER;
      hash = (53 * hash) + getRowRestriction().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions 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.bigquery.storage.v1beta1.ReadOptions.TableReadOptions parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions 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.bigquery.storage.v1beta1.ReadOptions.TableReadOptions parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

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

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

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions 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.bigquery.storage.v1beta1.ReadOptions.TableReadOptions 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>
     * Options dictating how we read a table.
     * </pre>
     *
     * Protobuf type {@code google.cloud.bigquery.storage.v1beta1.TableReadOptions}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.bigquery.storage.v1beta1.TableReadOptions)
        com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptionsOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.bigquery.storage.v1beta1.ReadOptions
            .internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.bigquery.storage.v1beta1.ReadOptions
            .internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions.class,
                com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        selectedFields_ = com.google.protobuf.LazyStringArrayList.emptyList();
        rowRestriction_ = "";
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.bigquery.storage.v1beta1.ReadOptions
            .internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
          getDefaultInstanceForType() {
        return com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions build() {
        com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions buildPartial() {
        com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions result =
            new com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          selectedFields_.makeImmutable();
          result.selectedFields_ = selectedFields_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.rowRestriction_ = rowRestriction_;
        }
      }

      @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.bigquery.storage.v1beta1.ReadOptions.TableReadOptions) {
          return mergeFrom(
              (com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions other) {
        if (other
            == com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
                .getDefaultInstance()) return this;
        if (!other.selectedFields_.isEmpty()) {
          if (selectedFields_.isEmpty()) {
            selectedFields_ = other.selectedFields_;
            bitField0_ |= 0x00000001;
          } else {
            ensureSelectedFieldsIsMutable();
            selectedFields_.addAll(other.selectedFields_);
          }
          onChanged();
        }
        if (!other.getRowRestriction().isEmpty()) {
          rowRestriction_ = other.rowRestriction_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10:
                {
                  java.lang.String s = input.readStringRequireUtf8();
                  ensureSelectedFieldsIsMutable();
                  selectedFields_.add(s);
                  break;
                } // case 10
              case 18:
                {
                  rowRestriction_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              default:
                {
                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                    done = true; // was an endgroup tag
                  }
                  break;
                } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }

      private int bitField0_;

      private com.google.protobuf.LazyStringArrayList selectedFields_ =
          com.google.protobuf.LazyStringArrayList.emptyList();

      private void ensureSelectedFieldsIsMutable() {
        if (!selectedFields_.isModifiable()) {
          selectedFields_ = new com.google.protobuf.LazyStringArrayList(selectedFields_);
        }
        bitField0_ |= 0x00000001;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @return A list containing the selectedFields.
       */
      public com.google.protobuf.ProtocolStringList getSelectedFieldsList() {
        selectedFields_.makeImmutable();
        return selectedFields_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @return The count of selectedFields.
       */
      public int getSelectedFieldsCount() {
        return selectedFields_.size();
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param index The index of the element to return.
       * @return The selectedFields at the given index.
       */
      public java.lang.String getSelectedFields(int index) {
        return selectedFields_.get(index);
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param index The index of the value to return.
       * @return The bytes of the selectedFields at the given index.
       */
      public com.google.protobuf.ByteString getSelectedFieldsBytes(int index) {
        return selectedFields_.getByteString(index);
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param index The index to set the value at.
       * @param value The selectedFields to set.
       * @return This builder for chaining.
       */
      public Builder setSelectedFields(int index, java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSelectedFieldsIsMutable();
        selectedFields_.set(index, value);
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param value The selectedFields to add.
       * @return This builder for chaining.
       */
      public Builder addSelectedFields(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSelectedFieldsIsMutable();
        selectedFields_.add(value);
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param values The selectedFields to add.
       * @return This builder for chaining.
       */
      public Builder addAllSelectedFields(java.lang.Iterable<java.lang.String> values) {
        ensureSelectedFieldsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, selectedFields_);
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearSelectedFields() {
        selectedFields_ = com.google.protobuf.LazyStringArrayList.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        ;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The names of the fields in the table to be returned. If no
       * field names are specified, then all fields in the table are returned.
       *
       * Nested fields -- the child elements of a STRUCT field -- can be selected
       * individually using their fully-qualified names, and will be returned as
       * record fields containing only the selected nested fields. If a STRUCT
       * field is specified in the selected fields list, all of the child elements
       * will be returned.
       *
       * As an example, consider a table with the following schema:
       *
       *   {
       *       "name": "struct_field",
       *       "type": "RECORD",
       *       "mode": "NULLABLE",
       *       "fields": [
       *           {
       *               "name": "string_field1",
       *               "type": "STRING",
       * .              "mode": "NULLABLE"
       *           },
       *           {
       *               "name": "string_field2",
       *               "type": "STRING",
       *               "mode": "NULLABLE"
       *           }
       *       ]
       *   }
       *
       * Specifying "struct_field" in the selected fields list will result in a
       * read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *       string_field2
       *   }
       *
       * Specifying "struct_field.string_field1" in the selected fields list will
       * result in a read session schema with the following logical structure:
       *
       *   struct_field {
       *       string_field1
       *   }
       *
       * The order of the fields in the read session schema is derived from the
       * table schema and does not correspond to the order in which the fields are
       * specified in this list.
       * </pre>
       *
       * <code>repeated string selected_fields = 1;</code>
       *
       * @param value The bytes of the selectedFields to add.
       * @return This builder for chaining.
       */
      public Builder addSelectedFieldsBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        ensureSelectedFieldsIsMutable();
        selectedFields_.add(value);
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object rowRestriction_ = "";

      /**
       *
       *
       * <pre>
       * Optional. SQL text filtering statement, similar to a WHERE clause in
       * a SQL query. Aggregates are not supported.
       *
       * Examples: "int_field &gt; 5"
       *           "date_field = CAST('2014-9-27' as DATE)"
       *           "nullable_field is not NULL"
       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
       *           "numeric_field BETWEEN 1.0 AND 5.0"
       *
       * Restricted to a maximum length for 1 MB.
       * </pre>
       *
       * <code>string row_restriction = 2;</code>
       *
       * @return The rowRestriction.
       */
      public java.lang.String getRowRestriction() {
        java.lang.Object ref = rowRestriction_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          rowRestriction_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. SQL text filtering statement, similar to a WHERE clause in
       * a SQL query. Aggregates are not supported.
       *
       * Examples: "int_field &gt; 5"
       *           "date_field = CAST('2014-9-27' as DATE)"
       *           "nullable_field is not NULL"
       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
       *           "numeric_field BETWEEN 1.0 AND 5.0"
       *
       * Restricted to a maximum length for 1 MB.
       * </pre>
       *
       * <code>string row_restriction = 2;</code>
       *
       * @return The bytes for rowRestriction.
       */
      public com.google.protobuf.ByteString getRowRestrictionBytes() {
        java.lang.Object ref = rowRestriction_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          rowRestriction_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. SQL text filtering statement, similar to a WHERE clause in
       * a SQL query. Aggregates are not supported.
       *
       * Examples: "int_field &gt; 5"
       *           "date_field = CAST('2014-9-27' as DATE)"
       *           "nullable_field is not NULL"
       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
       *           "numeric_field BETWEEN 1.0 AND 5.0"
       *
       * Restricted to a maximum length for 1 MB.
       * </pre>
       *
       * <code>string row_restriction = 2;</code>
       *
       * @param value The rowRestriction to set.
       * @return This builder for chaining.
       */
      public Builder setRowRestriction(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        rowRestriction_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. SQL text filtering statement, similar to a WHERE clause in
       * a SQL query. Aggregates are not supported.
       *
       * Examples: "int_field &gt; 5"
       *           "date_field = CAST('2014-9-27' as DATE)"
       *           "nullable_field is not NULL"
       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
       *           "numeric_field BETWEEN 1.0 AND 5.0"
       *
       * Restricted to a maximum length for 1 MB.
       * </pre>
       *
       * <code>string row_restriction = 2;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRowRestriction() {
        rowRestriction_ = getDefaultInstance().getRowRestriction();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. SQL text filtering statement, similar to a WHERE clause in
       * a SQL query. Aggregates are not supported.
       *
       * Examples: "int_field &gt; 5"
       *           "date_field = CAST('2014-9-27' as DATE)"
       *           "nullable_field is not NULL"
       *           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
       *           "numeric_field BETWEEN 1.0 AND 5.0"
       *
       * Restricted to a maximum length for 1 MB.
       * </pre>
       *
       * <code>string row_restriction = 2;</code>
       *
       * @param value The bytes for rowRestriction to set.
       * @return This builder for chaining.
       */
      public Builder setRowRestrictionBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        rowRestriction_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.cloud.bigquery.storage.v1beta1.TableReadOptions)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.bigquery.storage.v1beta1.TableReadOptions)
    private static final com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions();
    }

    public static com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.cloud.bigquery.storage.v1beta1.ReadOptions.TableReadOptions
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor;
  private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
    return descriptor;
  }

  private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

  static {
    java.lang.String[] descriptorData = {
      "\n8google/cloud/bigquery/storage/v1beta1/"
          + "read_options.proto\022%google.cloud.bigquer"
          + "y.storage.v1beta1\"D\n\020TableReadOptions\022\027\n"
          + "\017selected_fields\030\001 \003(\t\022\027\n\017row_restrictio"
          + "n\030\002 \001(\tBp\n)com.google.cloud.bigquery.sto"
          + "rage.v1beta1ZCcloud.google.com/go/bigque"
          + "ry/storage/apiv1beta1/storagepb;storagep"
          + "bb\006proto3"
    };
    descriptor =
        com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
            descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {});
    internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor =
        getDescriptor().getMessageTypes().get(0);
    internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_fieldAccessorTable =
        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
            internal_static_google_cloud_bigquery_storage_v1beta1_TableReadOptions_descriptor,
            new java.lang.String[] {
              "SelectedFields", "RowRestriction",
            });
  }

  // @@protoc_insertion_point(outer_class_scope)
}
