From d908243d3d69620d3a8fd19dc1dbafd162b6e826 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 02:02:18 +0200 Subject: [PATCH 01/11] chore(deps): update dependency linkinator to v4 (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.2.2` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.2) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.1...v4.0.2) ##### Bug Fixes - address srcset parsing with multiple spaces ([#​512](https://togithub.com/JustinBeckwith/linkinator/issues/512)) ([fefb5b6](https://togithub.com/JustinBeckwith/linkinator/commit/fefb5b6734fc4ab335793358c5f491338ecbeb90)) ### [`v4.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.0...v4.0.1) ##### Bug Fixes - properly parse srcset attribute ([#​510](https://togithub.com/JustinBeckwith/linkinator/issues/510)) ([9a8a83c](https://togithub.com/JustinBeckwith/linkinator/commit/9a8a83c35182b3cd4daee62a00f156767fe5c6a7)) ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-binary-authorization). --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a33ea92..22b1725 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "jsdoc": "^3.6.6", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.2.2", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", From c6629bbeaa6b34570890feaf968a7c8a9090b050 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:20:21 +0000 Subject: [PATCH 02/11] chore: remove unused proto imports (#169) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 --- protos/google/cloud/binaryauthorization/v1/resources.proto | 1 - protos/google/cloud/binaryauthorization/v1beta1/resources.proto | 1 - 2 files changed, 2 deletions(-) diff --git a/protos/google/cloud/binaryauthorization/v1/resources.proto b/protos/google/cloud/binaryauthorization/v1/resources.proto index 9d72a9f..5df7f58 100644 --- a/protos/google/cloud/binaryauthorization/v1/resources.proto +++ b/protos/google/cloud/binaryauthorization/v1/resources.proto @@ -19,7 +19,6 @@ package google.cloud.binaryauthorization.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1"; diff --git a/protos/google/cloud/binaryauthorization/v1beta1/resources.proto b/protos/google/cloud/binaryauthorization/v1beta1/resources.proto index 3e5b638..28c18f9 100644 --- a/protos/google/cloud/binaryauthorization/v1beta1/resources.proto +++ b/protos/google/cloud/binaryauthorization/v1beta1/resources.proto @@ -19,7 +19,6 @@ package google.cloud.binaryauthorization.v1beta1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.BinaryAuthorization.V1Beta1"; From fa2e0b5991a80e912c65f896bdc0c2670b2a349d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:06:16 +0000 Subject: [PATCH 03/11] fix: better support for fallback mode (#170) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- ...z_management_service_v1.create_attestor.js | 3 + ...z_management_service_v1.delete_attestor.js | 3 + ...uthz_management_service_v1.get_attestor.js | 3 + ...nauthz_management_service_v1.get_policy.js | 3 + ...hz_management_service_v1.list_attestors.js | 3 + ...z_management_service_v1.update_attestor.js | 3 + ...thz_management_service_v1.update_policy.js | 3 + ...a.google.cloud.binaryauthorization.v1.json | 18 +- .../v1/system_policy_v1.get_system_policy.js | 3 + ...lper_v1.validate_attestation_occurrence.js | 3 + ...gement_service_v1_beta1.create_attestor.js | 3 + ...gement_service_v1_beta1.delete_attestor.js | 3 + ...anagement_service_v1_beta1.get_attestor.js | 3 + ..._management_service_v1_beta1.get_policy.js | 3 + ...agement_service_v1_beta1.list_attestors.js | 3 + ...gement_service_v1_beta1.update_attestor.js | 3 + ...nagement_service_v1_beta1.update_policy.js | 3 + ...gle.cloud.binaryauthorization.v1beta1.json | 16 +- ...ystem_policy_v1_beta1.get_system_policy.js | 3 + .../binauthz_management_service_v1_client.ts | 8 +- src/v1/system_policy_v1_client.ts | 3 +- src/v1/validation_helper_v1_client.ts | 3 +- ...uthz_management_service_v1_beta1_client.ts | 8 +- src/v1beta1/system_policy_v1_beta1_client.ts | 3 +- ...thz_management_service_v1_beta1_v1beta1.ts | 214 +++++++++--------- ...gapic_binauthz_management_service_v1_v1.ts | 212 ++++++++--------- test/gapic_system_policy_v1_beta1_v1beta1.ts | 178 ++++++++------- test/gapic_system_policy_v1_v1.ts | 160 ++++++------- test/gapic_validation_helper_v1_v1.ts | 160 ++++++------- 29 files changed, 552 insertions(+), 482 deletions(-) diff --git a/samples/generated/v1/binauthz_management_service_v1.create_attestor.js b/samples/generated/v1/binauthz_management_service_v1.create_attestor.js index 1499dc5..9cc300e 100644 --- a/samples/generated/v1/binauthz_management_service_v1.create_attestor.js +++ b/samples/generated/v1/binauthz_management_service_v1.create_attestor.js @@ -23,6 +23,9 @@ function main(parent, attestorId, attestor) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_CreateAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js b/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js index e25decb..15105c9 100644 --- a/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js +++ b/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_DeleteAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.get_attestor.js b/samples/generated/v1/binauthz_management_service_v1.get_attestor.js index 98295e2..0e369fe 100644 --- a/samples/generated/v1/binauthz_management_service_v1.get_attestor.js +++ b/samples/generated/v1/binauthz_management_service_v1.get_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.get_policy.js b/samples/generated/v1/binauthz_management_service_v1.get_policy.js index bc8f4f6..90540a4 100644 --- a/samples/generated/v1/binauthz_management_service_v1.get_policy.js +++ b/samples/generated/v1/binauthz_management_service_v1.get_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_GetPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.list_attestors.js b/samples/generated/v1/binauthz_management_service_v1.list_attestors.js index aebdf8c..6ac605a 100644 --- a/samples/generated/v1/binauthz_management_service_v1.list_attestors.js +++ b/samples/generated/v1/binauthz_management_service_v1.list_attestors.js @@ -23,6 +23,9 @@ function main(parent) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_ListAttestors_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.update_attestor.js b/samples/generated/v1/binauthz_management_service_v1.update_attestor.js index 6c5acdc..35683da 100644 --- a/samples/generated/v1/binauthz_management_service_v1.update_attestor.js +++ b/samples/generated/v1/binauthz_management_service_v1.update_attestor.js @@ -23,6 +23,9 @@ function main(attestor) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdateAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/binauthz_management_service_v1.update_policy.js b/samples/generated/v1/binauthz_management_service_v1.update_policy.js index c70c3a6..b9873b5 100644 --- a/samples/generated/v1/binauthz_management_service_v1.update_policy.js +++ b/samples/generated/v1/binauthz_management_service_v1.update_policy.js @@ -23,6 +23,9 @@ function main(policy) { // [START binaryauthorization_v1_generated_BinauthzManagementServiceV1_UpdatePolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json index 1285178..4001bab 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -102,7 +102,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -190,7 +190,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -318,7 +318,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -358,7 +358,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], diff --git a/samples/generated/v1/system_policy_v1.get_system_policy.js b/samples/generated/v1/system_policy_v1.get_system_policy.js index d749cd7..ce4d360 100644 --- a/samples/generated/v1/system_policy_v1.get_system_policy.js +++ b/samples/generated/v1/system_policy_v1.get_system_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1_generated_SystemPolicyV1_GetSystemPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js b/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js index ff236be..9927d0d 100644 --- a/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js +++ b/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js @@ -23,6 +23,9 @@ function main(attestor, attestation, occurrenceNote, occurrenceResourceUri) { // [START binaryauthorization_v1_generated_ValidationHelperV1_ValidateAttestationOccurrence_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js index 83c48c7..32a0265 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js @@ -23,6 +23,9 @@ function main(parent, attestorId, attestor) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_CreateAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js index 0f439cf..441f3ed 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_DeleteAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js index 85719a8..de46ed3 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_GetAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js index ce84d2d..6996266 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_GetPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js index 0023d64..a306cb8 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js @@ -23,6 +23,9 @@ function main(parent) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_ListAttestors_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js index 8dbc0d1..79700f8 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js @@ -23,6 +23,9 @@ function main(attestor) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_UpdateAttestor_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js index 12aa0a0..1309519 100644 --- a/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js +++ b/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js @@ -23,6 +23,9 @@ function main(policy) { // [START binaryauthorization_v1beta1_generated_BinauthzManagementServiceV1Beta1_UpdatePolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json index fcd9f8d..216b6e2 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -102,7 +102,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -150,7 +150,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -190,7 +190,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -278,7 +278,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -318,7 +318,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], diff --git a/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js b/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js index e64583a..c02feb1 100644 --- a/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js +++ b/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js @@ -23,6 +23,9 @@ function main(name) { // [START binaryauthorization_v1beta1_generated_SystemPolicyV1Beta1_GetSystemPolicy_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/src/v1/binauthz_management_service_v1_client.ts b/src/v1/binauthz_management_service_v1_client.ts index 564eec2..70213cf 100644 --- a/src/v1/binauthz_management_service_v1_client.ts +++ b/src/v1/binauthz_management_service_v1_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -273,7 +272,8 @@ export class BinauthzManagementServiceV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1087,7 +1087,7 @@ export class BinauthzManagementServiceV1Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAttestors.createStream( - this.innerApiCalls.listAttestors as gax.GaxCall, + this.innerApiCalls.listAttestors as GaxCall, request, callSettings ); @@ -1139,7 +1139,7 @@ export class BinauthzManagementServiceV1Client { this.initialize(); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1/system_policy_v1_client.ts b/src/v1/system_policy_v1_client.ts index 12ad937..e951c8f 100644 --- a/src/v1/system_policy_v1_client.ts +++ b/src/v1/system_policy_v1_client.ts @@ -238,7 +238,8 @@ export class SystemPolicyV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/src/v1/validation_helper_v1_client.ts b/src/v1/validation_helper_v1_client.ts index c944f49..12900a9 100644 --- a/src/v1/validation_helper_v1_client.ts +++ b/src/v1/validation_helper_v1_client.ts @@ -238,7 +238,8 @@ export class ValidationHelperV1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 084c472..7cc803d 100644 --- a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -28,7 +28,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -273,7 +272,8 @@ export class BinauthzManagementServiceV1Beta1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1093,7 +1093,7 @@ export class BinauthzManagementServiceV1Beta1Client { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAttestors.createStream( - this.innerApiCalls.listAttestors as gax.GaxCall, + this.innerApiCalls.listAttestors as GaxCall, request, callSettings ); @@ -1145,7 +1145,7 @@ export class BinauthzManagementServiceV1Beta1Client { this.initialize(); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1beta1/system_policy_v1_beta1_client.ts b/src/v1beta1/system_policy_v1_beta1_client.ts index dbd339c..17b0f2e 100644 --- a/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/src/v1beta1/system_policy_v1_beta1_client.ts @@ -238,7 +238,8 @@ export class SystemPolicyV1Beta1Client { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; diff --git a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts index 73c275b..6e8197a 100644 --- a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts +++ b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts @@ -113,124 +113,132 @@ function stubAsyncIterationCall( } describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - binauthzmanagementservicev1beta1Module.v1beta1 - .BinauthzManagementServiceV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + binauthzmanagementservicev1beta1Module.v1beta1 + .BinauthzManagementServiceV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has initialize method and supports deferred initialization', async () => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.binauthzManagementServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.binauthzManagementServiceV1Beta1Stub, undefined); - await client.initialize(); - assert(client.binauthzManagementServiceV1Beta1Stub); - }); + await client.initialize(); + assert(client.binauthzManagementServiceV1Beta1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.binauthzManagementServiceV1Beta1Stub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.binauthzManagementServiceV1Beta1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } + it('has close method for the non-initialized client', done => { + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual( + client.binauthzManagementServiceV1Beta1Stub, + undefined ); - assert.strictEqual(client.binauthzManagementServiceV1Beta1Stub, undefined); - client.close().then(() => { - done(); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new binauthzmanagementservicev1beta1Module.v1beta1.BinauthzManagementServiceV1Beta1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getPolicy', () => { diff --git a/test/gapic_binauthz_management_service_v1_v1.ts b/test/gapic_binauthz_management_service_v1_v1.ts index d99cae8..bd51794 100644 --- a/test/gapic_binauthz_management_service_v1_v1.ts +++ b/test/gapic_binauthz_management_service_v1_v1.ts @@ -113,124 +113,126 @@ function stubAsyncIterationCall( } describe('v1.BinauthzManagementServiceV1Client', () => { - it('has servicePath', () => { - const servicePath = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client - .port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - fallback: true, - } - ); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); - await client.initialize(); - assert(client.binauthzManagementServiceV1Stub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); + await client.initialize(); + assert(client.binauthzManagementServiceV1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - assert(client.binauthzManagementServiceV1Stub); - client.close().then(() => { - done(); + it('has close method for the initialized client', done => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.binauthzManagementServiceV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); - client.close().then(() => { - done(); + it('has close method for the non-initialized client', done => { + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.binauthzManagementServiceV1Stub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new binauthzmanagementservicev1Module.v1.BinauthzManagementServiceV1Client( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getPolicy', () => { diff --git a/test/gapic_system_policy_v1_beta1_v1beta1.ts b/test/gapic_system_policy_v1_beta1_v1beta1.ts index c4f852d..e54f179 100644 --- a/test/gapic_system_policy_v1_beta1_v1beta1.ts +++ b/test/gapic_system_policy_v1_beta1_v1beta1.ts @@ -50,109 +50,111 @@ function stubSimpleCallWithCallback( } describe('v1beta1.SystemPolicyV1Beta1Client', () => { - it('has servicePath', () => { - const servicePath = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); - await client.initialize(); - assert(client.systemPolicyV1Beta1Stub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); + await client.initialize(); + assert(client.systemPolicyV1Beta1Stub); + }); - it('has close method for the initialized client', done => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.systemPolicyV1Beta1Stub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.systemPolicyV1Beta1Stub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.systemPolicyV1Beta1Stub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new systempolicyv1beta1Module.v1beta1.SystemPolicyV1Beta1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getSystemPolicy', () => { diff --git a/test/gapic_system_policy_v1_v1.ts b/test/gapic_system_policy_v1_v1.ts index 805a335..e8d6283 100644 --- a/test/gapic_system_policy_v1_v1.ts +++ b/test/gapic_system_policy_v1_v1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1.SystemPolicyV1Client', () => { - it('has servicePath', () => { - const servicePath = - systempolicyv1Module.v1.SystemPolicyV1Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - systempolicyv1Module.v1.SystemPolicyV1Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = systempolicyv1Module.v1.SystemPolicyV1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + systempolicyv1Module.v1.SystemPolicyV1Client.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + systempolicyv1Module.v1.SystemPolicyV1Client.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = systempolicyv1Module.v1.SystemPolicyV1Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.systemPolicyV1Stub, undefined); - await client.initialize(); - assert(client.systemPolicyV1Stub); - }); - it('has close method for the initialized client', done => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client(); + assert(client); }); - client.initialize(); - assert(client.systemPolicyV1Stub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Stub, undefined); + await client.initialize(); + assert(client.systemPolicyV1Stub); }); - assert.strictEqual(client.systemPolicyV1Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.systemPolicyV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.systemPolicyV1Stub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new systempolicyv1Module.v1.SystemPolicyV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getSystemPolicy', () => { diff --git a/test/gapic_validation_helper_v1_v1.ts b/test/gapic_validation_helper_v1_v1.ts index b085600..8b19183 100644 --- a/test/gapic_validation_helper_v1_v1.ts +++ b/test/gapic_validation_helper_v1_v1.ts @@ -50,101 +50,103 @@ function stubSimpleCallWithCallback( } describe('v1.ValidationHelperV1Client', () => { - it('has servicePath', () => { - const servicePath = - validationhelperv1Module.v1.ValidationHelperV1Client.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = - validationhelperv1Module.v1.ValidationHelperV1Client.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = validationhelperv1Module.v1.ValidationHelperV1Client.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + validationhelperv1Module.v1.ValidationHelperV1Client.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + validationhelperv1Module.v1.ValidationHelperV1Client.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = validationhelperv1Module.v1.ValidationHelperV1Client.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.validationHelperV1Stub, undefined); - await client.initialize(); - assert(client.validationHelperV1Stub); - }); - it('has close method for the initialized client', done => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client(); + assert(client); }); - client.initialize(); - assert(client.validationHelperV1Stub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.validationHelperV1Stub, undefined); + await client.initialize(); + assert(client.validationHelperV1Stub); }); - assert.strictEqual(client.validationHelperV1Stub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.validationHelperV1Stub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.validationHelperV1Stub, undefined); + client.close().then(() => { + done(); + }); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new validationhelperv1Module.v1.ValidationHelperV1Client({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('validateAttestationOccurrence', () => { From 6327374ea12b05cc4d752b059e4d9a098174f45b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:32:27 +0000 Subject: [PATCH 04/11] fix: change import long to require (#172) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .github/.OwlBot.lock.yaml | 4 +- protos/protos.d.ts | 645 +++++- protos/protos.js | 3904 ++++++++++++++++++++++++++----------- protos/protos.json | 24 + 4 files changed, 3418 insertions(+), 1159 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f3ca556..f7c796c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:ddb19a6df6c1fa081bc99fb29658f306dd64668bc26f75d1353b28296f3a78e6 -# created: 2022-06-07T21:18:30.024751809Z + digest: sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e +# created: 2022-08-22T22:07:00.791732705Z diff --git a/protos/protos.d.ts b/protos/protos.d.ts index df4bfbd..59e80b5 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -168,6 +168,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Policy { @@ -268,6 +275,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdmissionWhitelistPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AdmissionRule. */ @@ -370,6 +384,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdmissionRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AdmissionRule { @@ -499,6 +520,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attestor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UserOwnedGrafeasNote. */ @@ -601,6 +629,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserOwnedGrafeasNote + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a PkixPublicKey. */ @@ -697,6 +732,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PkixPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace PkixPublicKey { @@ -830,6 +872,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttestorPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents a BinauthzManagementServiceV1 */ @@ -954,49 +1003,49 @@ export namespace google { namespace BinauthzManagementServiceV1 { /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#getPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|getPolicy}. * @param error Error, if any * @param [response] Policy */ type GetPolicyCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#updatePolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|updatePolicy}. * @param error Error, if any * @param [response] Policy */ type UpdatePolicyCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.Policy) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#createAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|createAttestor}. * @param error Error, if any * @param [response] Attestor */ type CreateAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#getAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|getAttestor}. * @param error Error, if any * @param [response] Attestor */ type GetAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#updateAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|updateAttestor}. * @param error Error, if any * @param [response] Attestor */ type UpdateAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#listAttestors}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|listAttestors}. * @param error Error, if any * @param [response] ListAttestorsResponse */ type ListAttestorsCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1.ListAttestorsResponse) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#deleteAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|deleteAttestor}. * @param error Error, if any * @param [response] Empty */ @@ -1041,7 +1090,7 @@ export namespace google { namespace SystemPolicyV1 { /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.SystemPolicyV1#getSystemPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.SystemPolicyV1|getSystemPolicy}. * @param error Error, if any * @param [response] Policy */ @@ -1086,7 +1135,7 @@ export namespace google { namespace ValidationHelperV1 { /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.ValidationHelperV1#validateAttestationOccurrence}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.ValidationHelperV1|validateAttestationOccurrence}. * @param error Error, if any * @param [response] ValidateAttestationOccurrenceResponse */ @@ -1181,6 +1230,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdatePolicyRequest. */ @@ -1271,6 +1327,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateAttestorRequest. */ @@ -1373,6 +1436,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetAttestorRequest. */ @@ -1463,6 +1533,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateAttestorRequest. */ @@ -1553,6 +1630,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAttestorsRequest. */ @@ -1655,6 +1739,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttestorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAttestorsResponse. */ @@ -1751,6 +1842,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttestorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteAttestorRequest. */ @@ -1841,6 +1939,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSystemPolicyRequest. */ @@ -1931,6 +2036,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSystemPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ValidateAttestationOccurrenceRequest. */ @@ -2039,6 +2151,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateAttestationOccurrenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ValidateAttestationOccurrenceResponse. */ @@ -2135,6 +2254,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidateAttestationOccurrenceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ValidateAttestationOccurrenceResponse { @@ -2248,6 +2374,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousValidationEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ContinuousValidationEvent { @@ -2370,6 +2503,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContinuousValidationPodEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ContinuousValidationPodEvent { @@ -2480,6 +2620,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImageDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ImageDetails { @@ -2581,6 +2728,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnsupportedPolicyEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2726,6 +2880,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Policy { @@ -2826,6 +2987,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdmissionWhitelistPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AdmissionRule. */ @@ -2928,6 +3096,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdmissionRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AdmissionRule { @@ -3057,6 +3232,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Attestor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UserOwnedDrydockNote. */ @@ -3159,6 +3341,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UserOwnedDrydockNote + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a PkixPublicKey. */ @@ -3255,6 +3444,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PkixPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace PkixPublicKey { @@ -3388,6 +3584,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttestorPublicKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents a BinauthzManagementServiceV1Beta1 */ @@ -3512,49 +3715,49 @@ export namespace google { namespace BinauthzManagementServiceV1Beta1 { /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#getPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|getPolicy}. * @param error Error, if any * @param [response] Policy */ type GetPolicyCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.Policy) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#updatePolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|updatePolicy}. * @param error Error, if any * @param [response] Policy */ type UpdatePolicyCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.Policy) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#createAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|createAttestor}. * @param error Error, if any * @param [response] Attestor */ type CreateAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#getAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|getAttestor}. * @param error Error, if any * @param [response] Attestor */ type GetAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#updateAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|updateAttestor}. * @param error Error, if any * @param [response] Attestor */ type UpdateAttestorCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.Attestor) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#listAttestors}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|listAttestors}. * @param error Error, if any * @param [response] ListAttestorsResponse */ type ListAttestorsCallback = (error: (Error|null), response?: google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse) => void; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#deleteAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|deleteAttestor}. * @param error Error, if any * @param [response] Empty */ @@ -3649,6 +3852,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents a SystemPolicyV1Beta1 */ @@ -3689,7 +3899,7 @@ export namespace google { namespace SystemPolicyV1Beta1 { /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1#getSystemPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1|getSystemPolicy}. * @param error Error, if any * @param [response] Policy */ @@ -3784,6 +3994,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateAttestorRequest. */ @@ -3886,6 +4103,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetAttestorRequest. */ @@ -3976,6 +4200,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateAttestorRequest. */ @@ -4066,6 +4297,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAttestorsRequest. */ @@ -4168,6 +4406,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttestorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAttestorsResponse. */ @@ -4264,6 +4509,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAttestorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteAttestorRequest. */ @@ -4354,6 +4606,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAttestorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetSystemPolicyRequest. */ @@ -4444,6 +4703,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSystemPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -4588,6 +4854,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ResourceDescriptor { @@ -4700,6 +4973,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Http. */ @@ -4796,6 +5076,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a HttpRule. */ @@ -4943,6 +5230,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CustomHttpPattern. */ @@ -5039,6 +5333,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5133,6 +5434,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FileDescriptorProto. */ @@ -5173,6 +5481,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -5220,6 +5531,9 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: string; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -5289,6 +5603,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DescriptorProto. */ @@ -5433,6 +5754,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace DescriptorProto { @@ -5537,6 +5865,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ReservedRange. */ @@ -5633,6 +5968,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -5724,6 +6066,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldDescriptorProto. */ @@ -5874,6 +6223,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FieldDescriptorProto { @@ -6002,6 +6358,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumDescriptorProto. */ @@ -6116,6 +6479,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace EnumDescriptorProto { @@ -6214,6 +6584,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -6317,6 +6694,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ServiceDescriptorProto. */ @@ -6419,6 +6803,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MethodDescriptorProto. */ @@ -6539,6 +6930,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FileOptions. */ @@ -6752,6 +7150,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FileOptions { @@ -6879,6 +7284,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FieldOptions. */ @@ -6896,6 +7308,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -6933,6 +7348,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -7011,6 +7429,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace FieldOptions { @@ -7118,6 +7543,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumOptions. */ @@ -7220,6 +7652,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnumValueOptions. */ @@ -7316,6 +7755,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ServiceOptions. */ @@ -7418,6 +7864,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a MethodOptions. */ @@ -7526,6 +7979,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace MethodOptions { @@ -7662,6 +8122,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace UninterpretedOption { @@ -7760,6 +8227,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -7851,6 +8325,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SourceCodeInfo { @@ -7967,6 +8448,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -8058,6 +8546,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace GeneratedCodeInfo { @@ -8076,6 +8571,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -8099,6 +8597,9 @@ export namespace google { /** Annotation end. */ public end: number; + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + /** * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set @@ -8168,6 +8669,23 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } } } @@ -8265,6 +8783,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Empty. */ @@ -8349,6 +8874,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -8447,6 +8979,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttestationNote + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AttestationNote { @@ -8539,6 +9078,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -8630,6 +9176,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Jwt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AttestationOccurrence. */ @@ -8732,6 +9285,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttestationOccurrence + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** NoteKind enum. */ @@ -8843,6 +9403,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedUrl + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Signature. */ @@ -8939,6 +9506,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Envelope. */ @@ -9041,6 +9615,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Envelope + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an EnvelopeSignature. */ @@ -9137,6 +9718,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvelopeSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FileLocation. */ @@ -9227,6 +9815,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a License. */ @@ -9323,6 +9918,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for License + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Digest. */ @@ -9419,6 +10021,13 @@ export namespace grafeas { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Digest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/protos/protos.js b/protos/protos.js index fbc5086..6e489e7 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -275,114 +275,124 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 7: - message.globalPolicyEvaluationMode = reader.int32(); - break; - case 2: - if (!(message.admissionWhitelistPatterns && message.admissionWhitelistPatterns.length)) - message.admissionWhitelistPatterns = []; - message.admissionWhitelistPatterns.push($root.google.cloud.binaryauthorization.v1.AdmissionWhitelistPattern.decode(reader, reader.uint32())); - break; - case 3: - if (message.clusterAdmissionRules === $util.emptyObject) - message.clusterAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.globalPolicyEvaluationMode = reader.int32(); + break; + } + case 2: { + if (!(message.admissionWhitelistPatterns && message.admissionWhitelistPatterns.length)) + message.admissionWhitelistPatterns = []; + message.admissionWhitelistPatterns.push($root.google.cloud.binaryauthorization.v1.AdmissionWhitelistPattern.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.clusterAdmissionRules === $util.emptyObject) + message.clusterAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.clusterAdmissionRules[key] = value; + break; } - message.clusterAdmissionRules[key] = value; - break; - case 10: - if (message.kubernetesNamespaceAdmissionRules === $util.emptyObject) - message.kubernetesNamespaceAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 10: { + if (message.kubernetesNamespaceAdmissionRules === $util.emptyObject) + message.kubernetesNamespaceAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.kubernetesNamespaceAdmissionRules[key] = value; + break; } - message.kubernetesNamespaceAdmissionRules[key] = value; - break; - case 8: - if (message.kubernetesServiceAccountAdmissionRules === $util.emptyObject) - message.kubernetesServiceAccountAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + if (message.kubernetesServiceAccountAdmissionRules === $util.emptyObject) + message.kubernetesServiceAccountAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.kubernetesServiceAccountAdmissionRules[key] = value; + break; } - message.kubernetesServiceAccountAdmissionRules[key] = value; - break; - case 9: - if (message.istioServiceIdentityAdmissionRules === $util.emptyObject) - message.istioServiceIdentityAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 9: { + if (message.istioServiceIdentityAdmissionRules === $util.emptyObject) + message.istioServiceIdentityAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.istioServiceIdentityAdmissionRules[key] = value; + break; + } + case 4: { + message.defaultAdmissionRule = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; } - message.istioServiceIdentityAdmissionRules[key] = value; - break; - case 4: - message.defaultAdmissionRule = $root.google.cloud.binaryauthorization.v1.AdmissionRule.decode(reader, reader.uint32()); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -666,6 +676,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.Policy"; + }; + /** * GlobalPolicyEvaluationMode enum. * @name google.cloud.binaryauthorization.v1.Policy.GlobalPolicyEvaluationMode @@ -777,9 +802,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.namePattern = reader.string(); - break; + case 1: { + message.namePattern = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -869,6 +895,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AdmissionWhitelistPattern + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.AdmissionWhitelistPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdmissionWhitelistPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.AdmissionWhitelistPattern"; + }; + return AdmissionWhitelistPattern; })(); @@ -988,17 +1029,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.evaluationMode = reader.int32(); - break; - case 2: - if (!(message.requireAttestationsBy && message.requireAttestationsBy.length)) - message.requireAttestationsBy = []; - message.requireAttestationsBy.push(reader.string()); - break; - case 3: - message.enforcementMode = reader.int32(); - break; + case 1: { + message.evaluationMode = reader.int32(); + break; + } + case 2: { + if (!(message.requireAttestationsBy && message.requireAttestationsBy.length)) + message.requireAttestationsBy = []; + message.requireAttestationsBy.push(reader.string()); + break; + } + case 3: { + message.enforcementMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1159,6 +1203,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AdmissionRule + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.AdmissionRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdmissionRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.AdmissionRule"; + }; + /** * EvaluationMode enum. * @name google.cloud.binaryauthorization.v1.AdmissionRule.EvaluationMode @@ -1335,18 +1394,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 3: - message.userOwnedGrafeasNote = $root.google.cloud.binaryauthorization.v1.UserOwnedGrafeasNote.decode(reader, reader.uint32()); - break; - case 4: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 3: { + message.userOwnedGrafeasNote = $root.google.cloud.binaryauthorization.v1.UserOwnedGrafeasNote.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1477,6 +1540,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Attestor + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.Attestor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attestor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.Attestor"; + }; + return Attestor; })(); @@ -1596,17 +1674,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.noteReference = reader.string(); - break; - case 2: - if (!(message.publicKeys && message.publicKeys.length)) - message.publicKeys = []; - message.publicKeys.push($root.google.cloud.binaryauthorization.v1.AttestorPublicKey.decode(reader, reader.uint32())); - break; - case 3: - message.delegationServiceAccountEmail = reader.string(); - break; + case 1: { + message.noteReference = reader.string(); + break; + } + case 2: { + if (!(message.publicKeys && message.publicKeys.length)) + message.publicKeys = []; + message.publicKeys.push($root.google.cloud.binaryauthorization.v1.AttestorPublicKey.decode(reader, reader.uint32())); + break; + } + case 3: { + message.delegationServiceAccountEmail = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1731,6 +1812,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UserOwnedGrafeasNote + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.UserOwnedGrafeasNote + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserOwnedGrafeasNote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.UserOwnedGrafeasNote"; + }; + return UserOwnedGrafeasNote; })(); @@ -1837,12 +1933,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.publicKeyPem = reader.string(); - break; - case 2: - message.signatureAlgorithm = reader.int32(); - break; + case 1: { + message.publicKeyPem = reader.string(); + break; + } + case 2: { + message.signatureAlgorithm = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2019,6 +2117,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PkixPublicKey + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.PkixPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PkixPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.PkixPublicKey"; + }; + /** * SignatureAlgorithm enum. * @name google.cloud.binaryauthorization.v1.PkixPublicKey.SignatureAlgorithm @@ -2201,18 +2314,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.comment = reader.string(); - break; - case 2: - message.id = reader.string(); - break; - case 3: - message.asciiArmoredPgpPublicKey = reader.string(); - break; - case 5: - message.pkixPublicKey = $root.google.cloud.binaryauthorization.v1.PkixPublicKey.decode(reader, reader.uint32()); - break; + case 1: { + message.comment = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.asciiArmoredPgpPublicKey = reader.string(); + break; + } + case 5: { + message.pkixPublicKey = $root.google.cloud.binaryauthorization.v1.PkixPublicKey.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2344,6 +2461,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AttestorPublicKey + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.AttestorPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttestorPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.AttestorPublicKey"; + }; + return AttestorPublicKey; })(); @@ -2380,7 +2512,7 @@ }; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#getPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|getPolicy}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef GetPolicyCallback * @type {function} @@ -2413,7 +2545,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#updatePolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|updatePolicy}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef UpdatePolicyCallback * @type {function} @@ -2446,7 +2578,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#createAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|createAttestor}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef CreateAttestorCallback * @type {function} @@ -2479,7 +2611,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#getAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|getAttestor}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef GetAttestorCallback * @type {function} @@ -2512,7 +2644,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#updateAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|updateAttestor}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef UpdateAttestorCallback * @type {function} @@ -2545,7 +2677,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#listAttestors}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|listAttestors}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef ListAttestorsCallback * @type {function} @@ -2578,7 +2710,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1#deleteAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1|deleteAttestor}. * @memberof google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1 * @typedef DeleteAttestorCallback * @type {function} @@ -2646,7 +2778,7 @@ }; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.SystemPolicyV1#getSystemPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.SystemPolicyV1|getSystemPolicy}. * @memberof google.cloud.binaryauthorization.v1.SystemPolicyV1 * @typedef GetSystemPolicyCallback * @type {function} @@ -2714,7 +2846,7 @@ }; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1.ValidationHelperV1#validateAttestationOccurrence}. + * Callback as used by {@link google.cloud.binaryauthorization.v1.ValidationHelperV1|validateAttestationOccurrence}. * @memberof google.cloud.binaryauthorization.v1.ValidationHelperV1 * @typedef ValidateAttestationOccurrenceCallback * @type {function} @@ -2841,9 +2973,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2933,6 +3066,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.GetPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.GetPolicyRequest"; + }; + return GetPolicyRequest; })(); @@ -3028,9 +3176,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.policy = $root.google.cloud.binaryauthorization.v1.Policy.decode(reader, reader.uint32()); - break; + case 1: { + message.policy = $root.google.cloud.binaryauthorization.v1.Policy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3125,6 +3274,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdatePolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.UpdatePolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.UpdatePolicyRequest"; + }; + return UpdatePolicyRequest; })(); @@ -3242,15 +3406,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.attestorId = reader.string(); - break; - case 3: - message.attestor = $root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.attestorId = reader.string(); + break; + } + case 3: { + message.attestor = $root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3362,6 +3529,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.CreateAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.CreateAttestorRequest"; + }; + return CreateAttestorRequest; })(); @@ -3457,9 +3639,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3549,6 +3732,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.GetAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.GetAttestorRequest"; + }; + return GetAttestorRequest; })(); @@ -3644,9 +3842,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attestor = $root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32()); - break; + case 1: { + message.attestor = $root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3741,6 +3940,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.UpdateAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.UpdateAttestorRequest"; + }; + return UpdateAttestorRequest; })(); @@ -3858,17 +4072,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } } @@ -3973,6 +4190,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAttestorsRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.ListAttestorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttestorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.ListAttestorsRequest"; + }; + return ListAttestorsRequest; })(); @@ -4081,14 +4313,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.attestors && message.attestors.length)) - message.attestors = []; - message.attestors.push($root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.attestors && message.attestors.length)) + message.attestors = []; + message.attestors.push($root.google.cloud.binaryauthorization.v1.Attestor.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4204,6 +4438,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAttestorsResponse + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.ListAttestorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttestorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.ListAttestorsResponse"; + }; + return ListAttestorsResponse; })(); @@ -4299,9 +4548,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4391,6 +4641,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.DeleteAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.DeleteAttestorRequest"; + }; + return DeleteAttestorRequest; })(); @@ -4486,9 +4751,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4578,6 +4844,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSystemPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.GetSystemPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSystemPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.GetSystemPolicyRequest"; + }; + return GetSystemPolicyRequest; })(); @@ -4706,18 +4987,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attestor = reader.string(); - break; - case 2: - message.attestation = $root.grafeas.v1.AttestationOccurrence.decode(reader, reader.uint32()); - break; - case 3: - message.occurrenceNote = reader.string(); - break; - case 4: - message.occurrenceResourceUri = reader.string(); - break; + case 1: { + message.attestor = reader.string(); + break; + } + case 2: { + message.attestation = $root.grafeas.v1.AttestationOccurrence.decode(reader, reader.uint32()); + break; + } + case 3: { + message.occurrenceNote = reader.string(); + break; + } + case 4: { + message.occurrenceResourceUri = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4837,6 +5122,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ValidateAttestationOccurrenceRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateAttestationOccurrenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest"; + }; + return ValidateAttestationOccurrenceRequest; })(); @@ -4943,12 +5243,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.result = reader.int32(); - break; - case 2: - message.denialReason = reader.string(); - break; + case 1: { + message.result = reader.int32(); + break; + } + case 2: { + message.denialReason = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5065,6 +5367,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ValidateAttestationOccurrenceResponse + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidateAttestationOccurrenceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse"; + }; + /** * Result enum. * @name google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse.Result @@ -5213,12 +5530,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.podEvent = $root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.decode(reader, reader.uint32()); - break; - case 2: - message.unsupportedPolicyEvent = $root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent.decode(reader, reader.uint32()); - break; + case 1: { + message.podEvent = $root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.decode(reader, reader.uint32()); + break; + } + case 2: { + message.unsupportedPolicyEvent = $root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5338,6 +5657,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ContinuousValidationEvent + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousValidationEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent"; + }; + ContinuousValidationEvent.ContinuousValidationPodEvent = (function() { /** @@ -5487,26 +5821,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 7: - message.podNamespace = reader.string(); - break; - case 1: - message.pod = reader.string(); - break; - case 2: - message.deployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 4: - message.verdict = reader.int32(); - break; - case 5: - if (!(message.images && message.images.length)) - message.images = []; - message.images.push($root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.decode(reader, reader.uint32())); - break; + case 7: { + message.podNamespace = reader.string(); + break; + } + case 1: { + message.pod = reader.string(); + break; + } + case 2: { + message.deployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.verdict = reader.int32(); + break; + } + case 5: { + if (!(message.images && message.images.length)) + message.images = []; + message.images.push($root.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -5678,6 +6018,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ContinuousValidationPodEvent + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContinuousValidationPodEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent"; + }; + /** * PolicyConformanceVerdict enum. * @name google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict @@ -5806,15 +6161,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.image = reader.string(); - break; - case 2: - message.result = reader.int32(); - break; - case 3: - message.description = reader.string(); - break; + case 1: { + message.image = reader.string(); + break; + } + case 2: { + message.result = reader.int32(); + break; + } + case 3: { + message.description = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5939,6 +6297,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ImageDetails + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails"; + }; + /** * AuditResult enum. * @name google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.ImageDetails.AuditResult @@ -6053,9 +6426,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.description = reader.string(); - break; + case 1: { + message.description = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6145,6 +6519,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UnsupportedPolicyEvent + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnsupportedPolicyEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.UnsupportedPolicyEvent"; + }; + return UnsupportedPolicyEvent; })(); @@ -6360,114 +6749,124 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 7: - message.globalPolicyEvaluationMode = reader.int32(); - break; - case 2: - if (!(message.admissionWhitelistPatterns && message.admissionWhitelistPatterns.length)) - message.admissionWhitelistPatterns = []; - message.admissionWhitelistPatterns.push($root.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.decode(reader, reader.uint32())); - break; - case 3: - if (message.clusterAdmissionRules === $util.emptyObject) - message.clusterAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.globalPolicyEvaluationMode = reader.int32(); + break; + } + case 2: { + if (!(message.admissionWhitelistPatterns && message.admissionWhitelistPatterns.length)) + message.admissionWhitelistPatterns = []; + message.admissionWhitelistPatterns.push($root.google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern.decode(reader, reader.uint32())); + break; + } + case 3: { + if (message.clusterAdmissionRules === $util.emptyObject) + message.clusterAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.clusterAdmissionRules[key] = value; + break; } - message.clusterAdmissionRules[key] = value; - break; - case 10: - if (message.kubernetesNamespaceAdmissionRules === $util.emptyObject) - message.kubernetesNamespaceAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 10: { + if (message.kubernetesNamespaceAdmissionRules === $util.emptyObject) + message.kubernetesNamespaceAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.kubernetesNamespaceAdmissionRules[key] = value; + break; } - message.kubernetesNamespaceAdmissionRules[key] = value; - break; - case 8: - if (message.kubernetesServiceAccountAdmissionRules === $util.emptyObject) - message.kubernetesServiceAccountAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 8: { + if (message.kubernetesServiceAccountAdmissionRules === $util.emptyObject) + message.kubernetesServiceAccountAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.kubernetesServiceAccountAdmissionRules[key] = value; + break; } - message.kubernetesServiceAccountAdmissionRules[key] = value; - break; - case 9: - if (message.istioServiceIdentityAdmissionRules === $util.emptyObject) - message.istioServiceIdentityAdmissionRules = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; + case 9: { + if (message.istioServiceIdentityAdmissionRules === $util.emptyObject) + message.istioServiceIdentityAdmissionRules = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.istioServiceIdentityAdmissionRules[key] = value; + break; + } + case 4: { + message.defaultAdmissionRule = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; } - message.istioServiceIdentityAdmissionRules[key] = value; - break; - case 4: - message.defaultAdmissionRule = $root.google.cloud.binaryauthorization.v1beta1.AdmissionRule.decode(reader, reader.uint32()); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -6751,6 +7150,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.Policy"; + }; + /** * GlobalPolicyEvaluationMode enum. * @name google.cloud.binaryauthorization.v1beta1.Policy.GlobalPolicyEvaluationMode @@ -6862,9 +7276,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.namePattern = reader.string(); - break; + case 1: { + message.namePattern = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6954,6 +7369,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AdmissionWhitelistPattern + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdmissionWhitelistPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern"; + }; + return AdmissionWhitelistPattern; })(); @@ -7073,17 +7503,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.evaluationMode = reader.int32(); - break; - case 2: - if (!(message.requireAttestationsBy && message.requireAttestationsBy.length)) - message.requireAttestationsBy = []; - message.requireAttestationsBy.push(reader.string()); - break; - case 3: - message.enforcementMode = reader.int32(); - break; + case 1: { + message.evaluationMode = reader.int32(); + break; + } + case 2: { + if (!(message.requireAttestationsBy && message.requireAttestationsBy.length)) + message.requireAttestationsBy = []; + message.requireAttestationsBy.push(reader.string()); + break; + } + case 3: { + message.enforcementMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7245,11 +7678,26 @@ }; /** - * EvaluationMode enum. - * @name google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode - * @enum {number} - * @property {number} EVALUATION_MODE_UNSPECIFIED=0 EVALUATION_MODE_UNSPECIFIED value - * @property {number} ALWAYS_ALLOW=1 ALWAYS_ALLOW value + * Gets the default type url for AdmissionRule + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.AdmissionRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdmissionRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.AdmissionRule"; + }; + + /** + * EvaluationMode enum. + * @name google.cloud.binaryauthorization.v1beta1.AdmissionRule.EvaluationMode + * @enum {number} + * @property {number} EVALUATION_MODE_UNSPECIFIED=0 EVALUATION_MODE_UNSPECIFIED value + * @property {number} ALWAYS_ALLOW=1 ALWAYS_ALLOW value * @property {number} REQUIRE_ATTESTATION=2 REQUIRE_ATTESTATION value * @property {number} ALWAYS_DENY=3 ALWAYS_DENY value */ @@ -7420,18 +7868,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 3: - message.userOwnedDrydockNote = $root.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.decode(reader, reader.uint32()); - break; - case 4: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 3: { + message.userOwnedDrydockNote = $root.google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7562,6 +8014,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Attestor + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.Attestor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Attestor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.Attestor"; + }; + return Attestor; })(); @@ -7681,17 +8148,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.noteReference = reader.string(); - break; - case 2: - if (!(message.publicKeys && message.publicKeys.length)) - message.publicKeys = []; - message.publicKeys.push($root.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.decode(reader, reader.uint32())); - break; - case 3: - message.delegationServiceAccountEmail = reader.string(); - break; + case 1: { + message.noteReference = reader.string(); + break; + } + case 2: { + if (!(message.publicKeys && message.publicKeys.length)) + message.publicKeys = []; + message.publicKeys.push($root.google.cloud.binaryauthorization.v1beta1.AttestorPublicKey.decode(reader, reader.uint32())); + break; + } + case 3: { + message.delegationServiceAccountEmail = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7816,6 +8286,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UserOwnedDrydockNote + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UserOwnedDrydockNote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.UserOwnedDrydockNote"; + }; + return UserOwnedDrydockNote; })(); @@ -7922,12 +8407,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.publicKeyPem = reader.string(); - break; - case 2: - message.signatureAlgorithm = reader.int32(); - break; + case 1: { + message.publicKeyPem = reader.string(); + break; + } + case 2: { + message.signatureAlgorithm = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -8104,6 +8591,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PkixPublicKey + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.PkixPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PkixPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.PkixPublicKey"; + }; + /** * SignatureAlgorithm enum. * @name google.cloud.binaryauthorization.v1beta1.PkixPublicKey.SignatureAlgorithm @@ -8286,18 +8788,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.comment = reader.string(); - break; - case 2: - message.id = reader.string(); - break; - case 3: - message.asciiArmoredPgpPublicKey = reader.string(); - break; - case 5: - message.pkixPublicKey = $root.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.decode(reader, reader.uint32()); - break; + case 1: { + message.comment = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + case 3: { + message.asciiArmoredPgpPublicKey = reader.string(); + break; + } + case 5: { + message.pkixPublicKey = $root.google.cloud.binaryauthorization.v1beta1.PkixPublicKey.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8429,6 +8935,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AttestorPublicKey + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.AttestorPublicKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttestorPublicKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.AttestorPublicKey"; + }; + return AttestorPublicKey; })(); @@ -8465,7 +8986,7 @@ }; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#getPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|getPolicy}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef GetPolicyCallback * @type {function} @@ -8498,7 +9019,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#updatePolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|updatePolicy}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef UpdatePolicyCallback * @type {function} @@ -8531,7 +9052,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#createAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|createAttestor}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef CreateAttestorCallback * @type {function} @@ -8564,7 +9085,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#getAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|getAttestor}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef GetAttestorCallback * @type {function} @@ -8597,7 +9118,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#updateAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|updateAttestor}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef UpdateAttestorCallback * @type {function} @@ -8630,7 +9151,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#listAttestors}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|listAttestors}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef ListAttestorsCallback * @type {function} @@ -8663,7 +9184,7 @@ */ /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1#deleteAttestor}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1|deleteAttestor}. * @memberof google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1 * @typedef DeleteAttestorCallback * @type {function} @@ -8790,9 +9311,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8882,6 +9404,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.GetPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.GetPolicyRequest"; + }; + return GetPolicyRequest; })(); @@ -8918,7 +9455,7 @@ }; /** - * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1#getSystemPolicy}. + * Callback as used by {@link google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1|getSystemPolicy}. * @memberof google.cloud.binaryauthorization.v1beta1.SystemPolicyV1Beta1 * @typedef GetSystemPolicyCallback * @type {function} @@ -9045,9 +9582,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.policy = $root.google.cloud.binaryauthorization.v1beta1.Policy.decode(reader, reader.uint32()); - break; + case 1: { + message.policy = $root.google.cloud.binaryauthorization.v1beta1.Policy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9142,6 +9680,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdatePolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest"; + }; + return UpdatePolicyRequest; })(); @@ -9259,15 +9812,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.attestorId = reader.string(); - break; - case 3: - message.attestor = $root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.attestorId = reader.string(); + break; + } + case 3: { + message.attestor = $root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9379,6 +9935,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest"; + }; + return CreateAttestorRequest; })(); @@ -9474,9 +10045,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9566,6 +10138,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.GetAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.GetAttestorRequest"; + }; + return GetAttestorRequest; })(); @@ -9661,9 +10248,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.attestor = $root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32()); - break; + case 1: { + message.attestor = $root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9758,6 +10346,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest"; + }; + return UpdateAttestorRequest; })(); @@ -9875,15 +10478,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9990,6 +10596,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAttestorsRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttestorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest"; + }; + return ListAttestorsRequest; })(); @@ -10098,14 +10719,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.attestors && message.attestors.length)) - message.attestors = []; - message.attestors.push($root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.attestors && message.attestors.length)) + message.attestors = []; + message.attestors.push($root.google.cloud.binaryauthorization.v1beta1.Attestor.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10221,6 +10844,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAttestorsResponse + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAttestorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.ListAttestorsResponse"; + }; + return ListAttestorsResponse; })(); @@ -10316,9 +10954,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10408,6 +11047,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteAttestorRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAttestorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest"; + }; + return DeleteAttestorRequest; })(); @@ -10503,9 +11157,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10595,6 +11250,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetSystemPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSystemPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest"; + }; + return GetSystemPolicyRequest; })(); @@ -10807,36 +11477,43 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); - break; - case 3: - message.nameField = reader.string(); - break; - case 4: - message.history = reader.int32(); - break; - case 5: - message.plural = reader.string(); - break; - case 6: - message.singular = reader.string(); - break; - case 10: - if (!(message.style && message.style.length)) - message.style = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else message.style.push(reader.int32()); - } else - message.style.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -11034,6 +11711,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + /** * History enum. * @name google.api.ResourceDescriptor.History @@ -11170,13 +11862,15 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); - break; - default: + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: reader.skipType(tag & 7); break; } @@ -11274,6 +11968,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + return ResourceReference; })(); @@ -11382,14 +12091,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - case 2: - message.fullyDecodeReservedExpansion = reader.bool(); - break; + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -11505,6 +12216,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + return Http; })(); @@ -11715,38 +12441,48 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -11968,6 +12704,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + return HttpRule; })(); @@ -12074,12 +12825,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12178,6 +12931,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + return CustomHttpPattern; })(); @@ -12287,11 +13055,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -12398,6 +13167,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + return FileDescriptorSet; })(); @@ -12419,6 +13203,7 @@ * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition */ /** @@ -12539,6 +13324,14 @@ */ FileDescriptorProto.prototype.syntax = ""; + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @function create @@ -12594,6 +13387,8 @@ writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); return writer; }; @@ -12628,66 +13423,82 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12799,6 +13610,9 @@ if (message.syntax != null && message.hasOwnProperty("syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; return null; }; @@ -12891,6 +13705,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -12922,6 +13738,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12968,6 +13785,8 @@ } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; @@ -12982,6 +13801,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + return FileDescriptorProto; })(); @@ -13192,52 +14026,62 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -13538,6 +14382,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + DescriptorProto.ExtensionRange = (function() { /** @@ -13652,15 +14511,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13772,6 +14634,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + return ExtensionRange; })(); @@ -13878,12 +14755,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -13982,6 +14861,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + return ReservedRange; })(); @@ -14082,11 +14976,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -14193,6 +15088,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + return ExtensionRangeOptions; })(); @@ -14398,39 +15308,50 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -14717,6 +15638,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type @@ -14885,12 +15821,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -14994,6 +15932,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + return OneofDescriptorProto; })(); @@ -15139,27 +16092,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -15335,6 +16293,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + EnumDescriptorProto.EnumReservedRange = (function() { /** @@ -15438,12 +16411,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -15542,6 +16517,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + return EnumReservedRange; })(); @@ -15662,15 +16652,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -15782,6 +16775,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + return EnumValueDescriptorProto; })(); @@ -15901,17 +16909,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -16041,6 +17052,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + return ServiceDescriptorProto; })(); @@ -16191,24 +17217,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -16344,6 +17376,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + return MethodDescriptorProto; })(); @@ -16674,76 +17721,98 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -17056,6 +18125,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode @@ -17224,26 +18308,32 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17397,6 +18487,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + return MessageOptions; })(); @@ -17410,6 +18515,7 @@ * @property {boolean|null} [packed] FieldOptions packed * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy * @property {boolean|null} [deprecated] FieldOptions deprecated * @property {boolean|null} [weak] FieldOptions weak * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption @@ -17466,6 +18572,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -17542,6 +18656,8 @@ writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); @@ -17587,42 +18703,55 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -17682,6 +18811,9 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; if (message.deprecated != null && message.hasOwnProperty("deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; @@ -17767,6 +18899,8 @@ } if (object.lazy != null) message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.weak != null) @@ -17854,6 +18988,7 @@ object.lazy = false; object.jstype = options.enums === String ? "JS_NORMAL" : 0; object.weak = false; + object.unverifiedLazy = false; object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) @@ -17868,6 +19003,8 @@ object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -17894,6 +19031,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + /** * CType enum. * @name google.protobuf.FieldOptions.CType @@ -18023,11 +19175,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18134,6 +19287,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + return OneofOptions; })(); @@ -18253,17 +19421,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18388,6 +19559,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + return EnumOptions; })(); @@ -18496,14 +19682,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -18619,6 +19807,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + return EnumValueOptions; })(); @@ -18749,20 +19952,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18895,6 +20102,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + return ServiceOptions; })(); @@ -19038,25 +20260,30 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -19233,6 +20460,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel @@ -19412,29 +20654,36 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -19547,7 +20796,7 @@ if (object.stringValue != null) if (typeof object.stringValue === "string") $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) + else if (object.stringValue.length >= 0) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); @@ -19628,6 +20877,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + UninterpretedOption.NamePart = (function() { /** @@ -19729,12 +20993,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -19835,6 +21101,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + return NamePart; })(); @@ -19935,11 +21216,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -20046,6 +21328,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + SourceCodeInfo.Location = (function() { /** @@ -20194,37 +21491,42 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -20385,6 +21687,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + return Location; })(); @@ -20485,11 +21802,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -20596,6 +21914,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + GeneratedCodeInfo.Annotation = (function() { /** @@ -20606,6 +21939,7 @@ * @property {string|null} [sourceFile] Annotation sourceFile * @property {number|null} [begin] Annotation begin * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic */ /** @@ -20656,6 +21990,14 @@ */ Annotation.prototype.end = 0; + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + /** * Creates a new Annotation instance using the specified properties. * @function create @@ -20692,6 +22034,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); return writer; }; @@ -20726,25 +22070,33 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -20796,6 +22148,15 @@ if (message.end != null && message.hasOwnProperty("end")) if (!$util.isInteger(message.end)) return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -20824,6 +22185,20 @@ message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; + switch (object.semantic) { + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } return message; }; @@ -20846,6 +22221,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -20858,6 +22234,8 @@ object.begin = message.begin; if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; @@ -20872,6 +22250,37 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + return Annotation; })(); @@ -20981,12 +22390,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -21099,6 +22510,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + return Timestamp; })(); @@ -21259,6 +22685,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + return Empty; })(); @@ -21378,9 +22819,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.hint = $root.grafeas.v1.AttestationNote.Hint.decode(reader, reader.uint32()); - break; + case 1: { + message.hint = $root.grafeas.v1.AttestationNote.Hint.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -21475,6 +22917,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AttestationNote + * @function getTypeUrl + * @memberof grafeas.v1.AttestationNote + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttestationNote.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.AttestationNote"; + }; + AttestationNote.Hint = (function() { /** @@ -21567,9 +23024,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.humanReadableName = reader.string(); - break; + case 1: { + message.humanReadableName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21659,6 +23117,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Hint + * @function getTypeUrl + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.AttestationNote.Hint"; + }; + return Hint; })(); @@ -21757,9 +23230,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.compactJwt = reader.string(); - break; + case 1: { + message.compactJwt = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21849,6 +23323,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Jwt + * @function getTypeUrl + * @memberof grafeas.v1.Jwt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Jwt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.Jwt"; + }; + return Jwt; })(); @@ -21970,19 +23459,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.serializedPayload = reader.bytes(); - break; - case 2: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.grafeas.v1.Signature.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.jwts && message.jwts.length)) - message.jwts = []; - message.jwts.push($root.grafeas.v1.Jwt.decode(reader, reader.uint32())); - break; + case 1: { + message.serializedPayload = reader.bytes(); + break; + } + case 2: { + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.grafeas.v1.Signature.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.jwts && message.jwts.length)) + message.jwts = []; + message.jwts.push($root.grafeas.v1.Jwt.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -22057,7 +23549,7 @@ if (object.serializedPayload != null) if (typeof object.serializedPayload === "string") $util.base64.decode(object.serializedPayload, message.serializedPayload = $util.newBuffer($util.base64.length(object.serializedPayload)), 0); - else if (object.serializedPayload.length) + else if (object.serializedPayload.length >= 0) message.serializedPayload = object.serializedPayload; if (object.signatures) { if (!Array.isArray(object.signatures)) @@ -22133,6 +23625,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AttestationOccurrence + * @function getTypeUrl + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttestationOccurrence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.AttestationOccurrence"; + }; + return AttestationOccurrence; })(); @@ -22271,12 +23778,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.url = reader.string(); - break; - case 2: - message.label = reader.string(); - break; + case 1: { + message.url = reader.string(); + break; + } + case 2: { + message.label = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22375,6 +23884,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RelatedUrl + * @function getTypeUrl + * @memberof grafeas.v1.RelatedUrl + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.RelatedUrl"; + }; + return RelatedUrl; })(); @@ -22481,12 +24005,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.signature = reader.bytes(); - break; - case 2: - message.publicKeyId = reader.string(); - break; + case 1: { + message.signature = reader.bytes(); + break; + } + case 2: { + message.publicKeyId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22546,7 +24072,7 @@ if (object.signature != null) if (typeof object.signature === "string") $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) + else if (object.signature.length >= 0) message.signature = object.signature; if (object.publicKeyId != null) message.publicKeyId = String(object.publicKeyId); @@ -22594,6 +24120,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof grafeas.v1.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.Signature"; + }; + return Signature; })(); @@ -22713,17 +24254,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.payload = reader.bytes(); - break; - case 2: - message.payloadType = reader.string(); - break; - case 3: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.grafeas.v1.EnvelopeSignature.decode(reader, reader.uint32())); - break; + case 1: { + message.payload = reader.bytes(); + break; + } + case 2: { + message.payloadType = reader.string(); + break; + } + case 3: { + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.grafeas.v1.EnvelopeSignature.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -22792,7 +24336,7 @@ if (object.payload != null) if (typeof object.payload === "string") $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length) + else if (object.payload.length >= 0) message.payload = object.payload; if (object.payloadType != null) message.payloadType = String(object.payloadType); @@ -22857,6 +24401,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Envelope + * @function getTypeUrl + * @memberof grafeas.v1.Envelope + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Envelope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.Envelope"; + }; + return Envelope; })(); @@ -22963,12 +24522,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.sig = reader.bytes(); - break; - case 2: - message.keyid = reader.string(); - break; + case 1: { + message.sig = reader.bytes(); + break; + } + case 2: { + message.keyid = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23028,7 +24589,7 @@ if (object.sig != null) if (typeof object.sig === "string") $util.base64.decode(object.sig, message.sig = $util.newBuffer($util.base64.length(object.sig)), 0); - else if (object.sig.length) + else if (object.sig.length >= 0) message.sig = object.sig; if (object.keyid != null) message.keyid = String(object.keyid); @@ -23076,6 +24637,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for EnvelopeSignature + * @function getTypeUrl + * @memberof grafeas.v1.EnvelopeSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvelopeSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.EnvelopeSignature"; + }; + return EnvelopeSignature; })(); @@ -23171,9 +24747,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.filePath = reader.string(); - break; + case 1: { + message.filePath = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23263,6 +24840,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileLocation + * @function getTypeUrl + * @memberof grafeas.v1.FileLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.FileLocation"; + }; + return FileLocation; })(); @@ -23369,12 +24961,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.comments = reader.string(); - break; + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.comments = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23473,6 +25067,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for License + * @function getTypeUrl + * @memberof grafeas.v1.License + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + License.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.License"; + }; + return License; })(); @@ -23579,12 +25188,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.algo = reader.string(); - break; - case 2: - message.digestBytes = reader.bytes(); - break; + case 1: { + message.algo = reader.string(); + break; + } + case 2: { + message.digestBytes = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -23646,7 +25257,7 @@ if (object.digestBytes != null) if (typeof object.digestBytes === "string") $util.base64.decode(object.digestBytes, message.digestBytes = $util.newBuffer($util.base64.length(object.digestBytes)), 0); - else if (object.digestBytes.length) + else if (object.digestBytes.length >= 0) message.digestBytes = object.digestBytes; return message; }; @@ -23692,6 +25303,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Digest + * @function getTypeUrl + * @memberof grafeas.v1.Digest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Digest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/grafeas.v1.Digest"; + }; + return Digest; })(); diff --git a/protos/protos.json b/protos/protos.json index 56a3832..d248349 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1640,6 +1640,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2168,6 +2172,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2460,6 +2471,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From f412b6e8349aab08d3d5d985cd38f91750c1f030 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 22:46:18 +0000 Subject: [PATCH 05/11] fix: remove pip install statements (#1546) (#175) because the tools are already installed in the docker image as of https://github.com/googleapis/testing-infra-docker/pull/227 Source-Link: https://github.com/googleapis/synthtool/commit/ab7384ea1c30df8ec2e175566ef2508e6c3a2acb Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:bb493bf01d28519e82ab61c490c20122c85a7119c03a978ad0c34b4239fbad15 --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/publish.sh | 1 - .kokoro/release/docs.sh | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index f7c796c..7488369 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e -# created: 2022-08-22T22:07:00.791732705Z + digest: sha256:bb493bf01d28519e82ab61c490c20122c85a7119c03a978ad0c34b4239fbad15 +# created: 2022-08-23T18:40:55.597313991Z diff --git a/.kokoro/publish.sh b/.kokoro/publish.sh index 77a5def..949e3e1 100755 --- a/.kokoro/publish.sh +++ b/.kokoro/publish.sh @@ -19,7 +19,6 @@ set -eo pipefail export NPM_CONFIG_PREFIX=${HOME}/.npm-global # Start the releasetool reporter -python3 -m pip install gcp-releasetool python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script cd $(dirname $0)/.. diff --git a/.kokoro/release/docs.sh b/.kokoro/release/docs.sh index 4c866c8..1d8f3f4 100755 --- a/.kokoro/release/docs.sh +++ b/.kokoro/release/docs.sh @@ -29,7 +29,6 @@ npm run docs # create docs.metadata, based on package.json and .repo-metadata.json. npm i json@9.0.6 -g -python3 -m pip install --user gcp-docuploader python3 -m docuploader create-metadata \ --name=$(cat .repo-metadata.json | json name) \ --version=$(cat package.json | json version) \ From 1a53ab4d1bb04f4759494973a3297c3dcf295833 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 04:58:12 +0000 Subject: [PATCH 06/11] fix: do not import the whole google-gax from proto JS (#1553) (#176) fix: use google-gax v3.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/c73d112a11a1f1a93efa67c50495c19aa3a88910 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e --- .github/.OwlBot.lock.yaml | 4 ++-- package.json | 2 +- protos/protos.d.ts | 2 +- protos/protos.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7488369..4d586c4 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest - digest: sha256:bb493bf01d28519e82ab61c490c20122c85a7119c03a978ad0c34b4239fbad15 -# created: 2022-08-23T18:40:55.597313991Z + digest: sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e +# created: 2022-08-26T22:34:55.905845397Z diff --git a/package.json b/package.json index 22b1725..fe81f34 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 59e80b5..11f58a7 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import Long = require("long"); -import {protobuf as $protobuf} from "google-gax"; +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/protos/protos.js b/protos/protos.js index 6e489e7..bdad684 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; From 6ef4a520c1bb49fca8159324dbf41af10931357e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:52:25 +0000 Subject: [PATCH 07/11] fix: allow passing gax instance to client constructor (#177) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 --- .../binauthz_management_service_v1_client.ts | 45 ++++++++++++------- src/v1/system_policy_v1_client.ts | 33 +++++++++++--- src/v1/validation_helper_v1_client.ts | 33 +++++++++++--- ...uthz_management_service_v1_beta1_client.ts | 45 ++++++++++++------- src/v1beta1/system_policy_v1_beta1_client.ts | 33 +++++++++++--- 5 files changed, 136 insertions(+), 53 deletions(-) diff --git a/src/v1/binauthz_management_service_v1_client.ts b/src/v1/binauthz_management_service_v1_client.ts index 70213cf..d16fbd1 100644 --- a/src/v1/binauthz_management_service_v1_client.ts +++ b/src/v1/binauthz_management_service_v1_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './binauthz_management_service_v1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -102,8 +100,18 @@ export class BinauthzManagementServiceV1Client { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BinauthzManagementServiceV1Client({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof BinauthzManagementServiceV1Client; @@ -124,8 +132,13 @@ export class BinauthzManagementServiceV1Client { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -208,7 +221,7 @@ export class BinauthzManagementServiceV1Client { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -427,7 +440,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -530,7 +543,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'policy.name': request.policy!.name || '', }); this.initialize(); @@ -636,7 +649,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -735,7 +748,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -835,7 +848,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'attestor.name': request.attestor!.name || '', }); this.initialize(); @@ -934,7 +947,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1038,7 +1051,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1080,7 +1093,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAttestors']; @@ -1131,7 +1144,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAttestors']; diff --git a/src/v1/system_policy_v1_client.ts b/src/v1/system_policy_v1_client.ts index e951c8f..d7a347f 100644 --- a/src/v1/system_policy_v1_client.ts +++ b/src/v1/system_policy_v1_client.ts @@ -17,8 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './system_policy_v1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -88,8 +92,18 @@ export class SystemPolicyV1Client { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SystemPolicyV1Client({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SystemPolicyV1Client; const servicePath = @@ -109,8 +123,13 @@ export class SystemPolicyV1Client { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -182,7 +201,7 @@ export class SystemPolicyV1Client { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -393,7 +412,7 @@ export class SystemPolicyV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); diff --git a/src/v1/validation_helper_v1_client.ts b/src/v1/validation_helper_v1_client.ts index 12900a9..ebbd229 100644 --- a/src/v1/validation_helper_v1_client.ts +++ b/src/v1/validation_helper_v1_client.ts @@ -17,8 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './validation_helper_v1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -88,8 +92,18 @@ export class ValidationHelperV1Client { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ValidationHelperV1Client({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof ValidationHelperV1Client; const servicePath = @@ -109,8 +123,13 @@ export class ValidationHelperV1Client { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -182,7 +201,7 @@ export class ValidationHelperV1Client { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -406,7 +425,7 @@ export class ValidationHelperV1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ attestor: request.attestor || '', }); this.initialize(); diff --git a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 7cc803d..4450ba7 100644 --- a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -26,7 +26,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -36,7 +35,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './binauthz_management_service_v1_beta1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -102,8 +100,18 @@ export class BinauthzManagementServiceV1Beta1Client { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new BinauthzManagementServiceV1Beta1Client({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof BinauthzManagementServiceV1Beta1Client; @@ -124,8 +132,13 @@ export class BinauthzManagementServiceV1Beta1Client { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -208,7 +221,7 @@ export class BinauthzManagementServiceV1Beta1Client { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -433,7 +446,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -536,7 +549,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'policy.name': request.policy!.name || '', }); this.initialize(); @@ -642,7 +655,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -741,7 +754,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -841,7 +854,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'attestor.name': request.attestor!.name || '', }); this.initialize(); @@ -940,7 +953,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1044,7 +1057,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1086,7 +1099,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAttestors']; @@ -1137,7 +1150,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAttestors']; diff --git a/src/v1beta1/system_policy_v1_beta1_client.ts b/src/v1beta1/system_policy_v1_beta1_client.ts index 17b0f2e..3daa3b8 100644 --- a/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/src/v1beta1/system_policy_v1_beta1_client.ts @@ -17,8 +17,13 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +33,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './system_policy_v1_beta1_client_config.json'; - const version = require('../../../package.json').version; /** @@ -88,8 +92,18 @@ export class SystemPolicyV1Beta1Client { * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new SystemPolicyV1Beta1Client({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof SystemPolicyV1Beta1Client; const servicePath = @@ -109,8 +123,13 @@ export class SystemPolicyV1Beta1Client { opts['scopes'] = staticMembers.scopes; } + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); @@ -182,7 +201,7 @@ export class SystemPolicyV1Beta1Client { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -393,7 +412,7 @@ export class SystemPolicyV1Beta1Client { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); From 80b0dcf989b20f874e0912af641fdc12419887f2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:36:15 +0000 Subject: [PATCH 08/11] fix: preserve default values in x-goog-request-params header (#180) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- .../binauthz_management_service_v1_client.ts | 18 +- src/v1/system_policy_v1_client.ts | 2 +- src/v1/validation_helper_v1_client.ts | 2 +- ...uthz_management_service_v1_beta1_client.ts | 18 +- src/v1beta1/system_policy_v1_beta1_client.ts | 2 +- ...thz_management_service_v1_beta1_v1beta1.ts | 692 +++++++++--------- ...gapic_binauthz_management_service_v1_v1.ts | 692 +++++++++--------- test/gapic_system_policy_v1_beta1_v1beta1.ts | 101 +-- test/gapic_system_policy_v1_v1.ts | 101 +-- test/gapic_validation_helper_v1_v1.ts | 105 +-- 10 files changed, 911 insertions(+), 822 deletions(-) diff --git a/src/v1/binauthz_management_service_v1_client.ts b/src/v1/binauthz_management_service_v1_client.ts index d16fbd1..5e0661f 100644 --- a/src/v1/binauthz_management_service_v1_client.ts +++ b/src/v1/binauthz_management_service_v1_client.ts @@ -441,7 +441,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getPolicy(request, options, callback); @@ -544,7 +544,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'policy.name': request.policy!.name || '', + 'policy.name': request.policy!.name ?? '', }); this.initialize(); return this.innerApiCalls.updatePolicy(request, options, callback); @@ -650,7 +650,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createAttestor(request, options, callback); @@ -749,7 +749,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getAttestor(request, options, callback); @@ -849,7 +849,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'attestor.name': request.attestor!.name || '', + 'attestor.name': request.attestor!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateAttestor(request, options, callback); @@ -948,7 +948,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteAttestor(request, options, callback); @@ -1052,7 +1052,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAttestors(request, options, callback); @@ -1094,7 +1094,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); @@ -1145,7 +1145,7 @@ export class BinauthzManagementServiceV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1/system_policy_v1_client.ts b/src/v1/system_policy_v1_client.ts index d7a347f..9acab89 100644 --- a/src/v1/system_policy_v1_client.ts +++ b/src/v1/system_policy_v1_client.ts @@ -413,7 +413,7 @@ export class SystemPolicyV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSystemPolicy(request, options, callback); diff --git a/src/v1/validation_helper_v1_client.ts b/src/v1/validation_helper_v1_client.ts index ebbd229..134e605 100644 --- a/src/v1/validation_helper_v1_client.ts +++ b/src/v1/validation_helper_v1_client.ts @@ -426,7 +426,7 @@ export class ValidationHelperV1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - attestor: request.attestor || '', + attestor: request.attestor ?? '', }); this.initialize(); return this.innerApiCalls.validateAttestationOccurrence( diff --git a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 4450ba7..0876ed4 100644 --- a/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -447,7 +447,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getPolicy(request, options, callback); @@ -550,7 +550,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'policy.name': request.policy!.name || '', + 'policy.name': request.policy!.name ?? '', }); this.initialize(); return this.innerApiCalls.updatePolicy(request, options, callback); @@ -656,7 +656,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createAttestor(request, options, callback); @@ -755,7 +755,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getAttestor(request, options, callback); @@ -855,7 +855,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'attestor.name': request.attestor!.name || '', + 'attestor.name': request.attestor!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateAttestor(request, options, callback); @@ -954,7 +954,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteAttestor(request, options, callback); @@ -1058,7 +1058,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAttestors(request, options, callback); @@ -1100,7 +1100,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); @@ -1151,7 +1151,7 @@ export class BinauthzManagementServiceV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); diff --git a/src/v1beta1/system_policy_v1_beta1_client.ts b/src/v1beta1/system_policy_v1_beta1_client.ts index 3daa3b8..75b01ed 100644 --- a/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/src/v1beta1/system_policy_v1_beta1_client.ts @@ -413,7 +413,7 @@ export class SystemPolicyV1Beta1Client { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getSystemPolicy(request, options, callback); diff --git a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts index 6e8197a..baa8f96 100644 --- a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts +++ b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -254,26 +269,23 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); client.innerApiCalls.getPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy without error using callback', async () => { @@ -288,15 +300,9 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -319,11 +325,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy with error', async () => { @@ -338,23 +347,20 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getPolicy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getPolicy(request), expectedError); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy with closed client', async () => { @@ -369,7 +375,8 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getPolicy(request), expectedError); @@ -389,27 +396,27 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); client.innerApiCalls.updatePolicy = stubSimpleCall(expectedResponse); const [response] = await client.updatePolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy without error using callback', async () => { @@ -424,16 +431,13 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -456,11 +460,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy with error', async () => { @@ -475,27 +482,27 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updatePolicy(request), expectedError); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy with closed client', async () => { @@ -510,8 +517,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updatePolicy(request), expectedError); @@ -531,26 +542,25 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); client.innerApiCalls.createAttestor = stubSimpleCall(expectedResponse); const [response] = await client.createAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor without error using callback', async () => { @@ -565,15 +575,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -596,11 +602,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor with error', async () => { @@ -615,26 +624,25 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createAttestor(request), expectedError); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor with closed client', async () => { @@ -649,7 +657,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAttestor(request), expectedError); @@ -669,26 +680,23 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); client.innerApiCalls.getAttestor = stubSimpleCall(expectedResponse); const [response] = await client.getAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor without error using callback', async () => { @@ -703,15 +711,9 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -734,11 +736,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor with error', async () => { @@ -753,26 +758,23 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getAttestor(request), expectedError); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor with closed client', async () => { @@ -787,7 +789,8 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getAttestor(request), expectedError); @@ -807,27 +810,27 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); client.innerApiCalls.updateAttestor = stubSimpleCall(expectedResponse); const [response] = await client.updateAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor without error using callback', async () => { @@ -842,16 +845,13 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -874,11 +874,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor with error', async () => { @@ -893,27 +896,27 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateAttestor(request), expectedError); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor with closed client', async () => { @@ -928,8 +931,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateAttestor(request), expectedError); @@ -949,26 +956,25 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteAttestor = stubSimpleCall(expectedResponse); const [response] = await client.deleteAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor without error using callback', async () => { @@ -983,15 +989,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1014,11 +1016,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor with error', async () => { @@ -1033,26 +1038,25 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteAttestor(request), expectedError); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor with closed client', async () => { @@ -1067,7 +1071,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteAttestor(request), expectedError); @@ -1087,15 +1094,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1110,11 +1113,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { client.innerApiCalls.listAttestors = stubSimpleCall(expectedResponse); const [response] = await client.listAttestors(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestors without error using callback', async () => { @@ -1129,15 +1135,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1170,11 +1172,14 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestors with error', async () => { @@ -1189,26 +1194,25 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAttestors = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAttestors(request), expectedError); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestorsStream without error', async () => { @@ -1223,8 +1227,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1264,11 +1271,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { .getCall(0) .calledWith(client.innerApiCalls.listAttestors, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1284,8 +1292,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1314,11 +1325,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { .getCall(0) .calledWith(client.innerApiCalls.listAttestors, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1334,8 +1346,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1362,11 +1377,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1382,8 +1398,11 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1401,11 +1420,12 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_binauthz_management_service_v1_v1.ts b/test/gapic_binauthz_management_service_v1_v1.ts index bd51794..bc6522b 100644 --- a/test/gapic_binauthz_management_service_v1_v1.ts +++ b/test/gapic_binauthz_management_service_v1_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -248,26 +263,23 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); client.innerApiCalls.getPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy without error using callback', async () => { @@ -282,15 +294,9 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -313,11 +319,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy with error', async () => { @@ -332,23 +341,20 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getPolicy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getPolicy(request), expectedError); - assert( - (client.innerApiCalls.getPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getPolicy with closed client', async () => { @@ -363,7 +369,8 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getPolicy(request), expectedError); @@ -383,27 +390,27 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); client.innerApiCalls.updatePolicy = stubSimpleCall(expectedResponse); const [response] = await client.updatePolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy without error using callback', async () => { @@ -418,16 +425,13 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -450,11 +454,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy with error', async () => { @@ -469,27 +476,27 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; - const expectedHeaderRequestParams = 'policy.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updatePolicy(request), expectedError); - assert( - (client.innerApiCalls.updatePolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updatePolicy with closed client', async () => { @@ -504,8 +511,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); - request.policy = {}; - request.policy.name = ''; + request.policy ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ + 'policy', + 'name', + ]); + request.policy.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updatePolicy(request), expectedError); @@ -525,26 +536,25 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); client.innerApiCalls.createAttestor = stubSimpleCall(expectedResponse); const [response] = await client.createAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor without error using callback', async () => { @@ -559,15 +569,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -590,11 +596,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor with error', async () => { @@ -609,26 +618,25 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.createAttestor(request), expectedError); - assert( - (client.innerApiCalls.createAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createAttestor with closed client', async () => { @@ -643,7 +651,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.createAttestor(request), expectedError); @@ -663,26 +674,23 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); client.innerApiCalls.getAttestor = stubSimpleCall(expectedResponse); const [response] = await client.getAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor without error using callback', async () => { @@ -697,15 +705,9 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -728,11 +730,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor with error', async () => { @@ -747,26 +752,23 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getAttestor(request), expectedError); - assert( - (client.innerApiCalls.getAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getAttestor with closed client', async () => { @@ -781,7 +783,8 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getAttestor(request), expectedError); @@ -801,27 +804,27 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); client.innerApiCalls.updateAttestor = stubSimpleCall(expectedResponse); const [response] = await client.updateAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor without error using callback', async () => { @@ -836,16 +839,13 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -868,11 +868,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor with error', async () => { @@ -887,27 +890,27 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; - const expectedHeaderRequestParams = 'attestor.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateAttestor(request), expectedError); - assert( - (client.innerApiCalls.updateAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateAttestor with closed client', async () => { @@ -922,8 +925,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); - request.attestor = {}; - request.attestor.name = ''; + request.attestor ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ + 'attestor', + 'name', + ]); + request.attestor.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateAttestor(request), expectedError); @@ -943,26 +950,25 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteAttestor = stubSimpleCall(expectedResponse); const [response] = await client.deleteAttestor(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor without error using callback', async () => { @@ -977,15 +983,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1008,11 +1010,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor with error', async () => { @@ -1027,26 +1032,25 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAttestor = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteAttestor(request), expectedError); - assert( - (client.innerApiCalls.deleteAttestor as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteAttestor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteAttestor with closed client', async () => { @@ -1061,7 +1065,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteAttestor(request), expectedError); @@ -1081,15 +1088,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1104,11 +1107,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { client.innerApiCalls.listAttestors = stubSimpleCall(expectedResponse); const [response] = await client.listAttestors(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestors without error using callback', async () => { @@ -1123,15 +1129,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1164,11 +1166,14 @@ describe('v1.BinauthzManagementServiceV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestors with error', async () => { @@ -1183,26 +1188,25 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAttestors = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listAttestors(request), expectedError); - assert( - (client.innerApiCalls.listAttestors as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAttestors as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAttestorsStream without error', async () => { @@ -1217,8 +1221,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1256,11 +1263,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { .getCall(0) .calledWith(client.innerApiCalls.listAttestors, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1276,8 +1284,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1304,11 +1315,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { .getCall(0) .calledWith(client.innerApiCalls.listAttestors, request) ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1324,8 +1336,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1352,11 +1367,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1372,8 +1388,11 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1391,11 +1410,12 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listAttestors.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listAttestors.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/test/gapic_system_policy_v1_beta1_v1beta1.ts b/test/gapic_system_policy_v1_beta1_v1beta1.ts index e54f179..a229182 100644 --- a/test/gapic_system_policy_v1_beta1_v1beta1.ts +++ b/test/gapic_system_policy_v1_beta1_v1beta1.ts @@ -25,6 +25,21 @@ import * as systempolicyv1beta1Module from '../src'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -168,26 +183,25 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); client.innerApiCalls.getSystemPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getSystemPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy without error using callback', async () => { @@ -200,15 +214,11 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -231,11 +241,14 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy with error', async () => { @@ -248,26 +261,25 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSystemPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getSystemPolicy(request), expectedError); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy with closed client', async () => { @@ -280,7 +292,10 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSystemPolicy(request), expectedError); diff --git a/test/gapic_system_policy_v1_v1.ts b/test/gapic_system_policy_v1_v1.ts index e8d6283..e6f257c 100644 --- a/test/gapic_system_policy_v1_v1.ts +++ b/test/gapic_system_policy_v1_v1.ts @@ -25,6 +25,21 @@ import * as systempolicyv1Module from '../src'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -159,26 +174,25 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); client.innerApiCalls.getSystemPolicy = stubSimpleCall(expectedResponse); const [response] = await client.getSystemPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy without error using callback', async () => { @@ -190,15 +204,11 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -221,11 +231,14 @@ describe('v1.SystemPolicyV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy with error', async () => { @@ -237,26 +250,25 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getSystemPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getSystemPolicy(request), expectedError); - assert( - (client.innerApiCalls.getSystemPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSystemPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getSystemPolicy with closed client', async () => { @@ -268,7 +280,10 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getSystemPolicy(request), expectedError); diff --git a/test/gapic_validation_helper_v1_v1.ts b/test/gapic_validation_helper_v1_v1.ts index 8b19183..274a39c 100644 --- a/test/gapic_validation_helper_v1_v1.ts +++ b/test/gapic_validation_helper_v1_v1.ts @@ -25,6 +25,21 @@ import * as validationhelperv1Module from '../src'; import {protobuf} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -159,15 +174,12 @@ describe('v1.ValidationHelperV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); - request.attestor = ''; - const expectedHeaderRequestParams = 'attestor='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ValidateAttestationOccurrenceRequest', + ['attestor'] + ); + request.attestor = defaultValue1; + const expectedHeaderRequestParams = `attestor=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse() ); @@ -175,11 +187,14 @@ describe('v1.ValidationHelperV1Client', () => { stubSimpleCall(expectedResponse); const [response] = await client.validateAttestationOccurrence(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.validateAttestationOccurrence as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes validateAttestationOccurrence without error using callback', async () => { @@ -191,15 +206,12 @@ describe('v1.ValidationHelperV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); - request.attestor = ''; - const expectedHeaderRequestParams = 'attestor='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ValidateAttestationOccurrenceRequest', + ['attestor'] + ); + request.attestor = defaultValue1; + const expectedHeaderRequestParams = `attestor=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse() ); @@ -222,11 +234,14 @@ describe('v1.ValidationHelperV1Client', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.validateAttestationOccurrence as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes validateAttestationOccurrence with error', async () => { @@ -238,15 +253,12 @@ describe('v1.ValidationHelperV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); - request.attestor = ''; - const expectedHeaderRequestParams = 'attestor='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ValidateAttestationOccurrenceRequest', + ['attestor'] + ); + request.attestor = defaultValue1; + const expectedHeaderRequestParams = `attestor=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.validateAttestationOccurrence = stubSimpleCall( undefined, @@ -256,11 +268,14 @@ describe('v1.ValidationHelperV1Client', () => { client.validateAttestationOccurrence(request), expectedError ); - assert( - (client.innerApiCalls.validateAttestationOccurrence as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.validateAttestationOccurrence as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes validateAttestationOccurrence with closed client', async () => { @@ -272,7 +287,11 @@ describe('v1.ValidationHelperV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); - request.attestor = ''; + const defaultValue1 = getTypeDefaultValue( + 'ValidateAttestationOccurrenceRequest', + ['attestor'] + ); + request.attestor = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( From 2b5fc77583b7dc505684bd7fe8a96d127d252d85 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:12:10 -0700 Subject: [PATCH 09/11] test: use fully qualified request type name in tests (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 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 --- ...thz_management_service_v1_beta1_v1beta1.ts | 209 +++++++++++------- ...gapic_binauthz_management_service_v1_v1.ts | 209 +++++++++++------- test/gapic_system_policy_v1_beta1_v1beta1.ts | 28 ++- test/gapic_system_policy_v1_v1.ts | 28 ++- test/gapic_validation_helper_v1_v1.ts | 8 +- 5 files changed, 284 insertions(+), 198 deletions(-) diff --git a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts index baa8f96..3e39613 100644 --- a/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts +++ b/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts @@ -269,7 +269,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -300,7 +303,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -347,7 +353,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -375,7 +384,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -397,10 +409,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -432,10 +444,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -483,10 +495,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -518,10 +530,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -542,9 +554,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -575,9 +588,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -624,9 +638,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -657,9 +672,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -680,7 +696,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -711,7 +730,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -758,7 +780,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -789,7 +814,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -811,10 +839,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -846,10 +874,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -897,10 +925,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -932,10 +960,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { new protos.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -956,9 +984,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -989,9 +1018,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1038,9 +1068,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1071,9 +1102,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1094,9 +1126,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1135,9 +1168,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1194,9 +1228,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1227,9 +1262,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1292,9 +1328,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1346,9 +1383,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1398,9 +1436,10 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/test/gapic_binauthz_management_service_v1_v1.ts b/test/gapic_binauthz_management_service_v1_v1.ts index bc6522b..aa1d757 100644 --- a/test/gapic_binauthz_management_service_v1_v1.ts +++ b/test/gapic_binauthz_management_service_v1_v1.ts @@ -263,7 +263,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -294,7 +297,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -341,7 +347,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -369,7 +378,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetPolicyRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -391,10 +403,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -426,10 +438,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -477,10 +489,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -512,10 +524,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdatePolicyRequest() ); request.policy ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdatePolicyRequest', [ - 'policy', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdatePolicyRequest', + ['policy', 'name'] + ); request.policy.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -536,9 +548,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -569,9 +582,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -618,9 +632,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -651,9 +666,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.CreateAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateAttestorRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.CreateAttestorRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -674,7 +690,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -705,7 +724,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -752,7 +774,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -783,7 +808,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('GetAttestorRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -805,10 +833,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -840,10 +868,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -891,10 +919,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -926,10 +954,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { new protos.google.cloud.binaryauthorization.v1.UpdateAttestorRequest() ); request.attestor ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateAttestorRequest', [ - 'attestor', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.UpdateAttestorRequest', + ['attestor', 'name'] + ); request.attestor.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -950,9 +978,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -983,9 +1012,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1032,9 +1062,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1065,9 +1096,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.DeleteAttestorRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteAttestorRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.DeleteAttestorRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -1088,9 +1120,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1129,9 +1162,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1188,9 +1222,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1221,9 +1256,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1284,9 +1320,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1336,9 +1373,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1388,9 +1426,10 @@ describe('v1.BinauthzManagementServiceV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ListAttestorsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListAttestorsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.ListAttestorsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/test/gapic_system_policy_v1_beta1_v1beta1.ts b/test/gapic_system_policy_v1_beta1_v1beta1.ts index a229182..2f01095 100644 --- a/test/gapic_system_policy_v1_beta1_v1beta1.ts +++ b/test/gapic_system_policy_v1_beta1_v1beta1.ts @@ -183,9 +183,10 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -214,9 +215,10 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -261,9 +263,10 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -292,9 +295,10 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1beta1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); diff --git a/test/gapic_system_policy_v1_v1.ts b/test/gapic_system_policy_v1_v1.ts index e6f257c..11b8ecc 100644 --- a/test/gapic_system_policy_v1_v1.ts +++ b/test/gapic_system_policy_v1_v1.ts @@ -174,9 +174,10 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -204,9 +205,10 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -250,9 +252,10 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -280,9 +283,10 @@ describe('v1.SystemPolicyV1Client', () => { const request = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('GetSystemPolicyRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.binaryauthorization.v1.GetSystemPolicyRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); diff --git a/test/gapic_validation_helper_v1_v1.ts b/test/gapic_validation_helper_v1_v1.ts index 274a39c..acdebf7 100644 --- a/test/gapic_validation_helper_v1_v1.ts +++ b/test/gapic_validation_helper_v1_v1.ts @@ -175,7 +175,7 @@ describe('v1.ValidationHelperV1Client', () => { new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ValidateAttestationOccurrenceRequest', + '.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest', ['attestor'] ); request.attestor = defaultValue1; @@ -207,7 +207,7 @@ describe('v1.ValidationHelperV1Client', () => { new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ValidateAttestationOccurrenceRequest', + '.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest', ['attestor'] ); request.attestor = defaultValue1; @@ -254,7 +254,7 @@ describe('v1.ValidationHelperV1Client', () => { new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ValidateAttestationOccurrenceRequest', + '.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest', ['attestor'] ); request.attestor = defaultValue1; @@ -288,7 +288,7 @@ describe('v1.ValidationHelperV1Client', () => { new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ValidateAttestationOccurrenceRequest', + '.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceRequest', ['attestor'] ); request.attestor = defaultValue1; From d461de86c3abc5db180ae32ea4e6063f3c00df25 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:24:20 -0700 Subject: [PATCH 10/11] feat: add new analysis status and cvss version fields (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new analysis status and cvss version fields PiperOrigin-RevId: 477815955 Source-Link: https://github.com/googleapis/googleapis/commit/57e38f0271093ee5731a728e154b337dbe67108c Source-Link: https://github.com/googleapis/googleapis-gen/commit/3a587e147521ff94c68a79163aa16855db9a7a8c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2E1ODdlMTQ3NTIxZmY5NGM2OGE3OTE2M2FhMTY4NTVkYjlhN2E4YyJ9 * 🦉 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/grafeas/v1/cvss.proto | 7 +++++++ protos/grafeas/v1/discovery.proto | 18 +++++++++++++++++- protos/grafeas/v1/vulnerability.proto | 10 ++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/protos/grafeas/v1/cvss.proto b/protos/grafeas/v1/cvss.proto index ab7e2b8..181ec05 100644 --- a/protos/grafeas/v1/cvss.proto +++ b/protos/grafeas/v1/cvss.proto @@ -157,3 +157,10 @@ message CVSS { IMPACT_NONE = 3; } } + +// CVSS Version. +enum CVSSVersion { + CVSS_VERSION_UNSPECIFIED = 0; + CVSS_VERSION_2 = 1; + CVSS_VERSION_3 = 2; +} diff --git a/protos/grafeas/v1/discovery.proto b/protos/grafeas/v1/discovery.proto index 13939b2..bfb94e4 100644 --- a/protos/grafeas/v1/discovery.proto +++ b/protos/grafeas/v1/discovery.proto @@ -53,6 +53,8 @@ message DiscoveryOccurrence { // Analysis status for a resource. Currently for initial analysis only (not // updated in continuous analysis). enum AnalysisStatus { + option allow_alias = true; + // Unknown. ANALYSIS_STATUS_UNSPECIFIED = 0; // Resource is known but no action has been taken yet. @@ -61,16 +63,30 @@ message DiscoveryOccurrence { SCANNING = 2; // Analysis has finished successfully. FINISHED_SUCCESS = 3; + // Analysis has completed. + COMPLETE = 3; // Analysis has finished unsuccessfully, the analysis itself is in a bad // state. FINISHED_FAILED = 4; - // The resource is known not to be supported + // The resource is known not to be supported. FINISHED_UNSUPPORTED = 5; } // The status of discovery for the resource. AnalysisStatus analysis_status = 2; + // Indicates which analysis completed successfully. Multiple types of + // analysis can be performed on a single resource. + message AnalysisCompleted { + repeated string analysis_type = 1; + } + + AnalysisCompleted analysis_completed = 7; + + // Indicates any errors encountered during analysis of a resource. There + // could be 0 or more of these errors. + repeated google.rpc.Status analysis_error = 8; + // When an error is encountered this will contain a LocalizedMessage under // details to show to the user. The LocalizedMessage is output only and // populated by the API. diff --git a/protos/grafeas/v1/vulnerability.proto b/protos/grafeas/v1/vulnerability.proto index 70ab550..cea4558 100644 --- a/protos/grafeas/v1/vulnerability.proto +++ b/protos/grafeas/v1/vulnerability.proto @@ -148,6 +148,11 @@ message VulnerabilityNote { // upstream timestamp from the underlying information source - e.g. Ubuntu // security tracker. google.protobuf.Timestamp source_update_time = 6; + + // CVSS version used to populate cvss_score and severity. + grafeas.v1.CVSSVersion cvss_version = 7; + + // Next free ID is 8. } // An occurrence of a severity vulnerability on a resource. @@ -238,4 +243,9 @@ message VulnerabilityOccurrence { // Output only. Whether at least one of the affected packages has a fix // available. bool fix_available = 9; + + // Output only. CVSS version used to populate cvss_score and severity. + grafeas.v1.CVSSVersion cvss_version = 11; + + // Next free ID is 12. } From 5c2d10267df073d6de8ca7a9ea3fe97069d6d298 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 19:10:19 +0000 Subject: [PATCH 11/11] chore(main): release 2.1.0 (#173) :robot: I have created a release *beep* *boop* --- ## [2.1.0](https://togithub.com/googleapis/nodejs-binary-authorization/compare/v2.0.0...v2.1.0) (2022-10-06) ### Features * Add new analysis status and cvss version fields ([#187](https://togithub.com/googleapis/nodejs-binary-authorization/issues/187)) ([d461de8](https://togithub.com/googleapis/nodejs-binary-authorization/commit/d461de86c3abc5db180ae32ea4e6063f3c00df25)) ### Bug Fixes * Allow passing gax instance to client constructor ([#177](https://togithub.com/googleapis/nodejs-binary-authorization/issues/177)) ([6ef4a52](https://togithub.com/googleapis/nodejs-binary-authorization/commit/6ef4a520c1bb49fca8159324dbf41af10931357e)) * Better support for fallback mode ([#170](https://togithub.com/googleapis/nodejs-binary-authorization/issues/170)) ([fa2e0b5](https://togithub.com/googleapis/nodejs-binary-authorization/commit/fa2e0b5991a80e912c65f896bdc0c2670b2a349d)) * Change import long to require ([#172](https://togithub.com/googleapis/nodejs-binary-authorization/issues/172)) ([6327374](https://togithub.com/googleapis/nodejs-binary-authorization/commit/6327374ea12b05cc4d752b059e4d9a098174f45b)) * Do not import the whole google-gax from proto JS ([#1553](https://togithub.com/googleapis/nodejs-binary-authorization/issues/1553)) ([#176](https://togithub.com/googleapis/nodejs-binary-authorization/issues/176)) ([1a53ab4](https://togithub.com/googleapis/nodejs-binary-authorization/commit/1a53ab4d1bb04f4759494973a3297c3dcf295833)) * Preserve default values in x-goog-request-params header ([#180](https://togithub.com/googleapis/nodejs-binary-authorization/issues/180)) ([80b0dcf](https://togithub.com/googleapis/nodejs-binary-authorization/commit/80b0dcf989b20f874e0912af641fdc12419887f2)) * Remove pip install statements ([#1546](https://togithub.com/googleapis/nodejs-binary-authorization/issues/1546)) ([#175](https://togithub.com/googleapis/nodejs-binary-authorization/issues/175)) ([f412b6e](https://togithub.com/googleapis/nodejs-binary-authorization/commit/f412b6e8349aab08d3d5d985cd38f91750c1f030)) * use google-gax v3.3.0 ([1a53ab4](https://togithub.com/googleapis/nodejs-binary-authorization/commit/1a53ab4d1bb04f4759494973a3297c3dcf295833)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- ...ta.google.cloud.binaryauthorization.v1.json | 2 +- ...ogle.cloud.binaryauthorization.v1beta1.json | 2 +- samples/package.json | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f0ae7b..c22ecf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.1.0](https://github.com/googleapis/nodejs-binary-authorization/compare/v2.0.0...v2.1.0) (2022-10-06) + + +### Features + +* Add new analysis status and cvss version fields ([#187](https://github.com/googleapis/nodejs-binary-authorization/issues/187)) ([d461de8](https://github.com/googleapis/nodejs-binary-authorization/commit/d461de86c3abc5db180ae32ea4e6063f3c00df25)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#177](https://github.com/googleapis/nodejs-binary-authorization/issues/177)) ([6ef4a52](https://github.com/googleapis/nodejs-binary-authorization/commit/6ef4a520c1bb49fca8159324dbf41af10931357e)) +* Better support for fallback mode ([#170](https://github.com/googleapis/nodejs-binary-authorization/issues/170)) ([fa2e0b5](https://github.com/googleapis/nodejs-binary-authorization/commit/fa2e0b5991a80e912c65f896bdc0c2670b2a349d)) +* Change import long to require ([#172](https://github.com/googleapis/nodejs-binary-authorization/issues/172)) ([6327374](https://github.com/googleapis/nodejs-binary-authorization/commit/6327374ea12b05cc4d752b059e4d9a098174f45b)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-binary-authorization/issues/1553)) ([#176](https://github.com/googleapis/nodejs-binary-authorization/issues/176)) ([1a53ab4](https://github.com/googleapis/nodejs-binary-authorization/commit/1a53ab4d1bb04f4759494973a3297c3dcf295833)) +* Preserve default values in x-goog-request-params header ([#180](https://github.com/googleapis/nodejs-binary-authorization/issues/180)) ([80b0dcf](https://github.com/googleapis/nodejs-binary-authorization/commit/80b0dcf989b20f874e0912af641fdc12419887f2)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-binary-authorization/issues/1546)) ([#175](https://github.com/googleapis/nodejs-binary-authorization/issues/175)) ([f412b6e](https://github.com/googleapis/nodejs-binary-authorization/commit/f412b6e8349aab08d3d5d985cd38f91750c1f030)) +* use google-gax v3.3.0 ([1a53ab4](https://github.com/googleapis/nodejs-binary-authorization/commit/1a53ab4d1bb04f4759494973a3297c3dcf295833)) + ## [2.0.0](https://github.com/googleapis/nodejs-binary-authorization/compare/v1.5.1...v2.0.0) (2022-06-30) diff --git a/package.json b/package.json index fe81f34..ace5ef8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/binary-authorization", - "version": "2.0.0", + "version": "2.1.0", "description": "Binaryauthorization client for Node.js", "repository": "googleapis/nodejs-binary-authorization", "license": "Apache-2.0", diff --git a/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json b/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json index 4001bab..60c0121 100644 --- a/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json +++ b/samples/generated/v1/snippet_metadata.google.cloud.binaryauthorization.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-binaryauthorization", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json index 216b6e2..c36fb3d 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.binaryauthorization.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-binaryauthorization", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/samples/package.json b/samples/package.json index 1fc8828..7db6eec 100644 --- a/samples/package.json +++ b/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/binary-authorization": "^2.0.0" + "@google-cloud/binary-authorization": "^2.1.0" }, "devDependencies": { "c8": "^7.1.0",