From 0e00c4b6e368ce730a39f900a647be8a28a0ee6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 15:31:08 -0700 Subject: [PATCH] fix(compute): revert proto3_optional, required removal on parent_id (#714) (#717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(compute): revert proto3_optional, required removal on parent_id (#714) Source-Link: https://github.com/googleapis/googleapis/commit/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/832dbe998878d8619d6b40fe57c6d2cc6e7dc90c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODMyZGJlOTk4ODc4ZDg2MTlkNmI0MGZlNTdjNmQyY2M2ZTdkYzkwYyJ9 * 🦉 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 --- .../google/cloud/compute/v1/compute.proto | 5 +++- .../google-cloud-compute/protos/protos.d.ts | 5 +--- .../google-cloud-compute/protos/protos.js | 28 +++++-------------- .../google-cloud-compute/protos/protos.json | 9 ++---- .../generated/v1/firewall_policies.move.js | 3 +- ...ppet_metadata.google.cloud.compute.v1.json | 2 +- 6 files changed, 17 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto index cbb11c8df43..84f708ff9bc 100644 --- a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto +++ b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto @@ -16439,7 +16439,10 @@ message MoveFirewallPolicyRequest { string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; // The new parent of the firewall policy. - optional string parent_id = 459714768 [(google.cloud.operation_request_field) = "parent_id"]; + string parent_id = 459714768 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "parent_id" + ]; // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). optional string request_id = 37109963; diff --git a/packages/google-cloud-compute/protos/protos.d.ts b/packages/google-cloud-compute/protos/protos.d.ts index a84d0b724a3..0c05670e22f 100644 --- a/packages/google-cloud-compute/protos/protos.d.ts +++ b/packages/google-cloud-compute/protos/protos.d.ts @@ -89621,14 +89621,11 @@ export namespace google { public firewallPolicy: string; /** MoveFirewallPolicyRequest parentId. */ - public parentId?: (string|null); + public parentId: string; /** MoveFirewallPolicyRequest requestId. */ public requestId?: (string|null); - /** MoveFirewallPolicyRequest _parentId. */ - public _parentId?: "parentId"; - /** MoveFirewallPolicyRequest _requestId. */ public _requestId?: "requestId"; diff --git a/packages/google-cloud-compute/protos/protos.js b/packages/google-cloud-compute/protos/protos.js index 94402e73c02..af904cc858f 100644 --- a/packages/google-cloud-compute/protos/protos.js +++ b/packages/google-cloud-compute/protos/protos.js @@ -241114,11 +241114,11 @@ /** * MoveFirewallPolicyRequest parentId. - * @member {string|null|undefined} parentId + * @member {string} parentId * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest * @instance */ - MoveFirewallPolicyRequest.prototype.parentId = null; + MoveFirewallPolicyRequest.prototype.parentId = ""; /** * MoveFirewallPolicyRequest requestId. @@ -241131,17 +241131,6 @@ // OneOf field names bound to virtual getters and setters var $oneOfFields; - /** - * MoveFirewallPolicyRequest _parentId. - * @member {"parentId"|undefined} _parentId - * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest - * @instance - */ - Object.defineProperty(MoveFirewallPolicyRequest.prototype, "_parentId", { - get: $util.oneOfGetter($oneOfFields = ["parentId"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** * MoveFirewallPolicyRequest _requestId. * @member {"requestId"|undefined} _requestId @@ -241265,11 +241254,9 @@ if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) if (!$util.isString(message.firewallPolicy)) return "firewallPolicy: string expected"; - if (message.parentId != null && message.hasOwnProperty("parentId")) { - properties._parentId = 1; + if (message.parentId != null && message.hasOwnProperty("parentId")) if (!$util.isString(message.parentId)) return "parentId: string expected"; - } if (message.requestId != null && message.hasOwnProperty("requestId")) { properties._requestId = 1; if (!$util.isString(message.requestId)) @@ -241312,18 +241299,17 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { + object.parentId = ""; object.firewallPolicy = ""; + } if (message.requestId != null && message.hasOwnProperty("requestId")) { object.requestId = message.requestId; if (options.oneofs) object._requestId = "requestId"; } - if (message.parentId != null && message.hasOwnProperty("parentId")) { + if (message.parentId != null && message.hasOwnProperty("parentId")) object.parentId = message.parentId; - if (options.oneofs) - object._parentId = "parentId"; - } if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) object.firewallPolicy = message.firewallPolicy; return object; diff --git a/packages/google-cloud-compute/protos/protos.json b/packages/google-cloud-compute/protos/protos.json index 3b9858553d1..3735f5fecdf 100644 --- a/packages/google-cloud-compute/protos/protos.json +++ b/packages/google-cloud-compute/protos/protos.json @@ -40006,11 +40006,6 @@ }, "MoveFirewallPolicyRequest": { "oneofs": { - "_parentId": { - "oneof": [ - "parentId" - ] - }, "_requestId": { "oneof": [ "requestId" @@ -40029,8 +40024,8 @@ "type": "string", "id": 459714768, "options": { - "(google.cloud.operation_request_field)": "parent_id", - "proto3_optional": true + "(google.api.field_behavior)": "REQUIRED", + "(google.cloud.operation_request_field)": "parent_id" } }, "requestId": { diff --git a/packages/google-cloud-compute/samples/generated/v1/firewall_policies.move.js b/packages/google-cloud-compute/samples/generated/v1/firewall_policies.move.js index e0acf132558..7107ac2d4db 100644 --- a/packages/google-cloud-compute/samples/generated/v1/firewall_policies.move.js +++ b/packages/google-cloud-compute/samples/generated/v1/firewall_policies.move.js @@ -20,7 +20,7 @@ 'use strict'; -function main(firewallPolicy) { +function main(firewallPolicy, parentId) { // [START compute_v1_generated_FirewallPolicies_Move_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -48,6 +48,7 @@ function main(firewallPolicy) { // Construct request const request = { firewallPolicy, + parentId, }; // Run request diff --git a/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json b/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json index 4b5744b203a..10558334a17 100644 --- a/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json +++ b/packages/google-cloud-compute/samples/generated/v1/snippet_metadata.google.cloud.compute.v1.json @@ -3662,7 +3662,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ],