Skip to content

Commit

Permalink
feat: add use_table_schema field to BigQueryConfig (googleapis#1838)
Browse files Browse the repository at this point in the history
* feat: add `use_table_schema` field to BigQueryConfig

PiperOrigin-RevId: 587079085

Source-Link: googleapis/googleapis@95fabe6

Source-Link: https://github.com/googleapis/googleapis-gen/commit/90b35e9d8bc6780a80db3bababefc29072fa3506
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTBiMzVlOWQ4YmM2NzgwYTgwZGIzYmFiYWJlZmMyOTA3MmZhMzUwNiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Dec 4, 2023
1 parent 8cfc23f commit 8653f4f
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ public com.google.protobuf.ByteString getTableBytes() {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand Down Expand Up @@ -431,6 +432,26 @@ public com.google.pubsub.v1.BigQueryConfig.State getState() {
return result == null ? com.google.pubsub.v1.BigQueryConfig.State.UNRECOGNIZED : result;
}

public static final int USE_TABLE_SCHEMA_FIELD_NUMBER = 6;
private boolean useTableSchema_ = false;
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
@java.lang.Override
public boolean getUseTableSchema() {
return useTableSchema_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -460,6 +481,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
output.writeEnum(5, state_);
}
if (useTableSchema_ != false) {
output.writeBool(6, useTableSchema_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -484,6 +508,9 @@ public int getSerializedSize() {
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_);
}
if (useTableSchema_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -504,6 +531,7 @@ public boolean equals(final java.lang.Object obj) {
if (getWriteMetadata() != other.getWriteMetadata()) return false;
if (getDropUnknownFields() != other.getDropUnknownFields()) return false;
if (state_ != other.state_) return false;
if (getUseTableSchema() != other.getUseTableSchema()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -525,6 +553,8 @@ public int hashCode() {
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDropUnknownFields());
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -668,6 +698,7 @@ public Builder clear() {
writeMetadata_ = false;
dropUnknownFields_ = false;
state_ = 0;
useTableSchema_ = false;
return this;
}

Expand Down Expand Up @@ -718,6 +749,9 @@ private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) {
if (((from_bitField0_ & 0x00000010) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.useTableSchema_ = useTableSchema_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -782,6 +816,9 @@ public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) {
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (other.getUseTableSchema() != false) {
setUseTableSchema(other.getUseTableSchema());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -838,6 +875,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000010;
break;
} // case 40
case 48:
{
useTableSchema_ = input.readBool();
bitField0_ |= 0x00000020;
break;
} // case 48
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -973,11 +1016,12 @@ public Builder setTableBytes(com.google.protobuf.ByteString value) {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand All @@ -989,11 +1033,12 @@ public boolean getUseTopicSchema() {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useTopicSchema to set.
* @return This builder for chaining.
Expand All @@ -1009,11 +1054,12 @@ public Builder setUseTopicSchema(boolean value) {
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
Expand Down Expand Up @@ -1259,6 +1305,65 @@ public Builder clearState() {
return this;
}

private boolean useTableSchema_;
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
@java.lang.Override
public boolean getUseTableSchema() {
return useTableSchema_;
}
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useTableSchema to set.
* @return This builder for chaining.
*/
public Builder setUseTableSchema(boolean value) {

useTableSchema_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearUseTableSchema() {
bitField0_ = (bitField0_ & ~0x00000020);
useTableSchema_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ public interface BigQueryConfigOrBuilder
*
*
* <pre>
* When true, use the topic's schema as the columns to write to in BigQuery,
* if it exists.
* Optional. When true, use the topic's schema as the columns to write to in
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_topic_schema = 2;</code>
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
Expand Down Expand Up @@ -128,4 +129,19 @@ public interface BigQueryConfigOrBuilder
* @return The state.
*/
com.google.pubsub.v1.BigQueryConfig.State getState();

/**
*
*
* <pre>
* Optional. When true, use the BigQuery table's schema as the columns to
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
* enabled at the same time.
* </pre>
*
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTableSchema.
*/
boolean getUseTableSchema();
}
Loading

0 comments on commit 8653f4f

Please sign in to comment.