From 2875d8383831563e5b748e96094faa94bf25fc15 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:04:11 -0500 Subject: [PATCH] feat: add `use_table_schema` field to BigQueryConfig (#1858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add `use_table_schema` field to BigQueryConfig PiperOrigin-RevId: 587079085 Source-Link: https://github.com/googleapis/googleapis/commit/95fabe6ae89c9206e89fd38a4d5c0f40c13bedfb 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 * 🦉 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 --- protos/google/pubsub/v1/pubsub.proto | 12 +++++++++--- protos/protos.d.ts | 6 ++++++ protos/protos.js | 23 +++++++++++++++++++++++ protos/protos.json | 12 +++++++++++- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/protos/google/pubsub/v1/pubsub.proto b/protos/google/pubsub/v1/pubsub.proto index 700324dc7..393893b10 100644 --- a/protos/google/pubsub/v1/pubsub.proto +++ b/protos/google/pubsub/v1/pubsub.proto @@ -997,9 +997,10 @@ message BigQueryConfig { // {projectId}.{datasetId}.{tableId} string table = 1; - // When true, use the topic's schema as the columns to write to in BigQuery, - // if it exists. - bool use_topic_schema = 2; + // 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. + bool use_topic_schema = 2 [(google.api.field_behavior) = OPTIONAL]; // When true, write the subscription name, message_id, publish_time, // attributes, and ordering_key to additional columns in the table. The @@ -1018,6 +1019,11 @@ message BigQueryConfig { // Output only. An output-only field that indicates whether or not the // subscription can receive messages. State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + bool use_table_schema = 6 [(google.api.field_behavior) = OPTIONAL]; } // Configuration for a Cloud Storage subscription. diff --git a/protos/protos.d.ts b/protos/protos.d.ts index e60c2c22a..23b89207d 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -3333,6 +3333,9 @@ export namespace google { /** BigQueryConfig state */ state?: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State|null); + + /** BigQueryConfig useTableSchema */ + useTableSchema?: (boolean|null); } /** Represents a BigQueryConfig. */ @@ -3359,6 +3362,9 @@ export namespace google { /** BigQueryConfig state. */ public state: (google.pubsub.v1.BigQueryConfig.State|keyof typeof google.pubsub.v1.BigQueryConfig.State); + /** BigQueryConfig useTableSchema. */ + public useTableSchema: boolean; + /** * Creates a new BigQueryConfig instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index 81f10210c..edfceec87 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -7567,6 +7567,7 @@ * @property {boolean|null} [writeMetadata] BigQueryConfig writeMetadata * @property {boolean|null} [dropUnknownFields] BigQueryConfig dropUnknownFields * @property {google.pubsub.v1.BigQueryConfig.State|null} [state] BigQueryConfig state + * @property {boolean|null} [useTableSchema] BigQueryConfig useTableSchema */ /** @@ -7624,6 +7625,14 @@ */ BigQueryConfig.prototype.state = 0; + /** + * BigQueryConfig useTableSchema. + * @member {boolean} useTableSchema + * @memberof google.pubsub.v1.BigQueryConfig + * @instance + */ + BigQueryConfig.prototype.useTableSchema = false; + /** * Creates a new BigQueryConfig instance using the specified properties. * @function create @@ -7658,6 +7667,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dropUnknownFields); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.useTableSchema != null && Object.hasOwnProperty.call(message, "useTableSchema")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.useTableSchema); return writer; }; @@ -7712,6 +7723,10 @@ message.state = reader.int32(); break; } + case 6: { + message.useTableSchema = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -7770,6 +7785,9 @@ case 4: break; } + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + if (typeof message.useTableSchema !== "boolean") + return "useTableSchema: boolean expected"; return null; }; @@ -7821,6 +7839,8 @@ message.state = 4; break; } + if (object.useTableSchema != null) + message.useTableSchema = Boolean(object.useTableSchema); return message; }; @@ -7843,6 +7863,7 @@ object.writeMetadata = false; object.dropUnknownFields = false; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.useTableSchema = false; } if (message.table != null && message.hasOwnProperty("table")) object.table = message.table; @@ -7854,6 +7875,8 @@ object.dropUnknownFields = message.dropUnknownFields; if (message.state != null && message.hasOwnProperty("state")) object.state = options.enums === String ? $root.google.pubsub.v1.BigQueryConfig.State[message.state] === undefined ? message.state : $root.google.pubsub.v1.BigQueryConfig.State[message.state] : message.state; + if (message.useTableSchema != null && message.hasOwnProperty("useTableSchema")) + object.useTableSchema = message.useTableSchema; return object; }; diff --git a/protos/protos.json b/protos/protos.json index 3204fdc77..f1332af79 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -981,7 +981,10 @@ }, "useTopicSchema": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "writeMetadata": { "type": "bool", @@ -997,6 +1000,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "useTableSchema": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": {