Skip to content

Commit 8653f4f

Browse files
feat: add use_table_schema field to BigQueryConfig (#1838)
* 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>
1 parent 8cfc23f commit 8653f4f

File tree

6 files changed

+380
-247
lines changed

6 files changed

+380
-247
lines changed

proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfig.java

+117-12
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,12 @@ public com.google.protobuf.ByteString getTableBytes() {
333333
*
334334
*
335335
* <pre>
336-
* When true, use the topic's schema as the columns to write to in BigQuery,
337-
* if it exists.
336+
* Optional. When true, use the topic's schema as the columns to write to in
337+
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
338+
* enabled at the same time.
338339
* </pre>
339340
*
340-
* <code>bool use_topic_schema = 2;</code>
341+
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
341342
*
342343
* @return The useTopicSchema.
343344
*/
@@ -431,6 +432,26 @@ public com.google.pubsub.v1.BigQueryConfig.State getState() {
431432
return result == null ? com.google.pubsub.v1.BigQueryConfig.State.UNRECOGNIZED : result;
432433
}
433434

435+
public static final int USE_TABLE_SCHEMA_FIELD_NUMBER = 6;
436+
private boolean useTableSchema_ = false;
437+
/**
438+
*
439+
*
440+
* <pre>
441+
* Optional. When true, use the BigQuery table's schema as the columns to
442+
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
443+
* enabled at the same time.
444+
* </pre>
445+
*
446+
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
447+
*
448+
* @return The useTableSchema.
449+
*/
450+
@java.lang.Override
451+
public boolean getUseTableSchema() {
452+
return useTableSchema_;
453+
}
454+
434455
private byte memoizedIsInitialized = -1;
435456

436457
@java.lang.Override
@@ -460,6 +481,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
460481
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
461482
output.writeEnum(5, state_);
462483
}
484+
if (useTableSchema_ != false) {
485+
output.writeBool(6, useTableSchema_);
486+
}
463487
getUnknownFields().writeTo(output);
464488
}
465489

@@ -484,6 +508,9 @@ public int getSerializedSize() {
484508
if (state_ != com.google.pubsub.v1.BigQueryConfig.State.STATE_UNSPECIFIED.getNumber()) {
485509
size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_);
486510
}
511+
if (useTableSchema_ != false) {
512+
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_);
513+
}
487514
size += getUnknownFields().getSerializedSize();
488515
memoizedSize = size;
489516
return size;
@@ -504,6 +531,7 @@ public boolean equals(final java.lang.Object obj) {
504531
if (getWriteMetadata() != other.getWriteMetadata()) return false;
505532
if (getDropUnknownFields() != other.getDropUnknownFields()) return false;
506533
if (state_ != other.state_) return false;
534+
if (getUseTableSchema() != other.getUseTableSchema()) return false;
507535
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
508536
return true;
509537
}
@@ -525,6 +553,8 @@ public int hashCode() {
525553
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDropUnknownFields());
526554
hash = (37 * hash) + STATE_FIELD_NUMBER;
527555
hash = (53 * hash) + state_;
556+
hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER;
557+
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema());
528558
hash = (29 * hash) + getUnknownFields().hashCode();
529559
memoizedHashCode = hash;
530560
return hash;
@@ -668,6 +698,7 @@ public Builder clear() {
668698
writeMetadata_ = false;
669699
dropUnknownFields_ = false;
670700
state_ = 0;
701+
useTableSchema_ = false;
671702
return this;
672703
}
673704

@@ -718,6 +749,9 @@ private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) {
718749
if (((from_bitField0_ & 0x00000010) != 0)) {
719750
result.state_ = state_;
720751
}
752+
if (((from_bitField0_ & 0x00000020) != 0)) {
753+
result.useTableSchema_ = useTableSchema_;
754+
}
721755
}
722756

723757
@java.lang.Override
@@ -782,6 +816,9 @@ public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) {
782816
if (other.state_ != 0) {
783817
setStateValue(other.getStateValue());
784818
}
819+
if (other.getUseTableSchema() != false) {
820+
setUseTableSchema(other.getUseTableSchema());
821+
}
785822
this.mergeUnknownFields(other.getUnknownFields());
786823
onChanged();
787824
return this;
@@ -838,6 +875,12 @@ public Builder mergeFrom(
838875
bitField0_ |= 0x00000010;
839876
break;
840877
} // case 40
878+
case 48:
879+
{
880+
useTableSchema_ = input.readBool();
881+
bitField0_ |= 0x00000020;
882+
break;
883+
} // case 48
841884
default:
842885
{
843886
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -973,11 +1016,12 @@ public Builder setTableBytes(com.google.protobuf.ByteString value) {
9731016
*
9741017
*
9751018
* <pre>
976-
* When true, use the topic's schema as the columns to write to in BigQuery,
977-
* if it exists.
1019+
* Optional. When true, use the topic's schema as the columns to write to in
1020+
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
1021+
* enabled at the same time.
9781022
* </pre>
9791023
*
980-
* <code>bool use_topic_schema = 2;</code>
1024+
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
9811025
*
9821026
* @return The useTopicSchema.
9831027
*/
@@ -989,11 +1033,12 @@ public boolean getUseTopicSchema() {
9891033
*
9901034
*
9911035
* <pre>
992-
* When true, use the topic's schema as the columns to write to in BigQuery,
993-
* if it exists.
1036+
* Optional. When true, use the topic's schema as the columns to write to in
1037+
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
1038+
* enabled at the same time.
9941039
* </pre>
9951040
*
996-
* <code>bool use_topic_schema = 2;</code>
1041+
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
9971042
*
9981043
* @param value The useTopicSchema to set.
9991044
* @return This builder for chaining.
@@ -1009,11 +1054,12 @@ public Builder setUseTopicSchema(boolean value) {
10091054
*
10101055
*
10111056
* <pre>
1012-
* When true, use the topic's schema as the columns to write to in BigQuery,
1013-
* if it exists.
1057+
* Optional. When true, use the topic's schema as the columns to write to in
1058+
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
1059+
* enabled at the same time.
10141060
* </pre>
10151061
*
1016-
* <code>bool use_topic_schema = 2;</code>
1062+
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
10171063
*
10181064
* @return This builder for chaining.
10191065
*/
@@ -1259,6 +1305,65 @@ public Builder clearState() {
12591305
return this;
12601306
}
12611307

1308+
private boolean useTableSchema_;
1309+
/**
1310+
*
1311+
*
1312+
* <pre>
1313+
* Optional. When true, use the BigQuery table's schema as the columns to
1314+
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
1315+
* enabled at the same time.
1316+
* </pre>
1317+
*
1318+
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1319+
*
1320+
* @return The useTableSchema.
1321+
*/
1322+
@java.lang.Override
1323+
public boolean getUseTableSchema() {
1324+
return useTableSchema_;
1325+
}
1326+
/**
1327+
*
1328+
*
1329+
* <pre>
1330+
* Optional. When true, use the BigQuery table's schema as the columns to
1331+
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
1332+
* enabled at the same time.
1333+
* </pre>
1334+
*
1335+
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1336+
*
1337+
* @param value The useTableSchema to set.
1338+
* @return This builder for chaining.
1339+
*/
1340+
public Builder setUseTableSchema(boolean value) {
1341+
1342+
useTableSchema_ = value;
1343+
bitField0_ |= 0x00000020;
1344+
onChanged();
1345+
return this;
1346+
}
1347+
/**
1348+
*
1349+
*
1350+
* <pre>
1351+
* Optional. When true, use the BigQuery table's schema as the columns to
1352+
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
1353+
* enabled at the same time.
1354+
* </pre>
1355+
*
1356+
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1357+
*
1358+
* @return This builder for chaining.
1359+
*/
1360+
public Builder clearUseTableSchema() {
1361+
bitField0_ = (bitField0_ & ~0x00000020);
1362+
useTableSchema_ = false;
1363+
onChanged();
1364+
return this;
1365+
}
1366+
12621367
@java.lang.Override
12631368
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
12641369
return super.setUnknownFields(unknownFields);

proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfigOrBuilder.java

+19-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ public interface BigQueryConfigOrBuilder
5454
*
5555
*
5656
* <pre>
57-
* When true, use the topic's schema as the columns to write to in BigQuery,
58-
* if it exists.
57+
* Optional. When true, use the topic's schema as the columns to write to in
58+
* BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
59+
* enabled at the same time.
5960
* </pre>
6061
*
61-
* <code>bool use_topic_schema = 2;</code>
62+
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
6263
*
6364
* @return The useTopicSchema.
6465
*/
@@ -128,4 +129,19 @@ public interface BigQueryConfigOrBuilder
128129
* @return The state.
129130
*/
130131
com.google.pubsub.v1.BigQueryConfig.State getState();
132+
133+
/**
134+
*
135+
*
136+
* <pre>
137+
* Optional. When true, use the BigQuery table's schema as the columns to
138+
* write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
139+
* enabled at the same time.
140+
* </pre>
141+
*
142+
* <code>bool use_table_schema = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
143+
*
144+
* @return The useTableSchema.
145+
*/
146+
boolean getUseTableSchema();
131147
}

0 commit comments

Comments
 (0)