From b34b29cfe216f7a890026e4e49ff09f4989a1a84 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 16:10:36 +0000 Subject: [PATCH] fix(compute): remove proto3_optional from parent_id (#712) (#712) - [ ] Regenerate this pull request now. Source-Link: https://github.com/googleapis/googleapis/commit/fd16b6a2379e37089a2877d0b320e3d4f293ef0e Source-Link: https://github.com/googleapis/googleapis-gen/commit/d935b9847a1b708ab4e696320ba60ce0341c5d7a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDkzNWI5ODQ3YTFiNzA4YWI0ZTY5NjMyMGJhNjBjZTAzNDFjNWQ3YSJ9 fix(compute): replace missing REQUIRED for parent_id (#711) Source-Link: https://github.com/googleapis/googleapis/commit/4bb6fd659f4edcc7df980f7387c96a49cf556289 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c7d06533be6e2470e36b9f351ae4ff479a47dc53 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzdkMDY1MzNiZTZlMjQ3MGUzNmI5ZjM1MWFlNGZmNDc5YTQ3ZGM1MyJ9 --- .../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 | 7 +---- .../generated/v1/firewall_policies.insert.js | 3 +- ...ppet_metadata.google.cloud.compute.v1.json | 2 +- 6 files changed, 16 insertions(+), 34 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 dde588254d1..cbb11c8df43 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 @@ -9946,7 +9946,10 @@ message InsertFirewallPolicyRequest { FirewallPolicy firewall_policy_resource = 495049532 [(google.api.field_behavior) = REQUIRED]; // Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. - optional string parent_id = 459714768 [(google.cloud.operation_request_field) = "parent_id"]; + string parent_id = 459714768 [ + (google.cloud.operation_request_field) = "parent_id", + (google.api.field_behavior) = REQUIRED + ]; // 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 12ba5f1c40c..a84d0b724a3 100644 --- a/packages/google-cloud-compute/protos/protos.d.ts +++ b/packages/google-cloud-compute/protos/protos.d.ts @@ -55062,14 +55062,11 @@ export namespace google { public firewallPolicyResource?: (google.cloud.compute.v1.IFirewallPolicy|null); /** InsertFirewallPolicyRequest parentId. */ - public parentId?: (string|null); + public parentId: string; /** InsertFirewallPolicyRequest requestId. */ public requestId?: (string|null); - /** InsertFirewallPolicyRequest _parentId. */ - public _parentId?: "parentId"; - /** InsertFirewallPolicyRequest _requestId. */ public _requestId?: "requestId"; diff --git a/packages/google-cloud-compute/protos/protos.js b/packages/google-cloud-compute/protos/protos.js index 2cfd8f831a1..94402e73c02 100644 --- a/packages/google-cloud-compute/protos/protos.js +++ b/packages/google-cloud-compute/protos/protos.js @@ -145535,11 +145535,11 @@ /** * InsertFirewallPolicyRequest parentId. - * @member {string|null|undefined} parentId + * @member {string} parentId * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest * @instance */ - InsertFirewallPolicyRequest.prototype.parentId = null; + InsertFirewallPolicyRequest.prototype.parentId = ""; /** * InsertFirewallPolicyRequest requestId. @@ -145552,17 +145552,6 @@ // OneOf field names bound to virtual getters and setters var $oneOfFields; - /** - * InsertFirewallPolicyRequest _parentId. - * @member {"parentId"|undefined} _parentId - * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest - * @instance - */ - Object.defineProperty(InsertFirewallPolicyRequest.prototype, "_parentId", { - get: $util.oneOfGetter($oneOfFields = ["parentId"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** * InsertFirewallPolicyRequest _requestId. * @member {"requestId"|undefined} _requestId @@ -145688,11 +145677,9 @@ if (error) return "firewallPolicyResource." + error; } - 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)) @@ -145738,18 +145725,17 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { + object.parentId = ""; object.firewallPolicyResource = null; + } 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.firewallPolicyResource != null && message.hasOwnProperty("firewallPolicyResource")) object.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.toObject(message.firewallPolicyResource, options); return object; diff --git a/packages/google-cloud-compute/protos/protos.json b/packages/google-cloud-compute/protos/protos.json index 0b8e4e32f07..3b9858553d1 100644 --- a/packages/google-cloud-compute/protos/protos.json +++ b/packages/google-cloud-compute/protos/protos.json @@ -23162,11 +23162,6 @@ }, "InsertFirewallPolicyRequest": { "oneofs": { - "_parentId": { - "oneof": [ - "parentId" - ] - }, "_requestId": { "oneof": [ "requestId" @@ -23186,7 +23181,7 @@ "id": 459714768, "options": { "(google.cloud.operation_request_field)": "parent_id", - "proto3_optional": true + "(google.api.field_behavior)": "REQUIRED" } }, "requestId": { diff --git a/packages/google-cloud-compute/samples/generated/v1/firewall_policies.insert.js b/packages/google-cloud-compute/samples/generated/v1/firewall_policies.insert.js index 9bd806b02a2..f2bf4b1f394 100644 --- a/packages/google-cloud-compute/samples/generated/v1/firewall_policies.insert.js +++ b/packages/google-cloud-compute/samples/generated/v1/firewall_policies.insert.js @@ -20,7 +20,7 @@ 'use strict'; -function main(firewallPolicyResource) { +function main(firewallPolicyResource, parentId) { // [START compute_v1_generated_FirewallPolicies_Insert_async] /** * TODO(developer): Uncomment these variables before running the sample. @@ -48,6 +48,7 @@ function main(firewallPolicyResource) { // Construct request const request = { firewallPolicyResource, + 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 46d64e039c3..eadf58c335b 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 @@ -3514,7 +3514,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 59, "type": "FULL" } ],