From 873b0d14bef52c79b63b89bd9bc8c2693796d2f9 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Wed, 9 Sep 2020 16:20:41 -0700 Subject: [PATCH 001/116] feat: stubbed out library --- .../CODE_OF_CONDUCT.md | 43 ++++ .../CONTRIBUTING.md | 65 ++++++ .../google-cloud-assuredworkloads/LICENSE | 202 ++++++++++++++++++ .../google-cloud-assuredworkloads/README.md | 125 +++++++++++ .../google-cloud-assuredworkloads/synth.py | 39 ++++ 5 files changed, 474 insertions(+) create mode 100644 packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-assuredworkloads/CONTRIBUTING.md create mode 100644 packages/google-cloud-assuredworkloads/LICENSE create mode 100644 packages/google-cloud-assuredworkloads/README.md create mode 100644 packages/google-cloud-assuredworkloads/synth.py diff --git a/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md b/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-assuredworkloads/CONTRIBUTING.md b/packages/google-cloud-assuredworkloads/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup diff --git a/packages/google-cloud-assuredworkloads/LICENSE b/packages/google-cloud-assuredworkloads/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md new file mode 100644 index 00000000000..d2c52ea5daa --- /dev/null +++ b/packages/google-cloud-assuredworkloads/README.md @@ -0,0 +1,125 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/assuredworkloads.svg)](https://www.npmjs.org/package/assuredworkloads) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) + + + + +Assuredworkloads client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-assured-workloads/blob/master/CHANGELOG.md). + +* [Assured Workloads for Government Node.js Client API Reference][client-docs] +* [Assured Workloads for Government Documentation][product-docs] +* [github.com/googleapis/nodejs-assured-workloads](https://github.com/googleapis/nodejs-assured-workloads) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Assured Workloads for Government API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install assuredworkloads +``` + + + + + +The [Assured Workloads for Government Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-assured-workloads/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-assured-workloads/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/assuredworkloads/latest +[product-docs]: https://cloud.google.com/assured-workloads/docs +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=assuredworkloads.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-assuredworkloads/synth.py b/packages/google-cloud-assuredworkloads/synth.py new file mode 100644 index 00000000000..1367d3a86aa --- /dev/null +++ b/packages/google-cloud-assuredworkloads/synth.py @@ -0,0 +1,39 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.node as node +import subprocess +import logging + +logging.basicConfig(level=logging.DEBUG) + +# run the gapic generator +gapic = gcp.GAPICBazel() +versions = ['v1beta1'] +name = 'assuredworkloads' +for version in versions: + library = gapic.node_library(name, version) + s.copy(library, excludes=[]) + +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library( + source_location='build/src', versions=versions) +s.copy(templates, excludes=[]) + +node.postprocess_gapic_library() + From c45d8b297d86f7d44c49c1ce7a52c9bfcbe367e2 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 15 Sep 2020 14:57:59 -0700 Subject: [PATCH 002/116] build: add .repo-metadata.json --- .../.repo-metadata.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 packages/google-cloud-assuredworkloads/.repo-metadata.json diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json new file mode 100644 index 00000000000..f0a6fbc652a --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "assuredworkloads", + "name_pretty": "Assured Workloads for Government", + "product_documentation": "https://cloud.google.com/assured-workloads/docs", + "client_documentation": "https://googleapis.dev/nodejs/assuredworkloads/latest", + "issue_tracker": "", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-assured-workloads", + "distribution_name": "@google-cloud/assured-workloads", + "api_id": "assuredworkloads.googleapis.com", + "requires_billing": true +} From 8b5a6f0fd651188b825398dfca779fdc7d96eb5d Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 16 Sep 2020 15:18:18 -0700 Subject: [PATCH 003/116] feat!: initial generation of library (#1) --- .../.eslintignore | 6 + .../.eslintrc.json | 3 + .../.gitattributes | 4 + .../google-cloud-assuredworkloads/.gitignore | 14 + .../google-cloud-assuredworkloads/.jsdoc.js | 55 + .../google-cloud-assuredworkloads/.mocharc.js | 29 + packages/google-cloud-assuredworkloads/.nycrc | 24 + .../.prettierignore | 6 + .../.prettierrc.js | 17 + .../google-cloud-assuredworkloads/README.md | 45 +- .../api-extractor.json | 369 + .../linkinator.config.json | 15 + .../package.json | 66 + .../v1beta1/assuredworkloads_v1beta1.proto | 403 + .../protos/protos.d.ts | 6785 ++++++ .../protos/protos.js | 17264 ++++++++++++++++ .../protos/protos.json | 1771 ++ .../samples/README.md | 50 + .../samples/package.json | 23 + .../samples/quickstart.js | 45 + .../samples/test/quickstart.js | 42 + .../src/index.ts | 24 + .../assured_workloads_service_client.ts | 1138 + ...sured_workloads_service_client_config.json | 63 + .../assured_workloads_service_proto_list.json | 3 + .../src/v1beta1/index.ts | 19 + .../synth.metadata | 99 + .../google-cloud-assuredworkloads/synth.py | 2 +- .../system-test/fixtures/sample/src/index.js | 26 + .../system-test/fixtures/sample/src/index.ts | 25 + .../system-test/install.ts | 51 + ...gapic_assured_workloads_service_v1beta1.ts | 1300 ++ .../tsconfig.json | 19 + .../webpack.config.js | 64 + 34 files changed, 29863 insertions(+), 6 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/.eslintignore create mode 100644 packages/google-cloud-assuredworkloads/.eslintrc.json create mode 100644 packages/google-cloud-assuredworkloads/.gitattributes create mode 100644 packages/google-cloud-assuredworkloads/.gitignore create mode 100644 packages/google-cloud-assuredworkloads/.jsdoc.js create mode 100644 packages/google-cloud-assuredworkloads/.mocharc.js create mode 100644 packages/google-cloud-assuredworkloads/.nycrc create mode 100644 packages/google-cloud-assuredworkloads/.prettierignore create mode 100644 packages/google-cloud-assuredworkloads/.prettierrc.js create mode 100644 packages/google-cloud-assuredworkloads/api-extractor.json create mode 100644 packages/google-cloud-assuredworkloads/linkinator.config.json create mode 100644 packages/google-cloud-assuredworkloads/package.json create mode 100644 packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto create mode 100644 packages/google-cloud-assuredworkloads/protos/protos.d.ts create mode 100644 packages/google-cloud-assuredworkloads/protos/protos.js create mode 100644 packages/google-cloud-assuredworkloads/protos/protos.json create mode 100644 packages/google-cloud-assuredworkloads/samples/README.md create mode 100644 packages/google-cloud-assuredworkloads/samples/package.json create mode 100644 packages/google-cloud-assuredworkloads/samples/quickstart.js create mode 100644 packages/google-cloud-assuredworkloads/samples/test/quickstart.js create mode 100644 packages/google-cloud-assuredworkloads/src/index.ts create mode 100644 packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts create mode 100644 packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json create mode 100644 packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json create mode 100644 packages/google-cloud-assuredworkloads/src/v1beta1/index.ts create mode 100644 packages/google-cloud-assuredworkloads/synth.metadata create mode 100644 packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-assuredworkloads/system-test/install.ts create mode 100644 packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts create mode 100644 packages/google-cloud-assuredworkloads/tsconfig.json create mode 100644 packages/google-cloud-assuredworkloads/webpack.config.js diff --git a/packages/google-cloud-assuredworkloads/.eslintignore b/packages/google-cloud-assuredworkloads/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-assuredworkloads/.eslintrc.json b/packages/google-cloud-assuredworkloads/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-assuredworkloads/.gitattributes b/packages/google-cloud-assuredworkloads/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-assuredworkloads/.gitignore b/packages/google-cloud-assuredworkloads/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-assuredworkloads/.jsdoc.js b/packages/google-cloud-assuredworkloads/.jsdoc.js new file mode 100644 index 00000000000..a191355dce9 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2020 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: 'assuredworkloads', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-assuredworkloads/.mocharc.js b/packages/google-cloud-assuredworkloads/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-assuredworkloads/.nycrc b/packages/google-cloud-assuredworkloads/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-cloud-assuredworkloads/.prettierignore b/packages/google-cloud-assuredworkloads/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-assuredworkloads/.prettierrc.js b/packages/google-cloud-assuredworkloads/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index d2c52ea5daa..a14e007aab7 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -5,13 +5,13 @@ # [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) [![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/assuredworkloads.svg)](https://www.npmjs.org/package/assuredworkloads) +[![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) -Assuredworkloads client for Node.js +Assured Workloads client for Node.js A comprehensive list of changes in each version may be found in @@ -32,8 +32,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - - + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -51,10 +51,45 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. ### Installing the client library ```bash -npm install assuredworkloads +npm install @google-cloud/assured-workloads ``` +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +// const projectId = 'my-project'; + +// Imports the Google Cloud Some API library +const { + AssuredWorkloadsServiceClient, +} = require('@google-cloud/assured-workloads'); +const client = new AssuredWorkloadsServiceClient(); +async function listWorkloads() { + const [workloads] = await client.listWorkloads({ + parent: `organizations/${projectId}`, + }); + for (const workload of workloads) { + console.info(workload); + } +} +listWorkloads(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-assuredworkloads/api-extractor.json b/packages/google-cloud-assuredworkloads/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-assuredworkloads/linkinator.config.json b/packages/google-cloud-assuredworkloads/linkinator.config.json new file mode 100644 index 00000000000..b91a6f3054e --- /dev/null +++ b/packages/google-cloud-assuredworkloads/linkinator.config.json @@ -0,0 +1,15 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "googleapis.dev/nodejs/assuredworkloads/latest", + "www.npmjs.org/package/assuredworkloads", + "github.com/googleapis/nodejs-assured-workloads/blob/master/CHANGELOG.md", + "github.com/googleapis/nodejs-assured-workloads/tree/master/samples", + "github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json new file mode 100644 index 00000000000..16ab0fe2951 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/assured-workloads", + "version": "0.1.0", + "description": "Assured Workloads client for Node.js", + "repository": "googleapis/nodejs-assured-workloads", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google assuredworkloads", + "assuredworkloads", + "assured workloads service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prelint": "cd samples; npm link ../; npm i", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.7.0" + }, + "devDependencies": { + "@types/mocha": "^8.0.3", + "@types/node": "^14.6.1", + "@types/sinon": "^9.0.5", + "c8": "^7.3.0", + "gts": "^2.0.2", + "jsdoc": "^3.6.5", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.4", + "linkinator": "^2.1.2", + "mocha": "^8.1.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.0.3", + "ts-loader": "^8.0.3", + "typescript": "^3.9.7", + "webpack": "^4.44.1", + "webpack-cli": "^3.3.12" + }, + "engines": { + "node": ">=10.0.0" + } +} diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto new file mode 100644 index 00000000000..b610d2e037a --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -0,0 +1,403 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.assuredworkloads.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads"; +option java_multiple_files = true; +option java_outer_classname = "AssuredworkloadsProto"; +option java_package = "com.google.cloud.assuredworkloads.v1beta1"; +option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1beta1"; +option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1"; +option (google.api.resource_definition) = { + type: "assuredworkloads.googleapis.com/Location" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service to manage AssuredWorkloads. +service AssuredWorkloadsService { + option (google.api.default_host) = "assuredworkloads.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates Assured Workload. + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + body: "workload" + }; + option (google.api.method_signature) = "parent,workload"; + option (google.longrunning.operation_info) = { + response_type: "Workload" + metadata_type: "CreateWorkloadOperationMetadata" + }; + } + + // Updates an existing workload. + // Currently allows updating of workload display_name and labels. + // For force updates don't set etag field in the Workload. + // Only one update operation per workload can be in progress. + rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { + option (google.api.http) = { + patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" + body: "workload" + }; + option (google.api.method_signature) = "workload,update_mask"; + } + + // Deletes the workload. Make sure that workload's direct children are already + // in a deleted state, otherwise the request will fail with a + // FAILED_PRECONDITION error. + rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets Assured Workload associated with a CRM Node + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Assured Workloads under a CRM Node. + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for creating a workload. +message CreateWorkloadRequest { + // Required. The resource name of the new Workload's parent. + // Must be of the form `organizations/{org_id}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Required. Assured Workload to create + Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value + // provided for the identifier will add a label to the workload and contained + // projects with the identifier as the value. + string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for Updating a workload. +message UpdateWorkloadRequest { + // Required. The workload to update. + // The workload’s `name` field is used to identify the workload to be updated. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for deleting a Workload. +message DeleteWorkloadRequest { + // Required. The `name` field is used to identify the workload. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Optional. The etag of the workload. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for fetching a workload. +message GetWorkloadRequest { + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; +} + +// Request for fetching workloads in an organization. +message ListWorkloadsRequest { + // Required. Parent Resource to list workloads from. + // Must be of the form `organizations/{org_id}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token returned from previous request. Page token contains context from + // previous request. Page token needs to be passed in the second and following + // requests. + string page_token = 3; + + // A custom filter for filtering by properties of a workload. At this time, + // only filtering by labels is supported. + string filter = 4; +} + +// Response of ListWorkloads endpoint. +message ListWorkloadsResponse { + // List of Workloads under a given parent. + repeated Workload workloads = 1; + + // The next page token. Return empty if reached the last page. + string next_page_token = 2; +} + +// An Workload object for managing highly regulated workloads of cloud +// customers. +message Workload { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}" + }; + + // Represent the resources that are children of this Workload. + message ResourceInfo { + // The type of resource. + enum ResourceType { + // Unknown resource type. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Consumer project. + CONSUMER_PROJECT = 1; + + // Consumer project containing encryption keys. + ENCRYPTION_KEYS_PROJECT = 2; + } + + // Resource identifier. + // For a project this represents project_number. + int64 resource_id = 1; + + // Indicates the type of resource. + ResourceType resource_type = 2; + } + + // Settings specific to the Key Management Service. + message KMSSettings { + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. + google.protobuf.Timestamp next_rotation_time = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. + google.protobuf.Duration rotation_period = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for IL4. + message IL4Settings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for CJIS. + message CJISSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP High. + message FedrampHighSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP Moderate. + message FedrampModerateSettings { + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + } + + // Optional. The resource name of the workload. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload} + // + // Read-only. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The user-assigned display name of the Workload. + // When present it must be between 4 to 30 characters. + // Allowed characters are: lowercase and uppercase letters, numbers, + // hyphen, single-quote, double-quote, space, and exclamation point. + // + // Example: My Workload + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The resources associated with this workload. + // These resources will be created when creating the workload. + // If any of the projects already exist, the workload creation will fail. + // Always read only. + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Compliance Regime associated with this workload. + ComplianceRegime compliance_regime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. The Workload creation timestamp. + google.protobuf.Timestamp create_time = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. The billing account used for the resources which are + // direct children of workload. This billing account is initially associated + // with the resources created as part of Workload creation. + // After the initial creation of these resources, the customer can change + // the assigned billing account. + // The resource name has the form + // `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF`. + string billing_account = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Settings specific to the selected [compliance_regime] + oneof compliance_regime_settings { + // Required. Input only. Immutable. Settings specific to resources needed for IL4. + IL4Settings il4_settings = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for CJIS. + CJISSettings cjis_settings = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High. + FedrampHighSettings fedramp_high_settings = 11 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + FedrampModerateSettings fedramp_moderate_settings = 12 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Optional. ETag of the workload, it is calculated on the basis + // of the Workload contents. It will be used in Update & Delete operations. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels applied to the workload. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Operation metadata to give request details of CreateWorkload. +message CreateWorkloadOperationMetadata { + // Optional. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The display name of the workload. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The parent of the workload. + string parent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts new file mode 100644 index 00000000000..203a01e71d1 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -0,0 +1,6785 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace assuredworkloads. */ + namespace assuredworkloads { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents an AssuredWorkloadsService */ + class AssuredWorkloadsService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssuredWorkloadsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssuredWorkloadsService; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback): void; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @returns Promise + */ + public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest): Promise; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback): void; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @returns Promise + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest): Promise; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback): void; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @returns Promise + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): Promise; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback): void; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @returns Promise + */ + public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): Promise; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkloadsResponse + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback): void; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @returns Promise + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest): Promise; + } + + namespace AssuredWorkloadsService { + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * @param error Error, if any + * @param [response] ListWorkloadsResponse + */ + type ListWorkloadsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) => void; + } + + /** Properties of a CreateWorkloadRequest. */ + interface ICreateWorkloadRequest { + + /** CreateWorkloadRequest parent */ + parent?: (string|null); + + /** CreateWorkloadRequest workload */ + workload?: (google.cloud.assuredworkloads.v1beta1.IWorkload|null); + + /** CreateWorkloadRequest externalId */ + externalId?: (string|null); + } + + /** Represents a CreateWorkloadRequest. */ + class CreateWorkloadRequest implements ICreateWorkloadRequest { + + /** + * Constructs a new CreateWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest); + + /** CreateWorkloadRequest parent. */ + public parent: string; + + /** CreateWorkloadRequest workload. */ + public workload?: (google.cloud.assuredworkloads.v1beta1.IWorkload|null); + + /** CreateWorkloadRequest externalId. */ + public externalId: string; + + /** + * Creates a new CreateWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest): google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; + + /** + * Encodes the specified CreateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.verify|verify} messages. + * @param message CreateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.verify|verify} messages. + * @param message CreateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; + + /** + * Verifies a CreateWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest; + + /** + * Creates a plain object from a CreateWorkloadRequest message. Also converts values to other types if specified. + * @param message CreateWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateWorkloadRequest. */ + interface IUpdateWorkloadRequest { + + /** UpdateWorkloadRequest workload */ + workload?: (google.cloud.assuredworkloads.v1beta1.IWorkload|null); + + /** UpdateWorkloadRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateWorkloadRequest. */ + class UpdateWorkloadRequest implements IUpdateWorkloadRequest { + + /** + * Constructs a new UpdateWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest); + + /** UpdateWorkloadRequest workload. */ + public workload?: (google.cloud.assuredworkloads.v1beta1.IWorkload|null); + + /** UpdateWorkloadRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest): google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; + + /** + * Encodes the specified UpdateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.verify|verify} messages. + * @param message UpdateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.verify|verify} messages. + * @param message UpdateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; + + /** + * Verifies an UpdateWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest; + + /** + * Creates a plain object from an UpdateWorkloadRequest message. Also converts values to other types if specified. + * @param message UpdateWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteWorkloadRequest. */ + interface IDeleteWorkloadRequest { + + /** DeleteWorkloadRequest name */ + name?: (string|null); + + /** DeleteWorkloadRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteWorkloadRequest. */ + class DeleteWorkloadRequest implements IDeleteWorkloadRequest { + + /** + * Constructs a new DeleteWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest); + + /** DeleteWorkloadRequest name. */ + public name: string; + + /** DeleteWorkloadRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Verifies a DeleteWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @param message DeleteWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetWorkloadRequest. */ + interface IGetWorkloadRequest { + + /** GetWorkloadRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkloadRequest. */ + class GetWorkloadRequest implements IGetWorkloadRequest { + + /** + * Constructs a new GetWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest); + + /** GetWorkloadRequest name. */ + public name: string; + + /** + * Creates a new GetWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Verifies a GetWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * @param message GetWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListWorkloadsRequest. */ + interface IListWorkloadsRequest { + + /** ListWorkloadsRequest parent */ + parent?: (string|null); + + /** ListWorkloadsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkloadsRequest pageToken */ + pageToken?: (string|null); + + /** ListWorkloadsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListWorkloadsRequest. */ + class ListWorkloadsRequest implements IListWorkloadsRequest { + + /** + * Constructs a new ListWorkloadsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest); + + /** ListWorkloadsRequest parent. */ + public parent: string; + + /** ListWorkloadsRequest pageSize. */ + public pageSize: number; + + /** ListWorkloadsRequest pageToken. */ + public pageToken: string; + + /** ListWorkloadsRequest filter. */ + public filter: string; + + /** + * Creates a new ListWorkloadsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkloadsRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest): google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; + + /** + * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @param message ListWorkloadsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @param message ListWorkloadsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; + + /** + * Verifies a ListWorkloadsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkloadsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest; + + /** + * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * @param message ListWorkloadsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkloadsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListWorkloadsResponse. */ + interface IListWorkloadsResponse { + + /** ListWorkloadsResponse workloads */ + workloads?: (google.cloud.assuredworkloads.v1beta1.IWorkload[]|null); + + /** ListWorkloadsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWorkloadsResponse. */ + class ListWorkloadsResponse implements IListWorkloadsResponse { + + /** + * Constructs a new ListWorkloadsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse); + + /** ListWorkloadsResponse workloads. */ + public workloads: google.cloud.assuredworkloads.v1beta1.IWorkload[]; + + /** ListWorkloadsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWorkloadsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkloadsResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse): google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; + + /** + * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @param message ListWorkloadsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @param message ListWorkloadsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; + + /** + * Verifies a ListWorkloadsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkloadsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse; + + /** + * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * @param message ListWorkloadsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkloadsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Workload. */ + interface IWorkload { + + /** Workload name */ + name?: (string|null); + + /** Workload displayName */ + displayName?: (string|null); + + /** Workload resources */ + resources?: (google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo[]|null); + + /** Workload complianceRegime */ + complianceRegime?: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null); + + /** Workload createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Workload billingAccount */ + billingAccount?: (string|null); + + /** Workload il4Settings */ + il4Settings?: (google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null); + + /** Workload cjisSettings */ + cjisSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null); + + /** Workload fedrampHighSettings */ + fedrampHighSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null); + + /** Workload fedrampModerateSettings */ + fedrampModerateSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null); + + /** Workload etag */ + etag?: (string|null); + + /** Workload labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Workload. */ + class Workload implements IWorkload { + + /** + * Constructs a new Workload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IWorkload); + + /** Workload name. */ + public name: string; + + /** Workload displayName. */ + public displayName: string; + + /** Workload resources. */ + public resources: google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo[]; + + /** Workload complianceRegime. */ + public complianceRegime: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime); + + /** Workload createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Workload billingAccount. */ + public billingAccount: string; + + /** Workload il4Settings. */ + public il4Settings?: (google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null); + + /** Workload cjisSettings. */ + public cjisSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null); + + /** Workload fedrampHighSettings. */ + public fedrampHighSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null); + + /** Workload fedrampModerateSettings. */ + public fedrampModerateSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null); + + /** Workload etag. */ + public etag: string; + + /** Workload labels. */ + public labels: { [k: string]: string }; + + /** Workload complianceRegimeSettings. */ + public complianceRegimeSettings?: ("il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"); + + /** + * Creates a new Workload instance using the specified properties. + * @param [properties] Properties to set + * @returns Workload instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IWorkload): google.cloud.assuredworkloads.v1beta1.Workload; + + /** + * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @param message Workload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IWorkload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @param message Workload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IWorkload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Workload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload; + + /** + * Decodes a Workload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload; + + /** + * Verifies a Workload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Workload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload; + + /** + * Creates a plain object from a Workload message. Also converts values to other types if specified. + * @param message Workload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Workload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Workload { + + /** Properties of a ResourceInfo. */ + interface IResourceInfo { + + /** ResourceInfo resourceId */ + resourceId?: (number|Long|string|null); + + /** ResourceInfo resourceType */ + resourceType?: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null); + } + + /** Represents a ResourceInfo. */ + class ResourceInfo implements IResourceInfo { + + /** + * Constructs a new ResourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo); + + /** ResourceInfo resourceId. */ + public resourceId: (number|Long|string); + + /** ResourceInfo resourceType. */ + public resourceType: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType); + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceInfo instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo): google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo; + + /** + * Verifies a ResourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @param message ResourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceInfo { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + CONSUMER_PROJECT = 1, + ENCRYPTION_KEYS_PROJECT = 2 + } + } + + /** Properties of a KMSSettings. */ + interface IKMSSettings { + + /** KMSSettings nextRotationTime */ + nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** KMSSettings rotationPeriod */ + rotationPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a KMSSettings. */ + class KMSSettings implements IKMSSettings { + + /** + * Constructs a new KMSSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings); + + /** KMSSettings nextRotationTime. */ + public nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** KMSSettings rotationPeriod. */ + public rotationPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new KMSSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings): google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings; + + /** + * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @param message KMSSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @param message KMSSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings; + + /** + * Decodes a KMSSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings; + + /** + * Verifies a KMSSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings; + + /** + * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. + * @param message KMSSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a IL4Settings. */ + interface IIL4Settings { + + /** IL4Settings kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + } + + /** Represents a IL4Settings. */ + class IL4Settings implements IIL4Settings { + + /** + * Constructs a new IL4Settings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings); + + /** IL4Settings kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + + /** + * Creates a new IL4Settings instance using the specified properties. + * @param [properties] Properties to set + * @returns IL4Settings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings): google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings; + + /** + * Encodes the specified IL4Settings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @param message IL4Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IL4Settings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @param message IL4Settings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a IL4Settings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings; + + /** + * Decodes a IL4Settings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings; + + /** + * Verifies a IL4Settings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a IL4Settings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IL4Settings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings; + + /** + * Creates a plain object from a IL4Settings message. Also converts values to other types if specified. + * @param message IL4Settings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IL4Settings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CJISSettings. */ + interface ICJISSettings { + + /** CJISSettings kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + } + + /** Represents a CJISSettings. */ + class CJISSettings implements ICJISSettings { + + /** + * Constructs a new CJISSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings); + + /** CJISSettings kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + + /** + * Creates a new CJISSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CJISSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings): google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings; + + /** + * Encodes the specified CJISSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @param message CJISSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CJISSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @param message CJISSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CJISSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings; + + /** + * Decodes a CJISSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings; + + /** + * Verifies a CJISSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CJISSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CJISSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings; + + /** + * Creates a plain object from a CJISSettings message. Also converts values to other types if specified. + * @param message CJISSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CJISSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FedrampHighSettings. */ + interface IFedrampHighSettings { + + /** FedrampHighSettings kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + } + + /** Represents a FedrampHighSettings. */ + class FedrampHighSettings implements IFedrampHighSettings { + + /** + * Constructs a new FedrampHighSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings); + + /** FedrampHighSettings kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + + /** + * Creates a new FedrampHighSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns FedrampHighSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings): google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings; + + /** + * Encodes the specified FedrampHighSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @param message FedrampHighSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FedrampHighSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @param message FedrampHighSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings; + + /** + * Verifies a FedrampHighSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FedrampHighSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FedrampHighSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings; + + /** + * Creates a plain object from a FedrampHighSettings message. Also converts values to other types if specified. + * @param message FedrampHighSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FedrampHighSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FedrampModerateSettings. */ + interface IFedrampModerateSettings { + + /** FedrampModerateSettings kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + } + + /** Represents a FedrampModerateSettings. */ + class FedrampModerateSettings implements IFedrampModerateSettings { + + /** + * Constructs a new FedrampModerateSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings); + + /** FedrampModerateSettings kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + + /** + * Creates a new FedrampModerateSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns FedrampModerateSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings): google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings; + + /** + * Encodes the specified FedrampModerateSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @param message FedrampModerateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FedrampModerateSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @param message FedrampModerateSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings; + + /** + * Verifies a FedrampModerateSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FedrampModerateSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FedrampModerateSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings; + + /** + * Creates a plain object from a FedrampModerateSettings message. Also converts values to other types if specified. + * @param message FedrampModerateSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FedrampModerateSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ComplianceRegime enum. */ + enum ComplianceRegime { + COMPLIANCE_REGIME_UNSPECIFIED = 0, + IL4 = 1, + CJIS = 2, + FEDRAMP_HIGH = 3, + FEDRAMP_MODERATE = 4 + } + } + + /** Properties of a CreateWorkloadOperationMetadata. */ + interface ICreateWorkloadOperationMetadata { + + /** CreateWorkloadOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkloadOperationMetadata displayName */ + displayName?: (string|null); + + /** CreateWorkloadOperationMetadata parent */ + parent?: (string|null); + + /** CreateWorkloadOperationMetadata complianceRegime */ + complianceRegime?: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null); + } + + /** Represents a CreateWorkloadOperationMetadata. */ + class CreateWorkloadOperationMetadata implements ICreateWorkloadOperationMetadata { + + /** + * Constructs a new CreateWorkloadOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata); + + /** CreateWorkloadOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkloadOperationMetadata displayName. */ + public displayName: string; + + /** CreateWorkloadOperationMetadata parent. */ + public parent: string; + + /** CreateWorkloadOperationMetadata complianceRegime. */ + public complianceRegime: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime); + + /** + * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkloadOperationMetadata instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata): google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @param message CreateWorkloadOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @param message CreateWorkloadOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; + + /** + * Verifies a CreateWorkloadOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkloadOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata; + + /** + * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. + * @param message CreateWorkloadOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkloadOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get: string; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js new file mode 100644 index 00000000000..f8f448c7f0a --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -0,0 +1,17264 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_assured_workloads_protos || ($protobuf.roots._google_cloud_assured_workloads_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.assuredworkloads = (function() { + + /** + * Namespace assuredworkloads. + * @memberof google.cloud + * @namespace + */ + var assuredworkloads = {}; + + assuredworkloads.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.assuredworkloads + * @namespace + */ + var v1beta1 = {}; + + v1beta1.AssuredWorkloadsService = (function() { + + /** + * Constructs a new AssuredWorkloadsService service. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents an AssuredWorkloadsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AssuredWorkloadsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssuredWorkloadsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssuredWorkloadsService; + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssuredWorkloadsService} RPC service. Useful where requests and/or responses are streamed. + */ + AssuredWorkloadsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef CreateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.createWorkload = function createWorkload(request, callback) { + return this.rpcCall(createWorkload, $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkload" }); + + /** + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef UpdateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload + */ + + /** + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.updateWorkload = function updateWorkload(request, callback) { + return this.rpcCall(updateWorkload, $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); + }, "name", { value: "UpdateWorkload" }); + + /** + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef DeleteWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.deleteWorkload = function deleteWorkload(request, callback) { + return this.rpcCall(deleteWorkload, $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWorkload" }); + + /** + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef GetWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload + */ + + /** + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.getWorkload = function getWorkload(request, callback) { + return this.rpcCall(getWorkload, $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); + }, "name", { value: "GetWorkload" }); + + /** + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef ListWorkloadsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} [response] ListWorkloadsResponse + */ + + /** + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback} callback Node-style callback called with the error, if any, and ListWorkloadsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.listWorkloads = function listWorkloads(request, callback) { + return this.rpcCall(listWorkloads, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse, request, callback); + }, "name", { value: "ListWorkloads" }); + + /** + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssuredWorkloadsService; + })(); + + v1beta1.CreateWorkloadRequest = (function() { + + /** + * Properties of a CreateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface ICreateWorkloadRequest + * @property {string|null} [parent] CreateWorkloadRequest parent + * @property {google.cloud.assuredworkloads.v1beta1.IWorkload|null} [workload] CreateWorkloadRequest workload + * @property {string|null} [externalId] CreateWorkloadRequest externalId + */ + + /** + * Constructs a new CreateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a CreateWorkloadRequest. + * @implements ICreateWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest=} [properties] Properties to set + */ + function CreateWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkloadRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.parent = ""; + + /** + * CreateWorkloadRequest workload. + * @member {google.cloud.assuredworkloads.v1beta1.IWorkload|null|undefined} workload + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.workload = null; + + /** + * CreateWorkloadRequest externalId. + * @member {string} externalId + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.externalId = ""; + + /** + * Creates a new CreateWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} CreateWorkloadRequest instance + */ + CreateWorkloadRequest.create = function create(properties) { + return new CreateWorkloadRequest(properties); + }; + + /** + * Encodes the specified CreateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} message CreateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.workload != null && Object.hasOwnProperty.call(message, "workload")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.encode(message.workload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalId); + return writer; + }; + + /** + * Encodes the specified CreateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} message CreateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); + break; + case 3: + message.externalId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.workload != null && message.hasOwnProperty("workload")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.verify(message.workload); + if (error) + return "workload." + error; + } + if (message.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + return null; + }; + + /** + * Creates a CreateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} CreateWorkloadRequest + */ + CreateWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workload != null) { + if (typeof object.workload !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest.workload: object expected"); + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.fromObject(object.workload); + } + if (object.externalId != null) + message.externalId = String(object.externalId); + return message; + }; + + /** + * Creates a plain object from a CreateWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest} message CreateWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workload = null; + object.externalId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workload != null && message.hasOwnProperty("workload")) + object.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.toObject(message.workload, options); + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + return object; + }; + + /** + * Converts this CreateWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkloadRequest; + })(); + + v1beta1.UpdateWorkloadRequest = (function() { + + /** + * Properties of an UpdateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IUpdateWorkloadRequest + * @property {google.cloud.assuredworkloads.v1beta1.IWorkload|null} [workload] UpdateWorkloadRequest workload + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkloadRequest updateMask + */ + + /** + * Constructs a new UpdateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents an UpdateWorkloadRequest. + * @implements IUpdateWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest=} [properties] Properties to set + */ + function UpdateWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkloadRequest workload. + * @member {google.cloud.assuredworkloads.v1beta1.IWorkload|null|undefined} workload + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @instance + */ + UpdateWorkloadRequest.prototype.workload = null; + + /** + * UpdateWorkloadRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @instance + */ + UpdateWorkloadRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} UpdateWorkloadRequest instance + */ + UpdateWorkloadRequest.create = function create(properties) { + return new UpdateWorkloadRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} message UpdateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workload != null && Object.hasOwnProperty.call(message, "workload")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.encode(message.workload, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} message UpdateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workload != null && message.hasOwnProperty("workload")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.verify(message.workload); + if (error) + return "workload." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} UpdateWorkloadRequest + */ + UpdateWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest(); + if (object.workload != null) { + if (typeof object.workload !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.workload: object expected"); + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.fromObject(object.workload); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest} message UpdateWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workload = null; + object.updateMask = null; + } + if (message.workload != null && message.hasOwnProperty("workload")) + object.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.toObject(message.workload, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateWorkloadRequest; + })(); + + v1beta1.DeleteWorkloadRequest = (function() { + + /** + * Properties of a DeleteWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IDeleteWorkloadRequest + * @property {string|null} [name] DeleteWorkloadRequest name + * @property {string|null} [etag] DeleteWorkloadRequest etag + */ + + /** + * Constructs a new DeleteWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a DeleteWorkloadRequest. + * @implements IDeleteWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set + */ + function DeleteWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkloadRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @instance + */ + DeleteWorkloadRequest.prototype.name = ""; + + /** + * DeleteWorkloadRequest etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @instance + */ + DeleteWorkloadRequest.prototype.etag = ""; + + /** + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest instance + */ + DeleteWorkloadRequest.create = function create(properties) { + return new DeleteWorkloadRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.etag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + */ + DeleteWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} message DeleteWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteWorkloadRequest; + })(); + + v1beta1.GetWorkloadRequest = (function() { + + /** + * Properties of a GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IGetWorkloadRequest + * @property {string|null} [name] GetWorkloadRequest name + */ + + /** + * Constructs a new GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a GetWorkloadRequest. + * @implements IGetWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set + */ + function GetWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkloadRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @instance + */ + GetWorkloadRequest.prototype.name = ""; + + /** + * Creates a new GetWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest instance + */ + GetWorkloadRequest.create = function create(properties) { + return new GetWorkloadRequest(properties); + }; + + /** + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + */ + GetWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} message GetWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetWorkloadRequest; + })(); + + v1beta1.ListWorkloadsRequest = (function() { + + /** + * Properties of a ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IListWorkloadsRequest + * @property {string|null} [parent] ListWorkloadsRequest parent + * @property {number|null} [pageSize] ListWorkloadsRequest pageSize + * @property {string|null} [pageToken] ListWorkloadsRequest pageToken + * @property {string|null} [filter] ListWorkloadsRequest filter + */ + + /** + * Constructs a new ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a ListWorkloadsRequest. + * @implements IListWorkloadsRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set + */ + function ListWorkloadsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkloadsRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.parent = ""; + + /** + * ListWorkloadsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageSize = 0; + + /** + * ListWorkloadsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageToken = ""; + + /** + * ListWorkloadsRequest filter. + * @member {string} filter + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.filter = ""; + + /** + * Creates a new ListWorkloadsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest instance + */ + ListWorkloadsRequest.create = function create(properties) { + return new ListWorkloadsRequest(properties); + }; + + /** + * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + 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 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkloadsRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + */ + ListWorkloadsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} message ListWorkloadsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListWorkloadsRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkloadsRequest; + })(); + + v1beta1.ListWorkloadsResponse = (function() { + + /** + * Properties of a ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IListWorkloadsResponse + * @property {Array.|null} [workloads] ListWorkloadsResponse workloads + * @property {string|null} [nextPageToken] ListWorkloadsResponse nextPageToken + */ + + /** + * Constructs a new ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a ListWorkloadsResponse. + * @implements IListWorkloadsResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set + */ + function ListWorkloadsResponse(properties) { + this.workloads = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkloadsResponse workloads. + * @member {Array.} workloads + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.workloads = $util.emptyArray; + + /** + * ListWorkloadsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWorkloadsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse instance + */ + ListWorkloadsResponse.create = function create(properties) { + return new ListWorkloadsResponse(properties); + }; + + /** + * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workloads != null && message.workloads.length) + for (var i = 0; i < message.workloads.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.encode(message.workloads[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.workloads && message.workloads.length)) + message.workloads = []; + message.workloads.push($root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkloadsResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workloads != null && message.hasOwnProperty("workloads")) { + if (!Array.isArray(message.workloads)) + return "workloads: array expected"; + for (var i = 0; i < message.workloads.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.verify(message.workloads[i]); + if (error) + return "workloads." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + */ + ListWorkloadsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + if (object.workloads) { + if (!Array.isArray(object.workloads)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: array expected"); + message.workloads = []; + for (var i = 0; i < object.workloads.length; ++i) { + if (typeof object.workloads[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: object expected"); + message.workloads[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.fromObject(object.workloads[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} message ListWorkloadsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workloads = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workloads && message.workloads.length) { + object.workloads = []; + for (var j = 0; j < message.workloads.length; ++j) + object.workloads[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.toObject(message.workloads[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWorkloadsResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkloadsResponse; + })(); + + v1beta1.Workload = (function() { + + /** + * Properties of a Workload. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IWorkload + * @property {string|null} [name] Workload name + * @property {string|null} [displayName] Workload displayName + * @property {Array.|null} [resources] Workload resources + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] Workload complianceRegime + * @property {google.protobuf.ITimestamp|null} [createTime] Workload createTime + * @property {string|null} [billingAccount] Workload billingAccount + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null} [il4Settings] Workload il4Settings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null} [cjisSettings] Workload cjisSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null} [fedrampHighSettings] Workload fedrampHighSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null} [fedrampModerateSettings] Workload fedrampModerateSettings + * @property {string|null} [etag] Workload etag + * @property {Object.|null} [labels] Workload labels + */ + + /** + * Constructs a new Workload. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a Workload. + * @implements IWorkload + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set + */ + function Workload(properties) { + this.resources = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Workload name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.name = ""; + + /** + * Workload displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.displayName = ""; + + /** + * Workload resources. + * @member {Array.} resources + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.resources = $util.emptyArray; + + /** + * Workload complianceRegime. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.complianceRegime = 0; + + /** + * Workload createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.createTime = null; + + /** + * Workload billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.billingAccount = ""; + + /** + * Workload il4Settings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null|undefined} il4Settings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.il4Settings = null; + + /** + * Workload cjisSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null|undefined} cjisSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.cjisSettings = null; + + /** + * Workload fedrampHighSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null|undefined} fedrampHighSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.fedrampHighSettings = null; + + /** + * Workload fedrampModerateSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null|undefined} fedrampModerateSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.fedrampModerateSettings = null; + + /** + * Workload etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.etag = ""; + + /** + * Workload labels. + * @member {Object.} labels + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Workload complianceRegimeSettings. + * @member {"il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"|undefined} complianceRegimeSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Object.defineProperty(Workload.prototype, "complianceRegimeSettings", { + get: $util.oneOfGetter($oneOfFields = ["il4Settings", "cjisSettings", "fedrampHighSettings", "fedrampModerateSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Workload instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload instance + */ + Workload.create = function create(properties) { + return new Workload(properties); + }; + + /** + * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.encode(message.resources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.billingAccount); + if (message.il4Settings != null && Object.hasOwnProperty.call(message, "il4Settings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.encode(message.il4Settings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cjisSettings != null && Object.hasOwnProperty.call(message, "cjisSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.encode(message.cjisSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fedrampHighSettings != null && Object.hasOwnProperty.call(message, "fedrampHighSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.encode(message.fedrampHighSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fedrampModerateSettings != null && Object.hasOwnProperty.call(message, "fedrampModerateSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.encode(message.fedrampModerateSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Workload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.decode(reader, reader.uint32())); + break; + case 4: + message.complianceRegime = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.billingAccount = reader.string(); + break; + case 7: + message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.decode(reader, reader.uint32()); + break; + case 8: + message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.decode(reader, reader.uint32()); + break; + case 11: + message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.decode(reader, reader.uint32()); + break; + case 12: + message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.decode(reader, reader.uint32()); + break; + case 9: + message.etag = reader.string(); + break; + case 10: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Workload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Workload message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Workload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; + if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify(message.il4Settings); + if (error) + return "il4Settings." + error; + } + } + if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify(message.cjisSettings); + if (error) + return "cjisSettings." + error; + } + } + if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify(message.fedrampHighSettings); + if (error) + return "fedrampHighSettings." + error; + } + } + if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify(message.fedrampModerateSettings); + if (error) + return "fedrampModerateSettings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + */ + Workload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: object expected"); + message.resources[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.fromObject(object.resources[i]); + } + } + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); + if (object.il4Settings != null) { + if (typeof object.il4Settings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.il4Settings: object expected"); + message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.fromObject(object.il4Settings); + } + if (object.cjisSettings != null) { + if (typeof object.cjisSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.cjisSettings: object expected"); + message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.fromObject(object.cjisSettings); + } + if (object.fedrampHighSettings != null) { + if (typeof object.fedrampHighSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampHighSettings: object expected"); + message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.fromObject(object.fedrampHighSettings); + } + if (object.fedrampModerateSettings != null) { + if (typeof object.fedrampModerateSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampModerateSettings: object expected"); + message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.fromObject(object.fedrampModerateSettings); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Workload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload} message Workload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Workload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resources = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + object.createTime = null; + object.billingAccount = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.toObject(message.resources[j], options); + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; + if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { + object.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.toObject(message.il4Settings, options); + if (options.oneofs) + object.complianceRegimeSettings = "il4Settings"; + } + if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { + object.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.toObject(message.cjisSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "cjisSettings"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { + object.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.toObject(message.fedrampHighSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "fedrampHighSettings"; + } + if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { + object.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.toObject(message.fedrampModerateSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "fedrampModerateSettings"; + } + return object; + }; + + /** + * Converts this Workload to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + * @returns {Object.} JSON object + */ + Workload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Workload.ResourceInfo = (function() { + + /** + * Properties of a ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IResourceInfo + * @property {number|Long|null} [resourceId] ResourceInfo resourceId + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceInfo resourceType + */ + + /** + * Constructs a new ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a ResourceInfo. + * @implements IResourceInfo + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set + */ + function ResourceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceInfo resourceId. + * @member {number|Long} resourceId + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResourceInfo resourceType. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceType = 0; + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo instance + */ + ResourceInfo.create = function create(properties) { + return new ResourceInfo(properties); + }; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + return writer; + }; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int64(); + break; + case 2: + message.resourceType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceInfo message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isInteger(message.resourceId) && !(message.resourceId && $util.isInteger(message.resourceId.low) && $util.isInteger(message.resourceId.high))) + return "resourceId: integer|Long expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + */ + ResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); + if (object.resourceId != null) + if ($util.Long) + (message.resourceId = $util.Long.fromValue(object.resourceId)).unsigned = false; + else if (typeof object.resourceId === "string") + message.resourceId = parseInt(object.resourceId, 10); + else if (typeof object.resourceId === "number") + message.resourceId = object.resourceId; + else if (typeof object.resourceId === "object") + message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} message ResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceId = options.longs === String ? "0" : 0; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (typeof message.resourceId === "number") + object.resourceId = options.longs === String ? String(message.resourceId) : message.resourceId; + else + object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + return object; + }; + + /** + * Converts this ResourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + * @returns {Object.} JSON object + */ + ResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ResourceType enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value + * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value + */ + ResourceInfo.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONSUMER_PROJECT"] = 1; + values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; + return values; + })(); + + return ResourceInfo; + })(); + + Workload.KMSSettings = (function() { + + /** + * Properties of a KMSSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IKMSSettings + * @property {google.protobuf.ITimestamp|null} [nextRotationTime] KMSSettings nextRotationTime + * @property {google.protobuf.IDuration|null} [rotationPeriod] KMSSettings rotationPeriod + */ + + /** + * Constructs a new KMSSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a KMSSettings. + * @implements IKMSSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set + */ + function KMSSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSSettings nextRotationTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.nextRotationTime = null; + + /** + * KMSSettings rotationPeriod. + * @member {google.protobuf.IDuration|null|undefined} rotationPeriod + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.rotationPeriod = null; + + /** + * Creates a new KMSSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings instance + */ + KMSSettings.create = function create(properties) { + return new KMSSettings(properties); + }; + + /** + * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextRotationTime != null && Object.hasOwnProperty.call(message, "nextRotationTime")) + $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rotationPeriod != null && Object.hasOwnProperty.call(message, "rotationPeriod")) + $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); + if (error) + return "nextRotationTime." + error; + } + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); + if (error) + return "rotationPeriod." + error; + } + return null; + }; + + /** + * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + */ + KMSSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); + if (object.nextRotationTime != null) { + if (typeof object.nextRotationTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.nextRotationTime: object expected"); + message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); + } + if (object.rotationPeriod != null) { + if (typeof object.rotationPeriod !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.rotationPeriod: object expected"); + message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); + } + return message; + }; + + /** + * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} message KMSSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nextRotationTime = null; + object.rotationPeriod = null; + } + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) + object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); + return object; + }; + + /** + * Converts this KMSSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + * @returns {Object.} JSON object + */ + KMSSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KMSSettings; + })(); + + Workload.IL4Settings = (function() { + + /** + * Properties of a IL4Settings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IIL4Settings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] IL4Settings kmsSettings + */ + + /** + * Constructs a new IL4Settings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a IL4Settings. + * @implements IIL4Settings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set + */ + function IL4Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IL4Settings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @instance + */ + IL4Settings.prototype.kmsSettings = null; + + /** + * Creates a new IL4Settings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings instance + */ + IL4Settings.create = function create(properties) { + return new IL4Settings(properties); + }; + + /** + * Encodes the specified IL4Settings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IL4Settings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IL4Settings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IL4Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IL4Settings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IL4Settings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IL4Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IL4Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IL4Settings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IL4Settings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a IL4Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + */ + IL4Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a IL4Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} message IL4Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IL4Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this IL4Settings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @instance + * @returns {Object.} JSON object + */ + IL4Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IL4Settings; + })(); + + Workload.CJISSettings = (function() { + + /** + * Properties of a CJISSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface ICJISSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] CJISSettings kmsSettings + */ + + /** + * Constructs a new CJISSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a CJISSettings. + * @implements ICJISSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set + */ + function CJISSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CJISSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @instance + */ + CJISSettings.prototype.kmsSettings = null; + + /** + * Creates a new CJISSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings instance + */ + CJISSettings.create = function create(properties) { + return new CJISSettings(properties); + }; + + /** + * Encodes the specified CJISSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CJISSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CJISSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CJISSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CJISSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CJISSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CJISSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CJISSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CJISSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CJISSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a CJISSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + */ + CJISSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a CJISSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} message CJISSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CJISSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this CJISSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @instance + * @returns {Object.} JSON object + */ + CJISSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CJISSettings; + })(); + + Workload.FedrampHighSettings = (function() { + + /** + * Properties of a FedrampHighSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IFedrampHighSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampHighSettings kmsSettings + */ + + /** + * Constructs a new FedrampHighSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a FedrampHighSettings. + * @implements IFedrampHighSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set + */ + function FedrampHighSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FedrampHighSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @instance + */ + FedrampHighSettings.prototype.kmsSettings = null; + + /** + * Creates a new FedrampHighSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings instance + */ + FedrampHighSettings.create = function create(properties) { + return new FedrampHighSettings(properties); + }; + + /** + * Encodes the specified FedrampHighSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampHighSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FedrampHighSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampHighSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampHighSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampHighSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FedrampHighSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FedrampHighSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a FedrampHighSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + */ + FedrampHighSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a FedrampHighSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} message FedrampHighSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FedrampHighSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this FedrampHighSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @instance + * @returns {Object.} JSON object + */ + FedrampHighSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FedrampHighSettings; + })(); + + Workload.FedrampModerateSettings = (function() { + + /** + * Properties of a FedrampModerateSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IFedrampModerateSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampModerateSettings kmsSettings + */ + + /** + * Constructs a new FedrampModerateSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a FedrampModerateSettings. + * @implements IFedrampModerateSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set + */ + function FedrampModerateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FedrampModerateSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @instance + */ + FedrampModerateSettings.prototype.kmsSettings = null; + + /** + * Creates a new FedrampModerateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings instance + */ + FedrampModerateSettings.create = function create(properties) { + return new FedrampModerateSettings(properties); + }; + + /** + * Encodes the specified FedrampModerateSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampModerateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FedrampModerateSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampModerateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampModerateSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampModerateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FedrampModerateSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FedrampModerateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a FedrampModerateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + */ + FedrampModerateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a FedrampModerateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} message FedrampModerateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FedrampModerateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this FedrampModerateSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @instance + * @returns {Object.} JSON object + */ + FedrampModerateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FedrampModerateSettings; + })(); + + /** + * ComplianceRegime enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + * @enum {number} + * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value + * @property {number} IL4=1 IL4 value + * @property {number} CJIS=2 CJIS value + * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value + * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value + */ + Workload.ComplianceRegime = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; + values[valuesById[1] = "IL4"] = 1; + values[valuesById[2] = "CJIS"] = 2; + values[valuesById[3] = "FEDRAMP_HIGH"] = 3; + values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; + return values; + })(); + + return Workload; + })(); + + v1beta1.CreateWorkloadOperationMetadata = (function() { + + /** + * Properties of a CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface ICreateWorkloadOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkloadOperationMetadata createTime + * @property {string|null} [displayName] CreateWorkloadOperationMetadata displayName + * @property {string|null} [parent] CreateWorkloadOperationMetadata parent + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] CreateWorkloadOperationMetadata complianceRegime + */ + + /** + * Constructs a new CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a CreateWorkloadOperationMetadata. + * @implements ICreateWorkloadOperationMetadata + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + */ + function CreateWorkloadOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkloadOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.createTime = null; + + /** + * CreateWorkloadOperationMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.displayName = ""; + + /** + * CreateWorkloadOperationMetadata parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.parent = ""; + + /** + * CreateWorkloadOperationMetadata complianceRegime. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.complianceRegime = 0; + + /** + * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata instance + */ + CreateWorkloadOperationMetadata.create = function create(properties) { + return new CreateWorkloadOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + return writer; + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.parent = reader.string(); + break; + case 4: + message.complianceRegime = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkloadOperationMetadata message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkloadOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + */ + CreateWorkloadOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkloadOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.displayName = ""; + object.parent = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + return object; + }; + + /** + * Converts this CreateWorkloadOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateWorkloadOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkloadOperationMetadata; + })(); + + return v1beta1; + })(); + + return assuredworkloads; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHttpPattern; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.pattern = []; + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + 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: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + 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); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + 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) + 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) + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + 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(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + 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(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + 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.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(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + 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) + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + 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.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + 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(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + 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(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + 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(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + 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(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + 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 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + 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) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + 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) + 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) + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + 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); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + 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) + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FieldMask; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations#listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 3: + message.done = reader.bool(); + break; + case 4: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.name = reader.string(); + break; + case 1: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseType = reader.string(); + break; + case 2: + message.metadataType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json new file mode 100644 index 00000000000..a8449157fc2 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -0,0 +1,1771 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "assuredworkloads": { + "nested": { + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.AssuredWorkloads.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads", + "java_multiple_files": true, + "java_outer_classname": "AssuredworkloadsProto", + "java_package": "com.google.cloud.assuredworkloads.v1beta1", + "php_namespace": "Google\\Cloud\\AssuredWorkloads\\V1beta1", + "ruby_package": "Google::Cloud::AssuredWorkloads::V1beta1", + "(google.api.resource_definition).type": "assuredworkloads.googleapis.com/Location", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" + }, + "nested": { + "AssuredWorkloadsService": { + "options": { + "(google.api.default_host)": "assuredworkloads.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWorkload": { + "requestType": "CreateWorkloadRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "parent,workload", + "(google.longrunning.operation_info).response_type": "Workload", + "(google.longrunning.operation_info).metadata_type": "CreateWorkloadOperationMetadata" + } + }, + "UpdateWorkload": { + "requestType": "UpdateWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.http).patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "workload,update_mask" + } + }, + "DeleteWorkload": { + "requestType": "DeleteWorkloadRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", + "(google.api.method_signature)": "name" + } + }, + "GetWorkload": { + "requestType": "GetWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.http).get": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", + "(google.api.method_signature)": "name" + } + }, + "ListWorkloads": { + "requestType": "ListWorkloadsRequest", + "responseType": "ListWorkloadsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=organizations/*/locations/*}/workloads", + "(google.api.method_signature)": "parent" + } + } + } + }, + "CreateWorkloadRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "assuredworkloads.googleapis.com/Workload" + } + }, + "workload": { + "type": "Workload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "externalId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateWorkloadRequest": { + "fields": { + "workload": { + "type": "Workload", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteWorkloadRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "assuredworkloads.googleapis.com/Workload" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetWorkloadRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "assuredworkloads.googleapis.com/Workload" + } + } + } + }, + "ListWorkloadsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "assuredworkloads.googleapis.com/Workload" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListWorkloadsResponse": { + "fields": { + "workloads": { + "rule": "repeated", + "type": "Workload", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Workload": { + "options": { + "(google.api.resource).type": "assuredworkloads.googleapis.com/Workload", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/workloads/{workload}" + }, + "oneofs": { + "complianceRegimeSettings": { + "oneof": [ + "il4Settings", + "cjisSettings", + "fedrampHighSettings", + "fedrampModerateSettings" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resources": { + "rule": "repeated", + "type": "ResourceInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "complianceRegime": { + "type": "ComplianceRegime", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "billingAccount": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "il4Settings": { + "type": "IL4Settings", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "cjisSettings": { + "type": "CJISSettings", + "id": 8, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "fedrampHighSettings": { + "type": "FedrampHighSettings", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "fedrampModerateSettings": { + "type": "FedrampModerateSettings", + "id": 12, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ResourceInfo": { + "fields": { + "resourceId": { + "type": "int64", + "id": 1 + }, + "resourceType": { + "type": "ResourceType", + "id": 2 + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "CONSUMER_PROJECT": 1, + "ENCRYPTION_KEYS_PROJECT": 2 + } + } + } + }, + "KMSSettings": { + "fields": { + "nextRotationTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "rotationPeriod": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "IL4Settings": { + "fields": { + "kmsSettings": { + "type": "KMSSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "CJISSettings": { + "fields": { + "kmsSettings": { + "type": "KMSSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "FedrampHighSettings": { + "fields": { + "kmsSettings": { + "type": "KMSSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "FedrampModerateSettings": { + "fields": { + "kmsSettings": { + "type": "KMSSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "ComplianceRegime": { + "values": { + "COMPLIANCE_REGIME_UNSPECIFIED": 0, + "IL4": 1, + "CJIS": 2, + "FEDRAMP_HIGH": 3, + "FEDRAMP_MODERATE": 4 + } + } + } + }, + "CreateWorkloadOperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "complianceRegime": { + "type": "Workload.ComplianceRegime", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + } + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/samples/README.md b/packages/google-cloud-assuredworkloads/samples/README.md new file mode 100644 index 00000000000..69b9214fc73 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Assured Workloads for Government: Node.js Samples](https://github.com/googleapis/nodejs-assured-workloads) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-assured-workloads#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/assured-workloads/docs diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json new file mode 100644 index 00000000000..56a64f8030f --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-assured-workloads-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/assured-workloads": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.3.0", + "chai": "^4.2.0", + "mocha": "^8.1.1" + } +} diff --git a/packages/google-cloud-assuredworkloads/samples/quickstart.js b/packages/google-cloud-assuredworkloads/samples/quickstart.js new file mode 100644 index 00000000000..83d8799daec --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/quickstart.js @@ -0,0 +1,45 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +async function main(projectId) { + // [START workloads_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'my-project'; + + // Imports the Google Cloud Some API library + const { + AssuredWorkloadsServiceClient, + } = require('@google-cloud/assured-workloads'); + const client = new AssuredWorkloadsServiceClient(); + async function listWorkloads() { + const [workloads] = await client.listWorkloads({ + parent: `organizations/${projectId}`, + }); + for (const workload of workloads) { + console.info(workload); + } + } + listWorkloads(); + // [END workloads_quickstart] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-assuredworkloads/samples/test/quickstart.js b/packages/google-cloud-assuredworkloads/samples/test/quickstart.js new file mode 100644 index 00000000000..f0316e09a33 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const project = process.env.GCLOUD_PROJECT; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + try { + execSync(`node ./quickstart.js ${project}`, { + cwd, + }); + throw Error('not reachable'); + } catch (err) { + assert.match(err.message, /Fail to resolve resource/); + } + }); +}); diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts new file mode 100644 index 00000000000..4fe966284b2 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -0,0 +1,24 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; +export {v1beta1, AssuredWorkloadsServiceClient}; +export default {v1beta1, AssuredWorkloadsServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts new file mode 100644 index 00000000000..f0a0a06f3c2 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -0,0 +1,1138 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './assured_workloads_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service to manage AssuredWorkloads. + * @class + * @memberof v1beta1 + */ +export class AssuredWorkloadsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + assuredWorkloadsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssuredWorkloadsServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof AssuredWorkloadsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); + opts.clientConfig = opts.clientConfig || {}; + + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the AssuredWorkloadsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof AssuredWorkloadsServiceClient).scopes; + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + workloadPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/workloads/{workload}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listWorkloads: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workloads' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const createWorkloadResponse = protoFilesRoot.lookup( + '.google.cloud.assuredworkloads.v1beta1.Workload' + ) as gax.protobuf.Type; + const createWorkloadMetadata = protoFilesRoot.lookup( + '.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createWorkload: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkloadResponse.decode.bind(createWorkloadResponse), + createWorkloadMetadata.decode.bind(createWorkloadMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.assuredWorkloadsServiceStub) { + return this.assuredWorkloadsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService. + this.assuredWorkloadsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.assuredworkloads.v1beta1 + .AssuredWorkloadsService, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assuredWorkloadsServiceStubMethods = [ + 'createWorkload', + 'updateWorkload', + 'deleteWorkload', + 'getWorkload', + 'listWorkloads', + ]; + for (const methodName of assuredWorkloadsServiceStubMethods) { + const callPromise = this.assuredWorkloadsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assuredWorkloadsServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'assuredworkloads.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'assuredworkloads.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined + ] + >; + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workload.name': request.workload!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkload(request, options, callback); + } + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined + ] + >; + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {string} [request.etag] + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkload(request, options, callback); + } + getWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | undefined + ), + {} | undefined + ] + >; + getWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + options: gax.CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets Assured Workload associated with a CRM Node + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkload(request, options, callback); + } + + createWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + callback: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates Assured Workload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload + * Required. Assured Workload to create + * @param {string} [request.externalId] + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createWorkload( + request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkload(request, options, callback); + } + /** + * Check the status of the long running operation returned by the createWorkload() method. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * + * @example: + * const decodedOperation = await checkCreateWorkloadProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateWorkloadProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.Workload, + protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createWorkload, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.assuredworkloads.v1beta1.Workload, + protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + >; + } + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + options?: gax.CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload[], + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + ] + >; + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + options: gax.CallOptions, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1beta1.IWorkload + > + ): void; + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1beta1.IWorkload + > + ): void; + /** + * Lists Assured Workloads under a CRM Node. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * The client library support auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListWorkloadsRequest]{@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListWorkloadsResponse]{@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + optionsOrCallback?: + | gax.CallOptions + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1beta1.IWorkload + >, + callback?: PaginationCallback< + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1beta1.IWorkload + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload[], + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkloads(request, options, callback); + } + + /** + * Equivalent to {@link listWorkloads}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listWorkloads} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload} on 'data' event. + */ + listWorkloadsStream( + request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkloads.createStream( + this.innerApiCalls.listWorkloads as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listWorkloads}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listWorkloadsAsync( + request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkloads.asyncIterate( + this.innerApiCalls['listWorkloads'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} organization + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(organization: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + organization: organization, + location: location, + }); + } + + /** + * Parse the organization from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName) + .organization; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified workload resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} workload + * @returns {string} Resource name string. + */ + workloadPath(organization: string, location: string, workload: string) { + return this.pathTemplates.workloadPathTemplate.render({ + organization: organization, + location: location, + workload: workload, + }); + } + + /** + * Parse the organization from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName) + .organization; + } + + /** + * Parse the location from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName).location; + } + + /** + * Parse the workload from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the workload. + */ + matchWorkloadFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName).workload; + } + + /** + * Terminate the GRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.assuredWorkloadsServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json new file mode 100644 index 00000000000..3cdf6b6c4b7 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json @@ -0,0 +1,63 @@ +{ + "interfaces": { + "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "f412bc287ceb81ac34bc795a23656235608595af": { + "initial_retry_delay_millis": 200, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 30000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "f412bc287ceb81ac34bc795a23656235608595af" + }, + "GetWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "f412bc287ceb81ac34bc795a23656235608595af" + }, + "ListWorkloads": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "f412bc287ceb81ac34bc795a23656235608595af" + } + } + } + } +} diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json new file mode 100644 index 00000000000..42e23062aa0 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto" +] diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts new file mode 100644 index 00000000000..5a97fe8a1d5 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AssuredWorkloadsServiceClient} from './assured_workloads_service_client'; diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata new file mode 100644 index 00000000000..6c6ea68aa06 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -0,0 +1,99 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-assured-workloads.git", + "sha": "ede54a56e79e88643575094fb16fd90a63f52c15" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "877aadc6daf8968e8a1122cf1186623d11d8bd46", + "internalRef": "332039388" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "assuredworkloads", + "apiVersion": "v1beta1", + "language": "nodejs", + "generator": "bazel" + } + } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "src/index.ts", + "src/v1beta1/assured_workloads_service_client.ts", + "src/v1beta1/assured_workloads_service_client_config.json", + "src/v1beta1/assured_workloads_service_proto_list.json", + "src/v1beta1/index.ts", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_assured_workloads_service_v1beta1.ts", + "tsconfig.json", + "webpack.config.js" + ] +} \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/synth.py b/packages/google-cloud-assuredworkloads/synth.py index 1367d3a86aa..ae0ab217fdc 100644 --- a/packages/google-cloud-assuredworkloads/synth.py +++ b/packages/google-cloud-assuredworkloads/synth.py @@ -27,7 +27,7 @@ name = 'assuredworkloads' for version in versions: library = gapic.node_library(name, version) - s.copy(library, excludes=[]) + s.copy(library, excludes=['README.md', 'package.json']) # Copy common templates common_templates = gcp.CommonTemplates() diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3826ee2847f --- /dev/null +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const assuredworkloads = require('@google-cloud/assured-workloads'); + +function main() { + const assuredWorkloadsServiceClient = new assuredworkloads.AssuredWorkloadsServiceClient(); +} + +main(); diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..cb83bad9243 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssuredWorkloadsServiceClient} from '@google-cloud/assured-workloads'; + +function main() { + new AssuredWorkloadsServiceClient(); +} + +main(); diff --git a/packages/google-cloud-assuredworkloads/system-test/install.ts b/packages/google-cloud-assuredworkloads/system-test/install.ts new file mode 100644 index 00000000000..4c1ba3eb79a --- /dev/null +++ b/packages/google-cloud-assuredworkloads/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts new file mode 100644 index 00000000000..c874a40c57e --- /dev/null +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -0,0 +1,1300 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assuredworkloadsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.AssuredWorkloadsServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + await client.initialize(); + assert(client.assuredWorkloadsServiceStub); + }); + + it('has close method', () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + 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 assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + 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); + }); + + describe('updateWorkload', () => { + it('invokes updateWorkload without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ); + client.innerApiCalls.updateWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.updateWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkload without error using callback', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ); + client.innerApiCalls.updateWorkload = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateWorkload( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1beta1.IWorkload | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateWorkload with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkload(request), expectedError); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteWorkload', () => { + it('invokes deleteWorkload without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteWorkload without error using callback', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkload = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteWorkload( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteWorkload with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteWorkload(request), expectedError); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getWorkload', () => { + it('invokes getWorkload without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ); + client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getWorkload without error using callback', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ); + client.innerApiCalls.getWorkload = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getWorkload( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1beta1.IWorkload | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getWorkload with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkload(request), expectedError); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createWorkload', () => { + it('invokes createWorkload without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createWorkload(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload without error using callback', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createWorkload( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createWorkload with call error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkload(request), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload with LRO error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkload(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateWorkloadProgress without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateWorkloadProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkloadProgress with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateWorkloadProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listWorkloads', () => { + it('invokes listWorkloads without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkloads(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloads without error using callback', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listWorkloads( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listWorkloads with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkloads = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkloads(request), expectedError); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloadsStream without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkloads, request) + ); + assert.strictEqual( + (client.descriptors.page.listWorkloads + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkloadsStream with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkloads, request) + ); + assert.strictEqual( + (client.descriptors.page.listWorkloads + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkloads without error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = []; + const iterable = client.listWorkloadsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkloads + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listWorkloads + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkloads with error', async () => { + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listWorkloadsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkloads + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listWorkloads + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + }; + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath( + 'organizationValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromLocationName', () => { + const result = client.matchOrganizationFromLocationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workload', () => { + const fakePath = '/rendered/path/workload'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + workload: 'workloadValue', + }; + const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.workloadPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workloadPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workloadPath', () => { + const result = client.workloadPath( + 'organizationValue', + 'locationValue', + 'workloadValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workloadPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromWorkloadName', () => { + const result = client.matchOrganizationFromWorkloadName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkloadName', () => { + const result = client.matchLocationFromWorkloadName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkloadFromWorkloadName', () => { + const result = client.matchWorkloadFromWorkloadName(fakePath); + assert.strictEqual(result, 'workloadValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-assuredworkloads/tsconfig.json b/packages/google-cloud-assuredworkloads/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-assuredworkloads/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-assuredworkloads/webpack.config.js b/packages/google-cloud-assuredworkloads/webpack.config.js new file mode 100644 index 00000000000..6e6dd525d10 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssuredWorkloadsService', + filename: './assured-workloads-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; From f6c94440fadcfbd764c9a48481908fc439d2db13 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 16 Sep 2020 15:26:19 -0700 Subject: [PATCH 004/116] chore: release 1.0.0 (#5) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/CHANGELOG.md diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md new file mode 100644 index 00000000000..05d477b6b6b --- /dev/null +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## 1.0.0 (2020-09-16) + + +### ⚠ BREAKING CHANGES + +* initial generation of library (#1) + +### Features + +* initial generation of library ([#1](https://www.github.com/googleapis/nodejs-assured-workloads/issues/1)) ([de8baae](https://www.github.com/googleapis/nodejs-assured-workloads/commit/de8baaeffc47ee0f80d54d9fc626e9003bf3341d)) +* stubbed out library ([bf1a579](https://www.github.com/googleapis/nodejs-assured-workloads/commit/bf1a5796766e79efd5040973818e707344d1ba3d)) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 16ab0fe2951..b54a2199a49 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "0.1.0", + "version": "1.0.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 56a64f8030f..639adbccdbd 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^0.1.0" + "@google-cloud/assured-workloads": "^1.0.0" }, "devDependencies": { "c8": "^7.3.0", From 6b5b7cc29067aaafe8b979c5198f041b433cb808 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:04:14 +0200 Subject: [PATCH 005/116] chore(deps): update dependency webpack to v5 (#10) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.44.1` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.1.0) | --- ### Release Notes
webpack/webpack ### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0) ### Features - expose `webpack` property from `Compiler` - expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin` ### Bugfixes - missing `require("..").xxx` in try-catch produces a warning instead of an error now - handle reexports in concatenated modules correctly when they are side-effect-free - fix incorrect deprecation message for ModuleTemplate.hooks.hash ### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0) [Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index b54a2199a49..38133571293 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -57,7 +57,7 @@ "sinon": "^9.0.3", "ts-loader": "^8.0.3", "typescript": "^3.9.7", - "webpack": "^4.44.1", + "webpack": "^5.0.0", "webpack-cli": "^3.3.12" }, "engines": { From d00723cfb159a7fb2bccd638bbb4cc201add5f59 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:36:06 +0200 Subject: [PATCH 006/116] chore(deps): update dependency webpack-cli to v4 (#11) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.12` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 38133571293..d8bf8482bb3 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -58,7 +58,7 @@ "ts-loader": "^8.0.3", "typescript": "^3.9.7", "webpack": "^5.0.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^4.0.0" }, "engines": { "node": ">=10.0.0" From 6311386771577d23566ab141aec1ca42cf5454e0 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 15:42:20 -0800 Subject: [PATCH 007/116] fix: do not modify options object, use defaultScopes (#12) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- .../google-cloud-assuredworkloads/.jsdoc.js | 2 +- .../CODE_OF_CONDUCT.md | 123 +++++++++---- .../linkinator.config.json | 7 +- .../package.json | 2 +- .../src/index.ts | 1 + .../assured_workloads_service_client.ts | 170 ++++++++++-------- .../synth.metadata | 13 +- .../system-test/fixtures/sample/src/index.ts | 11 +- .../system-test/install.ts | 18 +- 9 files changed, 214 insertions(+), 133 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.jsdoc.js b/packages/google-cloud-assuredworkloads/.jsdoc.js index a191355dce9..ebea00637e9 100644 --- a/packages/google-cloud-assuredworkloads/.jsdoc.js +++ b/packages/google-cloud-assuredworkloads/.jsdoc.js @@ -43,7 +43,7 @@ module.exports = { copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, - systemName: 'assuredworkloads', + systemName: '@google-cloud/assured-workloads', theme: 'lumen', default: { outputSourceFiles: false diff --git a/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md b/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-assuredworkloads/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/linkinator.config.json b/packages/google-cloud-assuredworkloads/linkinator.config.json index b91a6f3054e..29a223b6db6 100644 --- a/packages/google-cloud-assuredworkloads/linkinator.config.json +++ b/packages/google-cloud-assuredworkloads/linkinator.config.json @@ -3,12 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "googleapis.dev/nodejs/assuredworkloads/latest", - "www.npmjs.org/package/assuredworkloads", - "github.com/googleapis/nodejs-assured-workloads/blob/master/CHANGELOG.md", - "github.com/googleapis/nodejs-assured-workloads/tree/master/samples", - "github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index d8bf8482bb3..14d7a170b83 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.7.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.3", diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index 4fe966284b2..ededcb21424 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -18,6 +18,7 @@ import * as v1beta1 from './v1beta1'; const AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; +type AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; export {v1beta1, AssuredWorkloadsServiceClient}; export default {v1beta1, AssuredWorkloadsServiceClient}; import * as protos from '../protos/protos'; diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index f0a0a06f3c2..ddcfa383b6d 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -62,8 +62,10 @@ export class AssuredWorkloadsServiceClient { /** * Construct an instance of AssuredWorkloadsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] @@ -83,44 +85,34 @@ export class AssuredWorkloadsServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof AssuredWorkloadsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the AssuredWorkloadsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof AssuredWorkloadsServiceClient).scopes; + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. this._gaxGrpc = new this._gaxModule.GrpcClient(opts); // Save options to use in initialize() method. @@ -129,6 +121,11 @@ export class AssuredWorkloadsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { @@ -302,6 +299,7 @@ export class AssuredWorkloadsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'assuredworkloads.googleapis.com'; @@ -310,6 +308,7 @@ export class AssuredWorkloadsServiceClient { /** * The DNS address for this API service - same as servicePath(), * exists for compatibility reasons. + * @returns {string} The DNS address for this service. */ static get apiEndpoint() { return 'assuredworkloads.googleapis.com'; @@ -317,6 +316,7 @@ export class AssuredWorkloadsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -325,6 +325,7 @@ export class AssuredWorkloadsServiceClient { /** * The scopes needed to make gRPC calls for every method defined * in this service. + * @returns {string[]} List of default scopes. */ static get scopes() { return ['https://www.googleapis.com/auth/cloud-platform']; @@ -334,8 +335,7 @@ export class AssuredWorkloadsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -403,7 +403,11 @@ export class AssuredWorkloadsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateWorkload(request); */ updateWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, @@ -504,7 +508,11 @@ export class AssuredWorkloadsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteWorkload(request); */ deleteWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, @@ -602,7 +610,11 @@ export class AssuredWorkloadsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getWorkload(request); */ getWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, @@ -706,8 +718,15 @@ export class AssuredWorkloadsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createWorkload(request); + * const [response] = await operation.promise(); */ createWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, @@ -759,18 +778,19 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.createWorkload(request, options, callback); } /** - * Check the status of the long running operation returned by the createWorkload() method. + * Check the status of the long running operation returned by `createWorkload()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. - * - * @example: - * const decodedOperation = await checkCreateWorkloadProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateWorkloadProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateWorkloadProgress( name: string @@ -846,19 +866,14 @@ export class AssuredWorkloadsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * The client library support auto-pagination by default: it will call the API as many + * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListWorkloadsRequest]{@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListWorkloadsResponse]{@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listWorkloads( request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, @@ -906,18 +921,7 @@ export class AssuredWorkloadsServiceClient { } /** - * Equivalent to {@link listWorkloads}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listWorkloads} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -936,6 +940,13 @@ export class AssuredWorkloadsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. */ listWorkloadsStream( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, @@ -960,10 +971,9 @@ export class AssuredWorkloadsServiceClient { } /** - * Equivalent to {@link listWorkloads}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * Equivalent to `listWorkloads`, but returns an iterable object. * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -981,7 +991,18 @@ export class AssuredWorkloadsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} - * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listWorkloadsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listWorkloadsAsync( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, @@ -1121,9 +1142,10 @@ export class AssuredWorkloadsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * Terminate the gRPC channel and close the client. * * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { this.initialize(); diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 6c6ea68aa06..51ab35b24b7 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,15 +4,14 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-assured-workloads.git", - "sha": "ede54a56e79e88643575094fb16fd90a63f52c15" + "sha": "d6454102a8dfcf3e64fb7b58ff53071dce8696cf" } }, { "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "877aadc6daf8968e8a1122cf1186623d11d8bd46", - "internalRef": "332039388" + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -68,22 +67,26 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.4211562522", "protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.1886703785", "src/index.ts", "src/v1beta1/assured_workloads_service_client.ts", "src/v1beta1/assured_workloads_service_client_config.json", diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts index cb83bad9243..e3de9ccc93a 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts @@ -18,8 +18,17 @@ import {AssuredWorkloadsServiceClient} from '@google-cloud/assured-workloads'; +// check that the client class type name can be used +function doStuffWithAssuredWorkloadsServiceClient( + client: AssuredWorkloadsServiceClient +) { + client.close(); +} + function main() { - new AssuredWorkloadsServiceClient(); + // check that the client instance can be created + const assuredWorkloadsServiceClient = new AssuredWorkloadsServiceClient(); + doStuffWithAssuredWorkloadsServiceClient(assuredWorkloadsServiceClient); } main(); diff --git a/packages/google-cloud-assuredworkloads/system-test/install.ts b/packages/google-cloud-assuredworkloads/system-test/install.ts index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-assuredworkloads/system-test/install.ts +++ b/packages/google-cloud-assuredworkloads/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From 0caaf46b28fcbcfeb792222846693b1d9f76fa9f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:57:45 -0800 Subject: [PATCH 008/116] chore: release 1.0.1 (#13) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 05d477b6b6b..241a740e536 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.0.0...v1.0.1) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#12](https://www.github.com/googleapis/nodejs-assured-workloads/issues/12)) ([ed671aa](https://www.github.com/googleapis/nodejs-assured-workloads/commit/ed671aadda0be838465172ea0fbdc64ab04ce754)) + ## 1.0.0 (2020-09-16) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 14d7a170b83..37500f2e57a 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.0.0", + "version": "1.0.1", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 639adbccdbd..a026bc83061 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.0.0" + "@google-cloud/assured-workloads": "^1.0.1" }, "devDependencies": { "c8": "^7.3.0", From abf37ba9f3bf3cc331140fe5e67a3ef890c0bdb7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 16 Nov 2020 11:15:24 -0800 Subject: [PATCH 009/116] feat: added provisionedResourcesParent and kmsSettings autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../v1beta1/assuredworkloads_v1beta1.proto | 28 ++++++++++- .../protos/protos.d.ts | 12 +++++ .../protos/protos.js | 49 +++++++++++++++++++ .../protos/protos.json | 30 ++++++++++++ .../synth.metadata | 14 ++++-- 5 files changed, 128 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index b610d2e037a..3aaac707fac 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -245,6 +245,8 @@ message Workload { // Settings specific to resources needed for IL4. message IL4Settings { + option deprecated = true; + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, @@ -255,6 +257,8 @@ message Workload { // Settings specific to resources needed for CJIS. message CJISSettings { + option deprecated = true; + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, @@ -265,6 +269,8 @@ message Workload { // Settings specific to resources needed for FedRAMP High. message FedrampHighSettings { + option deprecated = true; + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, @@ -275,6 +281,8 @@ message Workload { // Settings specific to resources needed for FedRAMP Moderate. message FedrampModerateSettings { + option deprecated = true; + // Required. Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, @@ -311,7 +319,7 @@ message Workload { // Required. The user-assigned display name of the Workload. // When present it must be between 4 to 30 characters. // Allowed characters are: lowercase and uppercase letters, numbers, - // hyphen, single-quote, double-quote, space, and exclamation point. + // hyphen, and spaces. // // Example: My Workload string display_name = 2 [(google.api.field_behavior) = REQUIRED]; @@ -351,6 +359,7 @@ message Workload { oneof compliance_regime_settings { // Required. Input only. Immutable. Settings specific to resources needed for IL4. IL4Settings il4_settings = 7 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE @@ -358,6 +367,7 @@ message Workload { // Required. Input only. Immutable. Settings specific to resources needed for CJIS. CJISSettings cjis_settings = 8 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE @@ -365,6 +375,7 @@ message Workload { // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High. FedrampHighSettings fedramp_high_settings = 11 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE @@ -372,6 +383,7 @@ message Workload { // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. FedrampModerateSettings fedramp_moderate_settings = 12 [ + deprecated = true, (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE @@ -384,6 +396,20 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. The parent resource for the resources managed by this Assured Workload. May + // be either an organization or a folder. Must be the same or a child of the + // Workload parent. If not specified all resources are created under the + // Workload parent. + // Formats: + // folders/{folder_id} + // organizations/{organization_id} + string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set a project with a KMS + // CMEK key is provisioned. This field is mandatory for a subset of Compliance + // Regimes. + KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 203a01e71d1..cbf9c8b5f38 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -781,6 +781,12 @@ export namespace google { /** Workload labels */ labels?: ({ [k: string]: string }|null); + + /** Workload provisionedResourcesParent */ + provisionedResourcesParent?: (string|null); + + /** Workload kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); } /** Represents a Workload. */ @@ -828,6 +834,12 @@ export namespace google { /** Workload labels. */ public labels: { [k: string]: string }; + /** Workload provisionedResourcesParent. */ + public provisionedResourcesParent: string; + + /** Workload kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + /** Workload complianceRegimeSettings. */ public complianceRegimeSettings?: ("il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index f8f448c7f0a..dfabebdb6ad 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1623,6 +1623,8 @@ * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null} [fedrampModerateSettings] Workload fedrampModerateSettings * @property {string|null} [etag] Workload etag * @property {Object.|null} [labels] Workload labels + * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings */ /** @@ -1738,6 +1740,22 @@ */ Workload.prototype.labels = $util.emptyObject; + /** + * Workload provisionedResourcesParent. + * @member {string} provisionedResourcesParent + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.provisionedResourcesParent = ""; + + /** + * Workload kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.kmsSettings = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -1802,6 +1820,10 @@ $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.encode(message.fedrampHighSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.fedrampModerateSettings != null && Object.hasOwnProperty.call(message, "fedrampModerateSettings")) $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.encode(message.fedrampModerateSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.provisionedResourcesParent != null && Object.hasOwnProperty.call(message, "provisionedResourcesParent")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.provisionedResourcesParent); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -1893,6 +1915,12 @@ } message.labels[key] = value; break; + case 13: + message.provisionedResourcesParent = reader.string(); + break; + case 14: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -2012,6 +2040,14 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + if (!$util.isString(message.provisionedResourcesParent)) + return "provisionedResourcesParent: string expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } return null; }; @@ -2099,6 +2135,13 @@ for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.provisionedResourcesParent != null) + message.provisionedResourcesParent = String(object.provisionedResourcesParent); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } return message; }; @@ -2126,6 +2169,8 @@ object.createTime = null; object.billingAccount = ""; object.etag = ""; + object.provisionedResourcesParent = ""; + object.kmsSettings = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2170,6 +2215,10 @@ if (options.oneofs) object.complianceRegimeSettings = "fedrampModerateSettings"; } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + object.provisionedResourcesParent = message.provisionedResourcesParent; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); return object; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index a8449157fc2..2ac48dd6f51 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -246,6 +246,7 @@ "type": "IL4Settings", "id": 7, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -253,6 +254,7 @@ "type": "CJISSettings", "id": 8, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -260,6 +262,7 @@ "type": "FedrampHighSettings", "id": 11, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -267,6 +270,7 @@ "type": "FedrampModerateSettings", "id": 12, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -284,6 +288,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "provisionedResourcesParent": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "kmsSettings": { + "type": "KMSSettings", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } }, "nested": { @@ -327,6 +345,9 @@ } }, "IL4Settings": { + "options": { + "deprecated": true + }, "fields": { "kmsSettings": { "type": "KMSSettings", @@ -338,6 +359,9 @@ } }, "CJISSettings": { + "options": { + "deprecated": true + }, "fields": { "kmsSettings": { "type": "KMSSettings", @@ -349,6 +373,9 @@ } }, "FedrampHighSettings": { + "options": { + "deprecated": true + }, "fields": { "kmsSettings": { "type": "KMSSettings", @@ -360,6 +387,9 @@ } }, "FedrampModerateSettings": { + "options": { + "deprecated": true + }, "fields": { "kmsSettings": { "type": "KMSSettings", diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 51ab35b24b7..00ccd2238ff 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -3,8 +3,16 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-assured-workloads.git", - "sha": "d6454102a8dfcf3e64fb7b58ff53071dce8696cf" + "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", + "sha": "6c7a0638886e37cecd8dbc64860880fe3c0a65ce" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "8d245ac97e058b541f1477b1a85d676b18e80849", + "internalRef": "342580339" } }, { @@ -79,14 +87,12 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.4211562522", "protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", "protos/protos.d.ts", "protos/protos.js", "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.1886703785", "src/index.ts", "src/v1beta1/assured_workloads_service_client.ts", "src/v1beta1/assured_workloads_service_client_config.json", From 2c37f331495a0c8f6406993878b5418ec18fbdd6 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Nov 2020 10:43:17 -0800 Subject: [PATCH 010/116] chore: release 1.1.0 (#15) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 241a740e536..809b31ec9c9 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.0.1...v1.1.0) (2020-11-16) + + +### Features + +* added provisionedResourcesParent and kmsSettings ([4b34991](https://www.github.com/googleapis/nodejs-assured-workloads/commit/4b34991f8c3a9878f6ca9583bfbccbad691fa69b)) + ### [1.0.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.0.0...v1.0.1) (2020-11-06) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 37500f2e57a..b2e89f29bbf 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.0.1", + "version": "1.1.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index a026bc83061..2bf26c0763f 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.0.1" + "@google-cloud/assured-workloads": "^1.1.0" }, "devDependencies": { "c8": "^7.3.0", From 8b2c9b33498451952a8a68b695224df48d43ee0d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 21:59:06 -0800 Subject: [PATCH 011/116] fix: better fallback feature detection, linting, use optional chaining for window.fetch feature detection, mark window as global for linter (#19) * fix: better fallback feature detection, jsdoc update Use gapic-generator-typescript v1.2.2. PiperOrigin-RevId: 342778480 Source-Author: Google APIs Source-Date: Mon Nov 16 20:22:00 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: c6b1c72942991b1c605fe56a6041e06a86a9443e Source-Link: https://github.com/googleapis/googleapis/commit/c6b1c72942991b1c605fe56a6041e06a86a9443e * fix: linting, updated jsdoc blocks Use gapic-generator-typescript v1.2.3. PiperOrigin-RevId: 342976840 Source-Author: Google APIs Source-Date: Tue Nov 17 17:04:11 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: c979fbeb80d1b940790a69183629d799e4c05b4c Source-Link: https://github.com/googleapis/googleapis/commit/c979fbeb80d1b940790a69183629d799e4c05b4c * fix: use optional chaining for window.fetch feature detection Use gapic-generator-typescript v1.2.4. Committer: @alexander-fenster PiperOrigin-RevId: 343136730 Source-Author: Google APIs Source-Date: Wed Nov 18 12:49:25 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 2cda8d285b66c14da57363201b7e4efbca47d034 Source-Link: https://github.com/googleapis/googleapis/commit/2cda8d285b66c14da57363201b7e4efbca47d034 * fix: mark window as global for linter Use gapic-generator-typescript v1.2.5. Committer: @alexander-fenster PiperOrigin-RevId: 343187793 Source-Author: Google APIs Source-Date: Wed Nov 18 17:10:02 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 5587028631d4d743fd906c4eb4e4e4649a7ee5ce Source-Link: https://github.com/googleapis/googleapis/commit/5587028631d4d743fd906c4eb4e4e4649a7ee5ce --- .../protos/protos.json | 117 ++++++++++++++++-- .../assured_workloads_service_client.ts | 70 ++++++----- .../synth.metadata | 6 +- 3 files changed, 150 insertions(+), 43 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 2ac48dd6f51..b9ca2d81d6b 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -34,7 +34,24 @@ "(google.api.method_signature)": "parent,workload", "(google.longrunning.operation_info).response_type": "Workload", "(google.longrunning.operation_info).metadata_type": "CreateWorkloadOperationMetadata" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "parent,workload" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workload", + "metadata_type": "CreateWorkloadOperationMetadata" + } + } + ] }, "UpdateWorkload": { "requestType": "UpdateWorkloadRequest", @@ -43,7 +60,18 @@ "(google.api.http).patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", "(google.api.http).body": "workload", "(google.api.method_signature)": "workload,update_mask" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "workload,update_mask" + } + ] }, "DeleteWorkload": { "requestType": "DeleteWorkloadRequest", @@ -51,7 +79,17 @@ "options": { "(google.api.http).delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "GetWorkload": { "requestType": "GetWorkloadRequest", @@ -59,7 +97,17 @@ "options": { "(google.api.http).get": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "ListWorkloads": { "requestType": "ListWorkloadsRequest", @@ -67,7 +115,17 @@ "options": { "(google.api.http).get": "/v1beta1/{parent=organizations/*/locations/*}/workloads", "(google.api.method_signature)": "parent" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=organizations/*/locations/*}/workloads" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -1618,7 +1676,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations}", "(google.api.method_signature)": "name,filter" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] }, "GetOperation": { "requestType": "GetOperationRequest", @@ -1626,7 +1694,17 @@ "options": { "(google.api.http).get": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteOperation": { "requestType": "DeleteOperationRequest", @@ -1634,7 +1712,17 @@ "options": { "(google.api.http).delete": "/v1/{name=operations/**}", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "CancelOperation": { "requestType": "CancelOperationRequest", @@ -1643,7 +1731,18 @@ "(google.api.http).post": "/v1/{name=operations/**}:cancel", "(google.api.http).body": "*", "(google.api.method_signature)": "name" - } + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "WaitOperation": { "requestType": "WaitOperationRequest", diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index ddcfa383b6d..162bcc1cc78 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/assured_workloads_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ import * as gapicConfig from './assured_workloads_service_client_config.json'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class AssuredWorkloadsServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - client configuration override. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -101,7 +107,9 @@ export class AssuredWorkloadsServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -352,7 +360,7 @@ export class AssuredWorkloadsServiceClient { // ------------------- updateWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.assuredworkloads.v1beta1.IWorkload, @@ -365,7 +373,7 @@ export class AssuredWorkloadsServiceClient { >; updateWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest @@ -412,7 +420,7 @@ export class AssuredWorkloadsServiceClient { updateWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest @@ -438,12 +446,12 @@ export class AssuredWorkloadsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -458,7 +466,7 @@ export class AssuredWorkloadsServiceClient { } deleteWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.protobuf.IEmpty, @@ -471,7 +479,7 @@ export class AssuredWorkloadsServiceClient { >; deleteWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest @@ -517,7 +525,7 @@ export class AssuredWorkloadsServiceClient { deleteWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.protobuf.IEmpty, | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest @@ -543,12 +551,12 @@ export class AssuredWorkloadsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -563,7 +571,7 @@ export class AssuredWorkloadsServiceClient { } getWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.assuredworkloads.v1beta1.IWorkload, @@ -576,7 +584,7 @@ export class AssuredWorkloadsServiceClient { >; getWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest @@ -619,7 +627,7 @@ export class AssuredWorkloadsServiceClient { getWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest @@ -645,12 +653,12 @@ export class AssuredWorkloadsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -666,7 +674,7 @@ export class AssuredWorkloadsServiceClient { createWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -679,7 +687,7 @@ export class AssuredWorkloadsServiceClient { >; createWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, @@ -731,7 +739,7 @@ export class AssuredWorkloadsServiceClient { createWorkload( request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.assuredworkloads.v1beta1.IWorkload, @@ -759,12 +767,12 @@ export class AssuredWorkloadsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -816,7 +824,7 @@ export class AssuredWorkloadsServiceClient { } listWorkloads( request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.assuredworkloads.v1beta1.IWorkload[], @@ -826,7 +834,7 @@ export class AssuredWorkloadsServiceClient { >; listWorkloads( request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse @@ -878,7 +886,7 @@ export class AssuredWorkloadsServiceClient { listWorkloads( request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse @@ -901,12 +909,12 @@ export class AssuredWorkloadsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -950,7 +958,7 @@ export class AssuredWorkloadsServiceClient { */ listWorkloadsStream( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1006,7 +1014,7 @@ export class AssuredWorkloadsServiceClient { */ listWorkloadsAsync( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 00ccd2238ff..2032096f17c 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "6c7a0638886e37cecd8dbc64860880fe3c0a65ce" + "sha": "bdaed097558f9b56cbe8e2013f26b09c7fd203d7" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8d245ac97e058b541f1477b1a85d676b18e80849", - "internalRef": "342580339" + "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", + "internalRef": "343187793" } }, { From 8905cd7a68535cd9108dc5c756a62d5bf23dd6c1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:36:17 -0800 Subject: [PATCH 012/116] docs: spelling correction for "targetting" (#21) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c503f640-90ae-4547-bcc8-a154d32c609e/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- .../google-cloud-assuredworkloads/README.md | 2 +- .../synth.metadata | 75 +------------------ 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index a14e007aab7..d752e108a97 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -102,7 +102,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +Client libraries targeting some end-of-life versions of Node.js are available, and can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 2032096f17c..880faa0db78 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "bdaed097558f9b56cbe8e2013f26b09c7fd203d7" + "sha": "3143b2ff3ced03469ee569e3bfd9528b1f27ca64" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -33,76 +33,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1beta1/assured_workloads_service_client.ts", - "src/v1beta1/assured_workloads_service_client_config.json", - "src/v1beta1/assured_workloads_service_proto_list.json", - "src/v1beta1/index.ts", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_assured_workloads_service_v1beta1.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 73a59eb9f3ededf6c745940f2fe6d19bc8e3bc7e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:42:18 +0000 Subject: [PATCH 013/116] chore: release 1.1.1 (#20) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.0...v1.1.1) (2020-11-25) ### Bug Fixes * better fallback feature detection, linting, use optional chaining for window.fetch feature detection, mark window as global for linter ([#19](https://www.github.com/googleapis/nodejs-assured-workloads/issues/19)) ([3143b2f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/3143b2ff3ced03469ee569e3bfd9528b1f27ca64)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 809b31ec9c9..ca9a233ce9b 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.0...v1.1.1) (2020-11-25) + + +### Bug Fixes + +* better fallback feature detection, linting, use optional chaining for window.fetch feature detection, mark window as global for linter ([#19](https://www.github.com/googleapis/nodejs-assured-workloads/issues/19)) ([3143b2f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/3143b2ff3ced03469ee569e3bfd9528b1f27ca64)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.0.1...v1.1.0) (2020-11-16) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index b2e89f29bbf..6402bd524cd 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.1.0", + "version": "1.1.1", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 2bf26c0763f..ab2979211fb 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.1.0" + "@google-cloud/assured-workloads": "^1.1.1" }, "devDependencies": { "c8": "^7.3.0", From 664aedc7b12a5527cf7f49189aaf8415d35c79d6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:21 -0800 Subject: [PATCH 014/116] chore: generate GAPIC metadata JSON file (#22) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/464906e9-6f3c-41d1-906e-fd7073c42d19/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1beta1/gapic_metadata.json | 77 +++++++++++++++++++ .../synth.metadata | 6 +- 2 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..129b0260237 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.assuredworkloads.v1beta1", + "libraryPackage": "@google-cloud/assured-workloads", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "AssuredWorkloadsServiceClient", + "rpcs": { + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads", + "listWorkloadsStream", + "listWorkloadsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssuredWorkloadsServiceClient", + "rpcs": { + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads", + "listWorkloadsStream", + "listWorkloadsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 880faa0db78..ef6bd39300f 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "3143b2ff3ced03469ee569e3bfd9528b1f27ca64" + "sha": "696ea3501eb9844a4d45cf11e058dcb9907a0e19" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", - "internalRef": "343187793" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From f8ff91f8ee5574c4d7e06bb9803eed0ebf8cf4a1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:44:23 -0800 Subject: [PATCH 015/116] docs: add instructions for authenticating for system tests (#23) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9943226b-8e9b-44fd-b025-446fc572242a/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- .../google-cloud-assuredworkloads/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-assuredworkloads/README.md | 3 +-- .../google-cloud-assuredworkloads/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CONTRIBUTING.md b/packages/google-cloud-assuredworkloads/CONTRIBUTING.md index f6c4cf010e3..659576d0ba7 100644 --- a/packages/google-cloud-assuredworkloads/CONTRIBUTING.md +++ b/packages/google-cloud-assuredworkloads/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Assured Workloads for Government API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + ## Running the tests 1. [Prepare your environment for Node.js setup][setup]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. npm run fix [setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=assuredworkloads.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index d752e108a97..3a3cc3b2bfb 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -84,8 +84,7 @@ listWorkloads(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index ef6bd39300f..b3103f70666 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "696ea3501eb9844a4d45cf11e058dcb9907a0e19" + "sha": "0cffbafe6e2f600745f3b90ebdc0550dc29b1dd3" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 7315e9e996e2b96851627196e0b300fe93cdd6e7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:54:05 -0800 Subject: [PATCH 016/116] docs: update dates (#24) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/38d2be22-9113-41ce-971f-d924d46e1bec/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-assuredworkloads/.jsdoc.js | 4 ++-- packages/google-cloud-assuredworkloads/protos/protos.d.ts | 2 +- packages/google-cloud-assuredworkloads/protos/protos.js | 2 +- packages/google-cloud-assuredworkloads/src/index.ts | 2 +- .../src/v1beta1/assured_workloads_service_client.ts | 2 +- packages/google-cloud-assuredworkloads/src/v1beta1/index.ts | 2 +- packages/google-cloud-assuredworkloads/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-assuredworkloads/system-test/install.ts | 2 +- .../test/gapic_assured_workloads_service_v1beta1.ts | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.jsdoc.js b/packages/google-cloud-assuredworkloads/.jsdoc.js index ebea00637e9..e7da941cb9b 100644 --- a/packages/google-cloud-assuredworkloads/.jsdoc.js +++ b/packages/google-cloud-assuredworkloads/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/assured-workloads', diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index cbf9c8b5f38..23604bdabe4 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index dfabebdb6ad..af0eecd5551 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index ededcb21424..e913d1c6dc2 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 162bcc1cc78..d1a40d5b093 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts index 5a97fe8a1d5..1a8d1fab704 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index b3103f70666..e115d9938f5 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "0cffbafe6e2f600745f3b90ebdc0550dc29b1dd3" + "sha": "7d78aadfa9f46e85ec0c153a63074da4c00dcb8f" } }, { diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js index 3826ee2847f..8d0ec2e2016 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts index e3de9ccc93a..bd1fed47afb 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/install.ts b/packages/google-cloud-assuredworkloads/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-assuredworkloads/system-test/install.ts +++ b/packages/google-cloud-assuredworkloads/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index c874a40c57e..903ff53d317 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 2037a15573327b3488d9d26a616f3128d8f36f4b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:42:28 -0800 Subject: [PATCH 017/116] feat: adds style enumeration (#25) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/792bebba-dea1-4f73-8394-fb548c6dd86b/targets - [ ] To automatically regenerate this PR, check this box. --- .../protos/protos.d.ts | 12 +++ .../protos/protos.js | 78 ++++++++++++++++++- .../protos/protos.json | 13 +++- .../synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 23604bdabe4..6d8c8742680 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1971,6 +1971,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -2000,6 +2003,9 @@ export namespace google { /** ResourceDescriptor singular. */ public singular: string; + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set @@ -2079,6 +2085,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index af0eecd5551..929b2d0a608 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -4745,6 +4745,7 @@ * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history * @property {string|null} [plural] ResourceDescriptor plural * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style */ /** @@ -4757,6 +4758,7 @@ */ function ResourceDescriptor(properties) { this.pattern = []; + this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4811,6 +4813,14 @@ */ ResourceDescriptor.prototype.singular = ""; + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create @@ -4848,6 +4858,12 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; @@ -4902,6 +4918,16 @@ 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()); + break; default: reader.skipType(tag & 7); break; @@ -4965,6 +4991,18 @@ if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } return null; }; @@ -5009,6 +5047,23 @@ message.plural = String(object.plural); if (object.singular != null) message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } return message; }; @@ -5025,8 +5080,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -5049,6 +5106,11 @@ object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } return object; }; @@ -5079,6 +5141,20 @@ return values; })(); + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + return ResourceDescriptor; })(); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index b9ca2d81d6b..b78bed095e4 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -678,6 +678,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -687,6 +692,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -706,7 +717,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index e115d9938f5..b63e4e2eb26 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "7d78aadfa9f46e85ec0c153a63074da4c00dcb8f" + "sha": "eb1ff2c7539daf1f6be57120afd883e1ff5a4f78" } }, { From d0adc5398b6ea7c680c2894c676f3a6244f402ed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:38:10 +0000 Subject: [PATCH 018/116] chore: release 1.2.0 (#26) :robot: I have created a release \*beep\* \*boop\* --- ## [1.2.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.1...v1.2.0) (2021-01-09) ### Features * adds style enumeration ([#25](https://www.github.com/googleapis/nodejs-assured-workloads/issues/25)) ([700731f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/700731fc48712c2af46bf7e74de42e7f24f7171c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index ca9a233ce9b..18fd8f9f3e0 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.2.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.1...v1.2.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#25](https://www.github.com/googleapis/nodejs-assured-workloads/issues/25)) ([700731f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/700731fc48712c2af46bf7e74de42e7f24f7171c)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.0...v1.1.1) (2020-11-25) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 6402bd524cd..63d5f72b3a0 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.1.1", + "version": "1.2.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index ab2979211fb..13b2c7edb76 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.1.1" + "@google-cloud/assured-workloads": "^1.2.0" }, "devDependencies": { "c8": "^7.3.0", From fb6b10f2d73a6832a096a2cd2f372c935e74c0fd Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:44:31 -0800 Subject: [PATCH 019/116] refactor(nodejs): move build cop to flakybot (#29) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/dfbad313-7afb-4cf6-b229-0476fcc2130c/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-assuredworkloads/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index b63e4e2eb26..55a060b3596 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "eb1ff2c7539daf1f6be57120afd883e1ff5a4f78" + "sha": "a0e0aaed044febaaada696f86fe16c25c8b37f48" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 8c6f784bb182936031b859cee054685e2c2663d9 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 19:00:45 -0800 Subject: [PATCH 020/116] chore: add UNORDERED_LIST to protos (#31) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. Co-authored-by: Justin Beckwith --- packages/google-cloud-assuredworkloads/protos/protos.d.ts | 3 ++- packages/google-cloud-assuredworkloads/protos/protos.js | 7 +++++++ packages/google-cloud-assuredworkloads/protos/protos.json | 3 ++- packages/google-cloud-assuredworkloads/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 6d8c8742680..c068eaf5f52 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1948,7 +1948,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 929b2d0a608..1ae8147aafe 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -4721,6 +4721,7 @@ * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -4730,6 +4731,7 @@ values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; return values; })(); @@ -10897,6 +10899,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -10997,6 +11000,10 @@ case 5: message[".google.api.fieldBehavior"][i] = 5; break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index b78bed095e4..8dff73f8fe6 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -633,7 +633,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "resourceReference": { diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 55a060b3596..df394e5e5a7 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "a0e0aaed044febaaada696f86fe16c25c8b37f48" + "sha": "d92d12cbc6b076a9035490fc818cfd62368bf8cc" } }, { From f2fdeff6cabd075e1b40bce74521ad54c5ccb6d8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Feb 2021 08:58:23 -0800 Subject: [PATCH 021/116] feat: updated google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService service. Clients can now create workloads with US_REGIONAL_ACCESS compliance regime (#32) PiperOrigin-RevId: 352973788 Source-Author: Google APIs Source-Date: Thu Jan 21 02:18:11 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: 56df28f70dbfddd90da3c4e38cce2ae3c81162e4 Source-Link: https://github.com/googleapis/googleapis/commit/56df28f70dbfddd90da3c4e38cce2ae3c81162e4 --- .../v1beta1/assuredworkloads_v1beta1.proto | 3 +++ .../google-cloud-assuredworkloads/protos/protos.d.ts | 3 ++- .../google-cloud-assuredworkloads/protos/protos.js | 12 ++++++++++++ .../google-cloud-assuredworkloads/protos/protos.json | 3 ++- .../google-cloud-assuredworkloads/synth.metadata | 6 +++--- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index 3aaac707fac..40e1bda96ec 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -307,6 +307,9 @@ message Workload { // FedRAMP Moderate data protection controls FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; } // Optional. The resource name of the workload. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index c068eaf5f52..da6bcc6547e 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1484,7 +1484,8 @@ export namespace google { IL4 = 1, CJIS = 2, FEDRAMP_HIGH = 3, - FEDRAMP_MODERATE = 4 + FEDRAMP_MODERATE = 4, + US_REGIONAL_ACCESS = 5 } } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 1ae8147aafe..f9a9460bc5b 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1981,6 +1981,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2098,6 +2099,10 @@ case 4: message.complianceRegime = 4; break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -3488,6 +3493,7 @@ * @property {number} CJIS=2 CJIS value * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value + * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3496,6 +3502,7 @@ values[valuesById[2] = "CJIS"] = 2; values[valuesById[3] = "FEDRAMP_HIGH"] = 3; values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; + values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; return values; })(); @@ -3694,6 +3701,7 @@ case 2: case 3: case 4: + case 5: break; } return null; @@ -3741,6 +3749,10 @@ case 4: message.complianceRegime = 4; break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; } return message; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 8dff73f8fe6..0fc4920a272 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -464,7 +464,8 @@ "IL4": 1, "CJIS": 2, "FEDRAMP_HIGH": 3, - "FEDRAMP_MODERATE": 4 + "FEDRAMP_MODERATE": 4, + "US_REGIONAL_ACCESS": 5 } } } diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index df394e5e5a7..67f449aac8b 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "d92d12cbc6b076a9035490fc818cfd62368bf8cc" + "sha": "1fdf8f76f99de872a8ba152da6fad33d3eea5887" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "56df28f70dbfddd90da3c4e38cce2ae3c81162e4", + "internalRef": "352973788" } }, { From 6390c817a98846bb84dae3cd33bd5e21b988ae4e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 18 Feb 2021 09:18:18 -0800 Subject: [PATCH 022/116] chore: release 1.3.0 (#33) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 18fd8f9f3e0..c25681e5099 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.2.0...v1.3.0) (2021-02-18) + + +### Features + +* updated google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService service. Clients can now create workloads with US_REGIONAL_ACCESS compliance regime ([#32](https://www.github.com/googleapis/nodejs-assured-workloads/issues/32)) ([f395037](https://www.github.com/googleapis/nodejs-assured-workloads/commit/f395037279a3cda1a784bcab83dc65cd3b177b45)) + ## [1.2.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.1.1...v1.2.0) (2021-01-09) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 63d5f72b3a0..6cad91be417 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.2.0", + "version": "1.3.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 13b2c7edb76..7fb0db83bfe 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.2.0" + "@google-cloud/assured-workloads": "^1.3.0" }, "devDependencies": { "c8": "^7.3.0", From fec2ba8825b0ec7657c5fd108f2ef63589db47f8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:02:06 -0800 Subject: [PATCH 023/116] build: update gapic-generator-typescript to v1.2.10. (#34) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/9f8e7599-f87d-4fac-8f3a-a2e1781c33be/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-assuredworkloads/synth.metadata | 6 +++--- packages/google-cloud-assuredworkloads/webpack.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata index 67f449aac8b..f84816e78a3 100644 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ b/packages/google-cloud-assuredworkloads/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "1fdf8f76f99de872a8ba152da6fad33d3eea5887" + "sha": "9a175c5a87c9b36ff4c9b3151281283c15d88c7c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "56df28f70dbfddd90da3c4e38cce2ae3c81162e4", - "internalRef": "352973788" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" } }, { diff --git a/packages/google-cloud-assuredworkloads/webpack.config.js b/packages/google-cloud-assuredworkloads/webpack.config.js index 6e6dd525d10..41af5a5d1b2 100644 --- a/packages/google-cloud-assuredworkloads/webpack.config.js +++ b/packages/google-cloud-assuredworkloads/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 2e889a3b1616cb745f07569b4d0e27e1dcc850b7 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 18 Mar 2021 16:14:53 -0700 Subject: [PATCH 024/116] chore: migrate to owl bot (#36) --- .../.github/.OwlBot.yaml | 23 ++ .../.repo-metadata.json | 15 +- .../v1beta1/assuredworkloads_v1beta1.proto | 26 +- .../protos/protos.d.ts | 106 ++++++- .../protos/protos.js | 298 +++++++++++++++++- .../protos/protos.json | 24 +- .../synth.metadata | 37 --- .../google-cloud-assuredworkloads/synth.py | 39 --- 8 files changed, 481 insertions(+), 87 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml delete mode 100644 packages/google-cloud-assuredworkloads/synth.metadata delete mode 100644 packages/google-cloud-assuredworkloads/synth.py diff --git a/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml b/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml new file mode 100644 index 00000000000..55ce47be27e --- /dev/null +++ b/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml @@ -0,0 +1,23 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/assuredworkloads/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index f0a6fbc652a..704a4092d02 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "assuredworkloads", - "name_pretty": "Assured Workloads for Government", - "product_documentation": "https://cloud.google.com/assured-workloads/docs", "client_documentation": "https://googleapis.dev/nodejs/assuredworkloads/latest", - "issue_tracker": "", + "api_id": "assuredworkloads.googleapis.com", + "distribution_name": "@google-cloud/assured-workloads", "release_level": "beta", + "default_version": "v1beta1", "language": "nodejs", + "name_pretty": "Assured Workloads for Government", "repo": "googleapis/nodejs-assured-workloads", - "distribution_name": "@google-cloud/assured-workloads", - "api_id": "assuredworkloads.googleapis.com", - "requires_billing": true + "product_documentation": "https://cloud.google.com/assured-workloads/docs", + "requires_billing": true, + "name": "assuredworkloads", + "issue_tracker": "" } diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index 40e1bda96ec..5467fbad1d0 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -291,6 +291,19 @@ message Workload { ]; } + // Represent the custom settings for the resources to be created. + message ResourceSettings { + // Resource identifier. + // For a project this represents project_id. If the project is already + // taken, the workload creation will fail. + string resource_id = 1; + + // Indicates the type of resource. This field should be specified to + // correspond the id to the right project type (CONSUMER_PROJECT or + // ENCRYPTION_KEYS_PROJECT) + ResourceInfo.ResourceType resource_type = 2; + } + // Supported Compliance Regimes. enum ComplianceRegime { // Unknown compliance regime. @@ -310,6 +323,12 @@ message Workload { // Assured Workloads For US Regions data protection controls US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; } // Optional. The resource name of the workload. @@ -413,6 +432,11 @@ message Workload { // CMEK key is provisioned. This field is mandatory for a subset of Compliance // Regimes. KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Resource properties that are used to customize workload resources. + // These properties (such as custom project id) will be used to create + // workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index da6bcc6547e..ff376656d9c 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -787,6 +787,9 @@ export namespace google { /** Workload kmsSettings */ kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + + /** Workload resourceSettings */ + resourceSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]|null); } /** Represents a Workload. */ @@ -840,6 +843,9 @@ export namespace google { /** Workload kmsSettings. */ public kmsSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null); + /** Workload resourceSettings. */ + public resourceSettings: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]; + /** Workload complianceRegimeSettings. */ public complianceRegimeSettings?: ("il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"); @@ -1478,6 +1484,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ResourceSettings. */ + interface IResourceSettings { + + /** ResourceSettings resourceId */ + resourceId?: (string|null); + + /** ResourceSettings resourceType */ + resourceType?: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null); + } + + /** Represents a ResourceSettings. */ + class ResourceSettings implements IResourceSettings { + + /** + * Constructs a new ResourceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings); + + /** ResourceSettings resourceId. */ + public resourceId: string; + + /** ResourceSettings resourceType. */ + public resourceType: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType); + + /** + * Creates a new ResourceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings): google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings; + + /** + * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @param message ResourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @param message ResourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings; + + /** + * Verifies a ResourceSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings; + + /** + * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. + * @param message ResourceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** ComplianceRegime enum. */ enum ComplianceRegime { COMPLIANCE_REGIME_UNSPECIFIED = 0, @@ -1485,7 +1587,9 @@ export namespace google { CJIS = 2, FEDRAMP_HIGH = 3, FEDRAMP_MODERATE = 4, - US_REGIONAL_ACCESS = 5 + US_REGIONAL_ACCESS = 5, + HIPAA = 6, + HITRUST = 7 } } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index f9a9460bc5b..96b0a07394e 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1625,6 +1625,7 @@ * @property {Object.|null} [labels] Workload labels * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings + * @property {Array.|null} [resourceSettings] Workload resourceSettings */ /** @@ -1638,6 +1639,7 @@ function Workload(properties) { this.resources = []; this.labels = {}; + this.resourceSettings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1756,6 +1758,14 @@ */ Workload.prototype.kmsSettings = null; + /** + * Workload resourceSettings. + * @member {Array.} resourceSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.resourceSettings = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -1824,6 +1834,9 @@ writer.uint32(/* id 13, wireType 2 =*/106).string(message.provisionedResourcesParent); if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.resourceSettings != null && message.resourceSettings.length) + for (var i = 0; i < message.resourceSettings.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; @@ -1921,6 +1934,11 @@ case 14: message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); break; + case 15: + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1982,6 +2000,8 @@ case 3: case 4: case 5: + case 6: + case 7: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2049,6 +2069,15 @@ if (error) return "kmsSettings." + error; } + if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { + if (!Array.isArray(message.resourceSettings)) + return "resourceSettings: array expected"; + for (var i = 0; i < message.resourceSettings.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); + if (error) + return "resourceSettings." + error; + } + } return null; }; @@ -2103,6 +2132,14 @@ case 5: message.complianceRegime = 5; break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -2147,6 +2184,16 @@ throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.kmsSettings: object expected"); message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); } + if (object.resourceSettings) { + if (!Array.isArray(object.resourceSettings)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: array expected"); + message.resourceSettings = []; + for (var i = 0; i < object.resourceSettings.length; ++i) { + if (typeof object.resourceSettings[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: object expected"); + message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); + } + } return message; }; @@ -2163,8 +2210,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.resources = []; + object.resourceSettings = []; + } if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { @@ -2224,6 +2273,11 @@ object.provisionedResourcesParent = message.provisionedResourcesParent; if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + if (message.resourceSettings && message.resourceSettings.length) { + object.resourceSettings = []; + for (var j = 0; j < message.resourceSettings.length; ++j) + object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); + } return object; }; @@ -3484,6 +3538,234 @@ return FedrampModerateSettings; })(); + Workload.ResourceSettings = (function() { + + /** + * Properties of a ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IResourceSettings + * @property {string|null} [resourceId] ResourceSettings resourceId + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceSettings resourceType + */ + + /** + * Constructs a new ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a ResourceSettings. + * @implements IResourceSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set + */ + function ResourceSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceSettings resourceId. + * @member {string} resourceId + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceId = ""; + + /** + * ResourceSettings resourceType. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceType = 0; + + /** + * Creates a new ResourceSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings instance + */ + ResourceSettings.create = function create(properties) { + return new ResourceSettings(properties); + }; + + /** + * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + return writer; + }; + + /** + * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.resourceType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isString(message.resourceId)) + return "resourceId: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + */ + ResourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); + if (object.resourceId != null) + message.resourceId = String(object.resourceId); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} message ResourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceId = ""; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + object.resourceId = message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + return object; + }; + + /** + * Converts this ResourceSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + * @returns {Object.} JSON object + */ + ResourceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSettings; + })(); + /** * ComplianceRegime enum. * @name google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime @@ -3494,6 +3776,8 @@ * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value + * @property {number} HIPAA=6 HIPAA value + * @property {number} HITRUST=7 HITRUST value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3503,6 +3787,8 @@ values[valuesById[3] = "FEDRAMP_HIGH"] = 3; values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; + values[valuesById[6] = "HIPAA"] = 6; + values[valuesById[7] = "HITRUST"] = 7; return values; })(); @@ -3702,6 +3988,8 @@ case 3: case 4: case 5: + case 6: + case 7: break; } return null; @@ -3753,6 +4041,14 @@ case 5: message.complianceRegime = 5; break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; } return message; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 0fc4920a272..b369ea80e19 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -360,6 +360,14 @@ "options": { "(google.api.field_behavior)": "INPUT_ONLY" } + }, + "resourceSettings": { + "rule": "repeated", + "type": "ResourceSettings", + "id": 15, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } } }, "nested": { @@ -458,6 +466,18 @@ } } }, + "ResourceSettings": { + "fields": { + "resourceId": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "ResourceInfo.ResourceType", + "id": 2 + } + } + }, "ComplianceRegime": { "values": { "COMPLIANCE_REGIME_UNSPECIFIED": 0, @@ -465,7 +485,9 @@ "CJIS": 2, "FEDRAMP_HIGH": 3, "FEDRAMP_MODERATE": 4, - "US_REGIONAL_ACCESS": 5 + "US_REGIONAL_ACCESS": 5, + "HIPAA": 6, + "HITRUST": 7 } } } diff --git a/packages/google-cloud-assuredworkloads/synth.metadata b/packages/google-cloud-assuredworkloads/synth.metadata deleted file mode 100644 index f84816e78a3..00000000000 --- a/packages/google-cloud-assuredworkloads/synth.metadata +++ /dev/null @@ -1,37 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-assured-workloads.git", - "sha": "9a175c5a87c9b36ff4c9b3151281283c15d88c7c" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "assuredworkloads", - "apiVersion": "v1beta1", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/synth.py b/packages/google-cloud-assuredworkloads/synth.py deleted file mode 100644 index ae0ab217fdc..00000000000 --- a/packages/google-cloud-assuredworkloads/synth.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node as node -import subprocess -import logging - -logging.basicConfig(level=logging.DEBUG) - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1beta1'] -name = 'assuredworkloads' -for version in versions: - library = gapic.node_library(name, version) - s.copy(library, excludes=['README.md', 'package.json']) - -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library( - source_location='build/src', versions=versions) -s.copy(templates, excludes=[]) - -node.postprocess_gapic_library() - From 41fbd9730829cc2e315c5f1ab835c6e8d5c7b253 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:05:38 -0700 Subject: [PATCH 025/116] chore: release 1.4.0 (#42) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index c25681e5099..7a466449504 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.4.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.3.0...v1.4.0) (2021-03-19) + + +### Features + +* add HIPAA and HITRUST compliance regimes ([#41](https://www.github.com/googleapis/nodejs-assured-workloads/issues/41)) ([a1c0181](https://www.github.com/googleapis/nodejs-assured-workloads/commit/a1c01819c0578d088de5e7d35890a914ff6a7aee)) + ## [1.3.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.2.0...v1.3.0) (2021-02-18) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 6cad91be417..d5e3c9bd028 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.3.0", + "version": "1.4.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 7fb0db83bfe..31b7a9171af 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.3.0" + "@google-cloud/assured-workloads": "^1.4.0" }, "devDependencies": { "c8": "^7.3.0", From 3f831f12bb2c24a4aa53a93955dec2486681c0cf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:52:21 +0100 Subject: [PATCH 026/116] chore(deps): update dependency sinon to v10 (#44) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.3` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index d5e3c9bd028..dd279c967c1 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -54,7 +54,7 @@ "mocha": "^8.1.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.3", + "sinon": "^10.0.0", "ts-loader": "^8.0.3", "typescript": "^3.9.7", "webpack": "^5.0.0", From caab055fc72f61e80d029ff2c86cfcb67fe6ac0a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Mar 2021 18:40:04 +0000 Subject: [PATCH 027/116] chore: release 1.4.0 (#43) :robot: I have created a release \*beep\* \*boop\* --- ## [1.4.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.3.0...v1.4.0) (2021-03-23) ### Features * add HIPAA and HITRUST compliance regimes ([#41](https://www.github.com/googleapis/nodejs-assured-workloads/issues/41)) ([a1c0181](https://www.github.com/googleapis/nodejs-assured-workloads/commit/a1c01819c0578d088de5e7d35890a914ff6a7aee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 7a466449504..b3434bb6726 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.4.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.3.0...v1.4.0) (2021-03-23) + + +### Features + +* add HIPAA and HITRUST compliance regimes ([#41](https://www.github.com/googleapis/nodejs-assured-workloads/issues/41)) ([a1c0181](https://www.github.com/googleapis/nodejs-assured-workloads/commit/a1c01819c0578d088de5e7d35890a914ff6a7aee)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.3.0...v1.4.0) (2021-03-19) From b9182ea6c89021d79d521fb85d9acc37266b43ee Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 07:39:35 -0700 Subject: [PATCH 028/116] build: update .OwlBot.lock with new version of post-processor (#47) Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index e913d1c6dc2..8c2568153e8 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** import * as v1beta1 from './v1beta1'; + const AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; type AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; + export {v1beta1, AssuredWorkloadsServiceClient}; export default {v1beta1, AssuredWorkloadsServiceClient}; import * as protos from '../protos/protos'; From 5868cd73ebe47f77250e38f516c61a93324455c1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:12:09 +0200 Subject: [PATCH 029/116] chore(deps): update dependency @types/sinon to v10 (#52) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.5` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index dd279c967c1..5394e8814c5 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@types/mocha": "^8.0.3", "@types/node": "^14.6.1", - "@types/sinon": "^9.0.5", + "@types/sinon": "^10.0.0", "c8": "^7.3.0", "gts": "^2.0.2", "jsdoc": "^3.6.5", From de44976ea301f0091d3e8fc5a83846eb2ad418ed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:54 +0200 Subject: [PATCH 030/116] chore(deps): update dependency ts-loader to v9 (#56) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | [`^8.0.3` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
TypeStrong/ts-loader ### [`v9.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0) Breaking changes: - minimum webpack version: 5 - minimum node version: 12 Changes: - [webpack 5 migration](https://togithub.com/TypeStrong/ts-loader/pull/1251) - thanks [@​johnnyreilly](https://togithub.com/johnnyreilly), [@​jonwallsten](https://togithub.com/jonwallsten), [@​sokra](https://togithub.com/sokra), [@​appzuka](https://togithub.com/appzuka), [@​alexander-akait](https://togithub.com/alexander-akait)
--- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 5394e8814c5..449c91f0f6d 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -55,7 +55,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.3", + "ts-loader": "^9.0.0", "typescript": "^3.9.7", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" From 242dc3389f4c648b6fb766f47de6230ead45d447 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:48:58 -0700 Subject: [PATCH 031/116] fix(deps): require google-gax v2.12.0 (#60) --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 449c91f0f6d..b883c238cee 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.3", From fe9940753b4a9e08633f9ae40501577610c068fa Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 17:00:11 +0000 Subject: [PATCH 032/116] chore: new owl bot post processor docker image (#62) gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f --- .../protos/protos.d.ts | 10 +- .../protos/protos.js | 20 +- .../assured_workloads_service_client.ts | 80 ++- .../system-test/fixtures/sample/src/index.js | 3 +- ...gapic_assured_workloads_service_v1beta1.ts | 472 +++++++++--------- 5 files changed, 295 insertions(+), 290 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index ff376656d9c..cb6a8a30281 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1850,19 +1850,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 96b0a07394e..52fb76874dd 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -4390,43 +4390,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index d1a40d5b093..75317333991 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -277,13 +277,14 @@ export class AssuredWorkloadsServiceClient { ]; for (const methodName of assuredWorkloadsServiceStubMethods) { const callPromise = this.assuredWorkloadsServiceStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, (err: Error | null | undefined) => () => { throw err; } @@ -456,11 +457,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workload.name': request.workload!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'workload.name': request.workload!.name || '', + }); this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } @@ -561,11 +561,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteWorkload(request, options, callback); } @@ -663,11 +662,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getWorkload(request, options, callback); } @@ -777,11 +775,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createWorkload(request, options, callback); } @@ -919,11 +916,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listWorkloads(request, options, callback); } @@ -964,11 +960,10 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listWorkloads.createStream( @@ -1020,17 +1015,16 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js index 8d0ec2e2016..ad2f20501ed 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js @@ -20,7 +20,8 @@ const assuredworkloads = require('@google-cloud/assured-workloads'); function main() { - const assuredWorkloadsServiceClient = new assuredworkloads.AssuredWorkloadsServiceClient(); + const assuredWorkloadsServiceClient = + new assuredworkloads.AssuredWorkloadsServiceClient(); } main(); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 903ff53d317..a1bb990fbbf 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); return (instance.constructor as typeof protobuf.Message).fromObject( filledObject ) as T; @@ -168,49 +167,46 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('should create a client with no option', () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient(); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ fallback: true, - } - ); + }); assert(client); }); it('has initialize method and supports deferred initialization', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); await client.initialize(); assert(client.assuredWorkloadsServiceStub); }); it('has close method', () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ 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); @@ -219,12 +215,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -243,12 +238,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { describe('updateWorkload', () => { it('invokes updateWorkload without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() @@ -277,12 +273,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes updateWorkload without error using callback', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() @@ -300,9 +297,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); - client.innerApiCalls.updateWorkload = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateWorkload = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateWorkload( request, @@ -328,12 +324,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes updateWorkload with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() @@ -364,12 +361,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { describe('deleteWorkload', () => { it('invokes deleteWorkload without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() @@ -397,12 +395,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes deleteWorkload without error using callback', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() @@ -419,9 +418,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); - client.innerApiCalls.deleteWorkload = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteWorkload = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteWorkload( request, @@ -447,12 +445,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes deleteWorkload with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() @@ -482,12 +481,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { describe('getWorkload', () => { it('invokes getWorkload without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() @@ -515,12 +515,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes getWorkload without error using callback', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() @@ -537,9 +538,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); - client.innerApiCalls.getWorkload = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getWorkload = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getWorkload( request, @@ -565,12 +565,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes getWorkload with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() @@ -600,12 +601,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { describe('createWorkload', () => { it('invokes createWorkload without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() @@ -622,9 +624,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createWorkload = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createWorkload = + stubLongRunningCall(expectedResponse); const [operation] = await client.createWorkload(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -636,12 +637,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes createWorkload without error using callback', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() @@ -658,9 +660,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createWorkload = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createWorkload = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createWorkload( request, @@ -693,12 +694,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes createWorkload with call error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() @@ -726,12 +728,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes createWorkload with LRO error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() @@ -761,12 +764,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes checkCreateWorkloadProgress without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedResponse = generateSampleMessage( new operationsProtos.google.longrunning.Operation() @@ -785,12 +789,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes checkCreateWorkloadProgress with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -808,12 +813,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { describe('listWorkloads', () => { it('invokes listWorkloads without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -849,12 +855,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes listWorkloads without error using callback', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -879,9 +886,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.Workload() ), ]; - client.innerApiCalls.listWorkloads = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listWorkloads = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listWorkloads( request, @@ -909,12 +915,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes listWorkloads with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -942,12 +949,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); it('invokes listWorkloadsStream without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -965,12 +973,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.Workload() ), ]; - client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall( - expectedResponse - ); + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(expectedResponse); const stream = client.listWorkloadsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = []; + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = + []; stream.on( 'data', (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { @@ -992,21 +1000,21 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { .calledWith(client.innerApiCalls.listWorkloads, request) ); assert.strictEqual( - (client.descriptors.page.listWorkloads - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkloads.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listWorkloadsStream with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -1014,13 +1022,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(undefined, expectedError); const stream = client.listWorkloadsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = []; + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = + []; stream.on( 'data', (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { @@ -1041,21 +1048,21 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { .calledWith(client.innerApiCalls.listWorkloads, request) ); assert.strictEqual( - (client.descriptors.page.listWorkloads - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkloads.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listWorkloads without error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -1073,36 +1080,37 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.Workload() ), ]; - client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = []; + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + []; const iterable = client.listWorkloadsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listWorkloads - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listWorkloads - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listWorkloads with error', async () => { - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() @@ -1110,27 +1118,26 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); const iterable = client.listWorkloadsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = []; + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listWorkloads - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listWorkloads - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1143,12 +1150,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { organization: 'organizationValue', location: 'locationValue', }; - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.locationPathTemplate.render = sinon .stub() @@ -1196,12 +1204,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const expectedParameters = { organization: 'organizationValue', }; - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.organizationPathTemplate.render = sinon .stub() @@ -1238,12 +1247,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { location: 'locationValue', workload: 'workloadValue', }; - const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.workloadPathTemplate.render = sinon .stub() From ab29ce24de26be1ff0928ea3ffac552537115fd3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 21:56:07 +0000 Subject: [PATCH 033/116] fix: use require() to load JSON protos (#63) The library is regenerated with gapic-generator-typescript v1.3.1. Committer: @alexander-fenster PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b18044813d4c8c415ff9ea68e76e307eb8e904 --- .../assured_workloads_service_client.ts | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 75317333991..4d0fd99acab 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); /** * Client JSON configuration object, loaded from * `src/v1beta1/assured_workloads_service_client_config.json`. @@ -148,22 +149,7 @@ export class AssuredWorkloadsServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -191,15 +177,11 @@ export class AssuredWorkloadsServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - const protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ From dae839495a351c6a4105f07d0acf698e4b09c2ae Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 23:12:15 +0000 Subject: [PATCH 034/116] chore: update gapic-generator-typescript to v1.3.2 (#64) Committer: @alexander-fenster PiperOrigin-RevId: 372656503 Source-Link: https://github.com/googleapis/googleapis/commit/6fa858c6489b1bbc505a7d7afe39f2dc45819c38 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d7c95df3ab1ea1b4c22a4542bad4924cc46d1388 --- .../src/v1beta1/assured_workloads_service_client.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 4d0fd99acab..0eb16ec4841 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; From 245634f20967eeec4619300b07a0a11b6b01ec2b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 10:29:52 -0700 Subject: [PATCH 035/116] chore: release 1.4.1 (#61) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 8 ++++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index b3434bb6726..a5b5a8fa7a5 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.4.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.0...v1.4.1) (2021-05-12) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#60](https://www.github.com/googleapis/nodejs-assured-workloads/issues/60)) ([2d79414](https://www.github.com/googleapis/nodejs-assured-workloads/commit/2d79414b862ca6cd91b22be00aea06e166f89b42)) +* use require() to load JSON protos ([#63](https://www.github.com/googleapis/nodejs-assured-workloads/issues/63)) ([faf72cf](https://www.github.com/googleapis/nodejs-assured-workloads/commit/faf72cfffbba6acc34e5b981c40151dc8df3281d)) + ## [1.4.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.3.0...v1.4.0) (2021-03-23) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index b883c238cee..4354fbdd64b 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.0", + "version": "1.4.1", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 31b7a9171af..c78158f7480 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.0" + "@google-cloud/assured-workloads": "^1.4.1" }, "devDependencies": { "c8": "^7.3.0", From 9921757214c2889e10ea22502e212f4f90ce864c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:58:30 +0200 Subject: [PATCH 036/116] chore(deps): update dependency sinon to v11 (#67) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 4354fbdd64b..05556227567 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -54,7 +54,7 @@ "mocha": "^8.1.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "^3.9.7", "webpack": "^5.0.0", From 8696c27802c5a8ca5003c9edf087a21974156eb3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 20:48:56 +0000 Subject: [PATCH 037/116] fix: GoogleAdsError missing using generator version after 1.3.0 (#68) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../src/v1beta1/assured_workloads_service_client.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 0eb16ec4841..2f918efcd5c 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -143,6 +143,8 @@ export class AssuredWorkloadsServiceClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); From fa173ee7b26f384552679e95a30fe57c9f8f7f58 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 18:42:11 -0400 Subject: [PATCH 038/116] chore: release 1.4.2 (#69) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index a5b5a8fa7a5..8758bb6532c 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.2](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.1...v1.4.2) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#68](https://www.github.com/googleapis/nodejs-assured-workloads/issues/68)) ([551c5b3](https://www.github.com/googleapis/nodejs-assured-workloads/commit/551c5b3db4314f6bcc7fe385651cde1269722b85)) + ### [1.4.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.0...v1.4.1) (2021-05-12) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 05556227567..778dace0b21 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.1", + "version": "1.4.2", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index c78158f7480..d4a471dbe6a 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.1" + "@google-cloud/assured-workloads": "^1.4.2" }, "devDependencies": { "c8": "^7.3.0", From 25d960b561a8f92ef2572c0b8a0464e9a1713873 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:22:51 +0000 Subject: [PATCH 039/116] fix: make request optional in all cases (#75) ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- .../assured_workloads_service_client.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 2f918efcd5c..e7e9eaaafc1 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -343,7 +343,7 @@ export class AssuredWorkloadsServiceClient { // -- Service calls -- // ------------------- updateWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, options?: CallOptions ): Promise< [ @@ -402,7 +402,7 @@ export class AssuredWorkloadsServiceClient { * const [response] = await client.updateWorkload(request); */ updateWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, optionsOrCallback?: | CallOptions | Callback< @@ -448,7 +448,7 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.updateWorkload(request, options, callback); } deleteWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, options?: CallOptions ): Promise< [ @@ -506,7 +506,7 @@ export class AssuredWorkloadsServiceClient { * const [response] = await client.deleteWorkload(request); */ deleteWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, optionsOrCallback?: | CallOptions | Callback< @@ -552,7 +552,7 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.deleteWorkload(request, options, callback); } getWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, options?: CallOptions ): Promise< [ @@ -607,7 +607,7 @@ export class AssuredWorkloadsServiceClient { * const [response] = await client.getWorkload(request); */ getWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, optionsOrCallback?: | CallOptions | Callback< @@ -654,7 +654,7 @@ export class AssuredWorkloadsServiceClient { } createWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, options?: CallOptions ): Promise< [ @@ -718,7 +718,7 @@ export class AssuredWorkloadsServiceClient { * const [response] = await operation.promise(); */ createWorkload( - request: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, optionsOrCallback?: | CallOptions | Callback< @@ -803,7 +803,7 @@ export class AssuredWorkloadsServiceClient { >; } listWorkloads( - request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, options?: CallOptions ): Promise< [ @@ -864,7 +864,7 @@ export class AssuredWorkloadsServiceClient { * for more details and examples. */ listWorkloads( - request: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From dbba745047a8278e06278347431c61d0ac0f6b08 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:46:50 +0000 Subject: [PATCH 040/116] chore: release 1.4.3 (#76) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.3](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.2...v1.4.3) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#75](https://www.github.com/googleapis/nodejs-assured-workloads/issues/75)) ([eaf5667](https://www.github.com/googleapis/nodejs-assured-workloads/commit/eaf5667b16d355eff487409951fd26b21d4448c3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 8758bb6532c..8a7d76cb9a0 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.3](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.2...v1.4.3) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#75](https://www.github.com/googleapis/nodejs-assured-workloads/issues/75)) ([eaf5667](https://www.github.com/googleapis/nodejs-assured-workloads/commit/eaf5667b16d355eff487409951fd26b21d4448c3)) + ### [1.4.2](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.1...v1.4.2) (2021-05-25) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 778dace0b21..56f1fb5517b 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.2", + "version": "1.4.3", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index d4a471dbe6a..3767492becc 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.2" + "@google-cloud/assured-workloads": "^1.4.3" }, "devDependencies": { "c8": "^7.3.0", From 01ab385b07bfe29b1a7815c0ed5b76324c130936 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 1 Jul 2021 12:01:04 -0400 Subject: [PATCH 041/116] fix(deps): require google-gax v2.17.0 (#81) --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 56f1fb5517b..d6e5a00c11b 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.3", From 4627060710c4c0872e219661f15589a6eb21267f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:06:09 +0000 Subject: [PATCH 042/116] chore: release 1.4.4 (#83) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.4](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.3...v1.4.4) (2021-07-01) ### Bug Fixes * **deps:** require google-gax v2.17.0 ([#81](https://www.github.com/googleapis/nodejs-assured-workloads/issues/81)) ([526dcb0](https://www.github.com/googleapis/nodejs-assured-workloads/commit/526dcb0b5cda536772f5821519bb25dea8d9e377)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 8a7d76cb9a0..930afc9a3c0 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.4](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.3...v1.4.4) (2021-07-01) + + +### Bug Fixes + +* **deps:** require google-gax v2.17.0 ([#81](https://www.github.com/googleapis/nodejs-assured-workloads/issues/81)) ([526dcb0](https://www.github.com/googleapis/nodejs-assured-workloads/commit/526dcb0b5cda536772f5821519bb25dea8d9e377)) + ### [1.4.3](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.2...v1.4.3) (2021-06-22) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index d6e5a00c11b..c5eebf50ebc 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.3", + "version": "1.4.4", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 3767492becc..118904d9147 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.3" + "@google-cloud/assured-workloads": "^1.4.4" }, "devDependencies": { "c8": "^7.3.0", From 69769f89640368c8152806f647d840b11fe9259f Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:48:19 -0400 Subject: [PATCH 043/116] fix(deps): google-gax v2.17.1 (#84) --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index c5eebf50ebc..64d57e81303 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.3", From 4c96819d81fab1426ac672a9d883bcee29544b5f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:28:40 +0000 Subject: [PATCH 044/116] chore: release 1.4.5 (#85) :robot: I have created a release \*beep\* \*boop\* --- ### [1.4.5](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.4...v1.4.5) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#84](https://www.github.com/googleapis/nodejs-assured-workloads/issues/84)) ([ea29dcf](https://www.github.com/googleapis/nodejs-assured-workloads/commit/ea29dcfd1c01935bc9023656f6c4c9803f18ee7b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 930afc9a3c0..f790e4278c1 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.5](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.4...v1.4.5) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#84](https://www.github.com/googleapis/nodejs-assured-workloads/issues/84)) ([ea29dcf](https://www.github.com/googleapis/nodejs-assured-workloads/commit/ea29dcfd1c01935bc9023656f6c4c9803f18ee7b)) + ### [1.4.4](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.3...v1.4.4) (2021-07-01) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 64d57e81303..3a2083756fe 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.4", + "version": "1.4.5", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 118904d9147..9897bfa9804 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.4" + "@google-cloud/assured-workloads": "^1.4.5" }, "devDependencies": { "c8": "^7.3.0", From cba714c2e8e464195a0006c466e72aede41826f2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:10:31 +0000 Subject: [PATCH 045/116] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#86) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1beta1/assured_workloads_service_client.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index e7e9eaaafc1..e7db151e8eb 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; export class AssuredWorkloadsServiceClient { private _terminated = false; private _opts: ClientOptions; + private _providedCustomServicePath: boolean; private _gaxModule: typeof gax | typeof gax.fallback; private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; private _protos: {}; @@ -60,6 +61,7 @@ export class AssuredWorkloadsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class AssuredWorkloadsServiceClient { .constructor as typeof AssuredWorkloadsServiceClient; const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; const fallback = @@ -217,6 +222,9 @@ export class AssuredWorkloadsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; } /** @@ -246,7 +254,8 @@ export class AssuredWorkloadsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.assuredworkloads.v1beta1 .AssuredWorkloadsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From ad4bf0835266e8444506f19ab42e0739b6f19013 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 13:02:33 -0700 Subject: [PATCH 046/116] chore: release 1.4.6 (#87) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index f790e4278c1..d8b992cf4f7 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.4.6](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.5...v1.4.6) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#86](https://www.github.com/googleapis/nodejs-assured-workloads/issues/86)) ([b68bfe0](https://www.github.com/googleapis/nodejs-assured-workloads/commit/b68bfe00fdaec8c68028a1aa0ff5074da324dbd7)) + ### [1.4.5](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.4...v1.4.5) (2021-07-12) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 3a2083756fe..cf0e9f0d670 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.5", + "version": "1.4.6", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 9897bfa9804..40c5d48011c 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.5" + "@google-cloud/assured-workloads": "^1.4.6" }, "devDependencies": { "c8": "^7.3.0", From 5ef008519488603c84bd1e4f30ab69cdf6ae9ef3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 09:48:13 -0500 Subject: [PATCH 047/116] feat: Add EU Regions And Support compliance regime (#90) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add EU Regions And Support compliance regime Committer: @guisin PiperOrigin-RevId: 387369361 Source-Link: https://github.com/googleapis/googleapis/commit/fa5dd8d9ccb7f0da1168481372b3994be70fccc1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4c0c8f412b2989dd21188210a211e6c59743ed3b * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1beta1/assuredworkloads_v1beta1.proto | 3 +++ .../google-cloud-assuredworkloads/protos/protos.d.ts | 3 ++- .../google-cloud-assuredworkloads/protos/protos.js | 12 ++++++++++++ .../google-cloud-assuredworkloads/protos/protos.json | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index 5467fbad1d0..d12149b1562 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -329,6 +329,9 @@ message Workload { // Health Information Trust Alliance controls HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; } // Optional. The resource name of the workload. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index cb6a8a30281..50555d11a2b 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1589,7 +1589,8 @@ export namespace google { FEDRAMP_MODERATE = 4, US_REGIONAL_ACCESS = 5, HIPAA = 6, - HITRUST = 7 + HITRUST = 7, + EU_REGIONS_AND_SUPPORT = 8 } } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 52fb76874dd..db698dbcc79 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -2002,6 +2002,7 @@ case 5: case 6: case 7: + case 8: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2140,6 +2141,10 @@ case 7: message.complianceRegime = 7; break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -3778,6 +3783,7 @@ * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value * @property {number} HIPAA=6 HIPAA value * @property {number} HITRUST=7 HITRUST value + * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3789,6 +3795,7 @@ values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; values[valuesById[6] = "HIPAA"] = 6; values[valuesById[7] = "HITRUST"] = 7; + values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; return values; })(); @@ -3990,6 +3997,7 @@ case 5: case 6: case 7: + case 8: break; } return null; @@ -4049,6 +4057,10 @@ case 7: message.complianceRegime = 7; break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; } return message; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index b369ea80e19..ae6b69aacf9 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -487,7 +487,8 @@ "FEDRAMP_MODERATE": 4, "US_REGIONAL_ACCESS": 5, "HIPAA": 6, - "HITRUST": 7 + "HITRUST": 7, + "EU_REGIONS_AND_SUPPORT": 8 } } } From 9a27405080d301f2d3f8b79620b999c864857a87 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 10:29:18 -0500 Subject: [PATCH 048/116] chore: release 1.5.0 (#91) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index d8b992cf4f7..e792c2fbb6c 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.6...v1.5.0) (2021-07-30) + + +### Features + +* Add EU Regions And Support compliance regime ([#90](https://www.github.com/googleapis/nodejs-assured-workloads/issues/90)) ([c3d9957](https://www.github.com/googleapis/nodejs-assured-workloads/commit/c3d9957097e9fe638885fb42fd205b82fb62e02d)) + ### [1.4.6](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.5...v1.4.6) (2021-07-16) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index cf0e9f0d670..c8515ca5f84 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.4.6", + "version": "1.5.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 40c5d48011c..fd4bfa4e1c7 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.4.6" + "@google-cloud/assured-workloads": "^1.5.0" }, "devDependencies": { "c8": "^7.3.0", From 51e485bfae762678373cf2969e520276dbb47fbc Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:06:38 -0400 Subject: [PATCH 049/116] chore(nodejs): update client ref docs link in metadata (#94) --- packages/google-cloud-assuredworkloads/.repo-metadata.json | 2 +- packages/google-cloud-assuredworkloads/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index 704a4092d02..75c0c41ad6d 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -1,5 +1,5 @@ { - "client_documentation": "https://googleapis.dev/nodejs/assuredworkloads/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest", "api_id": "assuredworkloads.googleapis.com", "distribution_name": "@google-cloud/assured-workloads", "release_level": "beta", diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 3a3cc3b2bfb..7fc4d459f2e 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -150,7 +150,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-assured-workloads/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/assuredworkloads/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest [product-docs]: https://cloud.google.com/assured-workloads/docs [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 48a994c38ca621ee31c62a0efb0cc99bed5b4750 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 11 Aug 2021 11:08:33 -0400 Subject: [PATCH 050/116] fix(build): migrate to using main branch (#96) --- packages/google-cloud-assuredworkloads/README.md | 16 ++++++++-------- .../samples/README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 7fc4d459f2e..bc4ed258b1f 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) @@ -15,7 +15,7 @@ Assured Workloads client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-assured-workloads/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-assured-workloads/blob/main/CHANGELOG.md). * [Assured Workloads for Government Node.js Client API Reference][client-docs] * [Assured Workloads for Government Documentation][product-docs] @@ -84,11 +84,11 @@ listWorkloads(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -136,19 +136,19 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-assured-workloads/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-assured-workloads/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) are generated from a central template. To edit one of these files, make an edit -to its template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). +to its templates in +[directory](https://github.com/googleapis/synthtool). ## License Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-assured-workloads/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-assured-workloads/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest [product-docs]: https://cloud.google.com/assured-workloads/docs diff --git a/packages/google-cloud-assuredworkloads/samples/README.md b/packages/google-cloud-assuredworkloads/samples/README.md index 69b9214fc73..4e2938f7b6b 100644 --- a/packages/google-cloud-assuredworkloads/samples/README.md +++ b/packages/google-cloud-assuredworkloads/samples/README.md @@ -31,7 +31,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/main/samples/quickstart.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From 2b0873cac837622142e6c7b7e2086743fa19a7e4 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Aug 2021 15:18:18 +0000 Subject: [PATCH 051/116] chore: release 1.5.1 (#97) :robot: I have created a release \*beep\* \*boop\* --- ### [1.5.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.0...v1.5.1) (2021-08-11) ### Bug Fixes * **build:** migrate to using main branch ([#96](https://www.github.com/googleapis/nodejs-assured-workloads/issues/96)) ([371e12d](https://www.github.com/googleapis/nodejs-assured-workloads/commit/371e12dbc5c0e439eca22b4115c54352ac5b2037)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index e792c2fbb6c..b204c44fe43 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.5.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.0...v1.5.1) (2021-08-11) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#96](https://www.github.com/googleapis/nodejs-assured-workloads/issues/96)) ([371e12d](https://www.github.com/googleapis/nodejs-assured-workloads/commit/371e12dbc5c0e439eca22b4115c54352ac5b2037)) + ## [1.5.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.4.6...v1.5.0) (2021-07-30) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index c8515ca5f84..1ed7690bc63 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.5.0", + "version": "1.5.1", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index fd4bfa4e1c7..f7e913111ac 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.5.0" + "@google-cloud/assured-workloads": "^1.5.1" }, "devDependencies": { "c8": "^7.3.0", From 811224c023b4b68e8073ceaa97dbebe19b91ea10 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:44:26 -0400 Subject: [PATCH 052/116] fix(deps): google-gax v2.24.1 (#98) --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 1ed7690bc63..7c9c156a350 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.3", From ad7028c45ea90cab0b38465e36366af6cd8fd0ee Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:14:34 +0000 Subject: [PATCH 053/116] chore: release 1.5.2 (#99) :robot: I have created a release \*beep\* \*boop\* --- ### [1.5.2](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.1...v1.5.2) (2021-08-17) ### Bug Fixes * **deps:** google-gax v2.24.1 ([#98](https://www.github.com/googleapis/nodejs-assured-workloads/issues/98)) ([66c0ace](https://www.github.com/googleapis/nodejs-assured-workloads/commit/66c0ace695292bb9d9769ff3132e7cbf8eae865d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index b204c44fe43..ba25cf48e8d 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.5.2](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.1...v1.5.2) (2021-08-17) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#98](https://www.github.com/googleapis/nodejs-assured-workloads/issues/98)) ([66c0ace](https://www.github.com/googleapis/nodejs-assured-workloads/commit/66c0ace695292bb9d9769ff3132e7cbf8eae865d)) + ### [1.5.1](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.0...v1.5.1) (2021-08-11) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 7c9c156a350..b1ff41811f3 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.5.1", + "version": "1.5.2", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index f7e913111ac..7c22ccbd35d 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.5.1" + "@google-cloud/assured-workloads": "^1.5.2" }, "devDependencies": { "c8": "^7.3.0", From 33af2e4823d7676c8096bbd19fdcce859d4c487d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:32:23 +0000 Subject: [PATCH 054/116] feat: turns on self-signed JWT feature flag (#100) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1beta1/assured_workloads_service_client.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index e7db151e8eb..e3bfc44a926 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -134,6 +134,12 @@ export class AssuredWorkloadsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + // Set the default scopes in auth client if needed. if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; @@ -1147,6 +1153,7 @@ export class AssuredWorkloadsServiceClient { return this.assuredWorkloadsServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From 3c2b948304d5b44d23d8d9641af6c21309b7a21d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:56:19 +0000 Subject: [PATCH 055/116] chore: release 1.6.0 (#101) :robot: I have created a release \*beep\* \*boop\* --- ## [1.6.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.2...v1.6.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#100](https://www.github.com/googleapis/nodejs-assured-workloads/issues/100)) ([5e0e688](https://www.github.com/googleapis/nodejs-assured-workloads/commit/5e0e6882a0f77a59da866fb25f9fd115836c6b76)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index ba25cf48e8d..3713fb812a3 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.6.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.2...v1.6.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#100](https://www.github.com/googleapis/nodejs-assured-workloads/issues/100)) ([5e0e688](https://www.github.com/googleapis/nodejs-assured-workloads/commit/5e0e6882a0f77a59da866fb25f9fd115836c6b76)) + ### [1.5.2](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.1...v1.5.2) (2021-08-17) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index b1ff41811f3..2b1ed8fb067 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.5.2", + "version": "1.6.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 7c22ccbd35d..3d019d67219 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.5.2" + "@google-cloud/assured-workloads": "^1.6.0" }, "devDependencies": { "c8": "^7.3.0", From 50aad6198de4239df28b3c3a20769c92bc2d20a0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 27 Aug 2021 21:30:47 +0000 Subject: [PATCH 056/116] feat: Add Canada Regions And Support compliance regime (#103) - [ ] Regenerate this pull request now. fix: ResourceType CONSUMER_PROJECT is deprecated feat: ResourceType CONSUMER_FOLDER and KEYRING are added feat: display_name is added to ResourceSettings fix: billing_account is now optional in Workload feat: resource_settings is added to CreateWorkloadOperationMetadata Committer: @ketanbshah PiperOrigin-RevId: 393142547 Source-Link: https://github.com/googleapis/googleapis/commit/4b6bb3dede843b93353dbebfee4d2758aeede96f Source-Link: https://github.com/googleapis/googleapis-gen/commit/f70128ac218486074082e7ffcbb2546afe866db9 --- .../v1beta1/assuredworkloads_v1beta1.proto | 37 +++++-- .../protos/protos.d.ts | 19 +++- .../protos/protos.js | 102 ++++++++++++++++++ .../protos/protos.json | 19 +++- 4 files changed, 162 insertions(+), 15 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index d12149b1562..d97441d6318 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -208,11 +208,18 @@ message Workload { // Unknown resource type. RESOURCE_TYPE_UNSPECIFIED = 0; - // Consumer project. - CONSUMER_PROJECT = 1; + // Deprecated. Existing workloads will continue to support this, but new + // CreateWorkloadRequests should not specify this as an input value. + CONSUMER_PROJECT = 1 [deprecated = true]; + + // Consumer Folder. + CONSUMER_FOLDER = 4; // Consumer project containing encryption keys. ENCRYPTION_KEYS_PROJECT = 2; + + // Keyring resource that hosts encryption keys. + KEYRING = 3; } // Resource identifier. @@ -302,6 +309,11 @@ message Workload { // correspond the id to the right project type (CONSUMER_PROJECT or // ENCRYPTION_KEYS_PROJECT) ResourceInfo.ResourceType resource_type = 2; + + // User-assigned resource display name. + // If not empty it will be used to create a resource with the specified + // name. + string display_name = 3; } // Supported Compliance Regimes. @@ -332,6 +344,9 @@ message Workload { // Assured Workloads For EU Regions and Support controls EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; } // Optional. The resource name of the workload. @@ -367,7 +382,7 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. The billing account used for the resources which are + // Input only. The billing account used for the resources which are // direct children of workload. This billing account is initially associated // with the resources created as part of Workload creation. // After the initial creation of these resources, the customer can change @@ -375,10 +390,7 @@ message Workload { // The resource name has the form // `billingAccounts/{billing_account_id}`. For example, // `billingAccounts/012345-567890-ABCDEF`. - string billing_account = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; + string billing_account = 6 [(google.api.field_behavior) = INPUT_ONLY]; // Settings specific to the selected [compliance_regime] oneof compliance_regime_settings { @@ -423,12 +435,11 @@ message Workload { map labels = 10 [(google.api.field_behavior) = OPTIONAL]; // Input only. The parent resource for the resources managed by this Assured Workload. May - // be either an organization or a folder. Must be the same or a child of the + // be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the - // Workload parent. - // Formats: + // parent organization. + // Format: // folders/{folder_id} - // organizations/{organization_id} string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; // Input only. Settings used to create a CMEK crypto key. When set a project with a KMS @@ -456,4 +467,8 @@ message CreateWorkloadOperationMetadata { // Optional. Compliance controls that should be applied to the resources managed by // the workload. Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource properties in the input that are used for creating/customizing + // workload resources. + repeated Workload.ResourceSettings resource_settings = 5 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 50555d11a2b..01b308bb83c 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1024,7 +1024,9 @@ export namespace google { enum ResourceType { RESOURCE_TYPE_UNSPECIFIED = 0, CONSUMER_PROJECT = 1, - ENCRYPTION_KEYS_PROJECT = 2 + CONSUMER_FOLDER = 4, + ENCRYPTION_KEYS_PROJECT = 2, + KEYRING = 3 } } @@ -1492,6 +1494,9 @@ export namespace google { /** ResourceSettings resourceType */ resourceType?: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null); + + /** ResourceSettings displayName */ + displayName?: (string|null); } /** Represents a ResourceSettings. */ @@ -1509,6 +1514,9 @@ export namespace google { /** ResourceSettings resourceType. */ public resourceType: (google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType); + /** ResourceSettings displayName. */ + public displayName: string; + /** * Creates a new ResourceSettings instance using the specified properties. * @param [properties] Properties to set @@ -1590,7 +1598,8 @@ export namespace google { US_REGIONAL_ACCESS = 5, HIPAA = 6, HITRUST = 7, - EU_REGIONS_AND_SUPPORT = 8 + EU_REGIONS_AND_SUPPORT = 8, + CA_REGIONS_AND_SUPPORT = 9 } } @@ -1608,6 +1617,9 @@ export namespace google { /** CreateWorkloadOperationMetadata complianceRegime */ complianceRegime?: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null); + + /** CreateWorkloadOperationMetadata resourceSettings */ + resourceSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]|null); } /** Represents a CreateWorkloadOperationMetadata. */ @@ -1631,6 +1643,9 @@ export namespace google { /** CreateWorkloadOperationMetadata complianceRegime. */ public complianceRegime: (google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime); + /** CreateWorkloadOperationMetadata resourceSettings. */ + public resourceSettings: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]; + /** * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index db698dbcc79..7f2bb0a6fee 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -2003,6 +2003,7 @@ case 6: case 7: case 8: + case 9: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2145,6 +2146,10 @@ case 8: message.complianceRegime = 8; break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -2450,7 +2455,9 @@ return "resourceType: enum value expected"; case 0: case 1: + case 4: case 2: + case 3: break; } return null; @@ -2486,10 +2493,18 @@ case 1: message.resourceType = 1; break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; case "ENCRYPTION_KEYS_PROJECT": case 2: message.resourceType = 2; break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; } return message; }; @@ -2542,13 +2557,17 @@ * @enum {number} * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value + * @property {number} CONSUMER_FOLDER=4 CONSUMER_FOLDER value * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value + * @property {number} KEYRING=3 KEYRING value */ ResourceInfo.ResourceType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "CONSUMER_PROJECT"] = 1; + values[valuesById[4] = "CONSUMER_FOLDER"] = 4; values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; + values[valuesById[3] = "KEYRING"] = 3; return values; })(); @@ -3551,6 +3570,7 @@ * @interface IResourceSettings * @property {string|null} [resourceId] ResourceSettings resourceId * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceSettings resourceType + * @property {string|null} [displayName] ResourceSettings displayName */ /** @@ -3584,6 +3604,14 @@ */ ResourceSettings.prototype.resourceType = 0; + /** + * ResourceSettings displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.displayName = ""; + /** * Creates a new ResourceSettings instance using the specified properties. * @function create @@ -3612,6 +3640,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceId); if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); return writer; }; @@ -3652,6 +3682,9 @@ case 2: message.resourceType = reader.int32(); break; + case 3: + message.displayName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -3696,9 +3729,14 @@ return "resourceType: enum value expected"; case 0: case 1: + case 4: case 2: + case 3: break; } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; return null; }; @@ -3725,11 +3763,21 @@ case 1: message.resourceType = 1; break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; case "ENCRYPTION_KEYS_PROJECT": case 2: message.resourceType = 2; break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; } + if (object.displayName != null) + message.displayName = String(object.displayName); return message; }; @@ -3749,11 +3797,14 @@ if (options.defaults) { object.resourceId = ""; object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; } if (message.resourceId != null && message.hasOwnProperty("resourceId")) object.resourceId = message.resourceId; if (message.resourceType != null && message.hasOwnProperty("resourceType")) object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; return object; }; @@ -3784,6 +3835,7 @@ * @property {number} HIPAA=6 HIPAA value * @property {number} HITRUST=7 HITRUST value * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value + * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3796,6 +3848,7 @@ values[valuesById[6] = "HIPAA"] = 6; values[valuesById[7] = "HITRUST"] = 7; values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; + values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; return values; })(); @@ -3812,6 +3865,7 @@ * @property {string|null} [displayName] CreateWorkloadOperationMetadata displayName * @property {string|null} [parent] CreateWorkloadOperationMetadata parent * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] CreateWorkloadOperationMetadata complianceRegime + * @property {Array.|null} [resourceSettings] CreateWorkloadOperationMetadata resourceSettings */ /** @@ -3823,6 +3877,7 @@ * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set */ function CreateWorkloadOperationMetadata(properties) { + this.resourceSettings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3861,6 +3916,14 @@ */ CreateWorkloadOperationMetadata.prototype.complianceRegime = 0; + /** + * CreateWorkloadOperationMetadata resourceSettings. + * @member {Array.} resourceSettings + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.resourceSettings = $util.emptyArray; + /** * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. * @function create @@ -3893,6 +3956,9 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + if (message.resourceSettings != null && message.resourceSettings.length) + for (var i = 0; i < message.resourceSettings.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -3939,6 +4005,11 @@ case 4: message.complianceRegime = reader.int32(); break; + case 5: + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -3998,8 +4069,18 @@ case 6: case 7: case 8: + case 9: break; } + if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { + if (!Array.isArray(message.resourceSettings)) + return "resourceSettings: array expected"; + for (var i = 0; i < message.resourceSettings.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); + if (error) + return "resourceSettings." + error; + } + } return null; }; @@ -4061,6 +4142,20 @@ case 8: message.complianceRegime = 8; break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; + } + if (object.resourceSettings) { + if (!Array.isArray(object.resourceSettings)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: array expected"); + message.resourceSettings = []; + for (var i = 0; i < object.resourceSettings.length; ++i) { + if (typeof object.resourceSettings[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: object expected"); + message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); + } } return message; }; @@ -4078,6 +4173,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.resourceSettings = []; if (options.defaults) { object.createTime = null; object.displayName = ""; @@ -4092,6 +4189,11 @@ object.parent = message.parent; if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + if (message.resourceSettings && message.resourceSettings.length) { + object.resourceSettings = []; + for (var j = 0; j < message.resourceSettings.length; ++j) + object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); + } return object; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index ae6b69aacf9..835239d6545 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -387,7 +387,9 @@ "values": { "RESOURCE_TYPE_UNSPECIFIED": 0, "CONSUMER_PROJECT": 1, - "ENCRYPTION_KEYS_PROJECT": 2 + "CONSUMER_FOLDER": 4, + "ENCRYPTION_KEYS_PROJECT": 2, + "KEYRING": 3 } } } @@ -475,6 +477,10 @@ "resourceType": { "type": "ResourceInfo.ResourceType", "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 } } }, @@ -488,7 +494,8 @@ "US_REGIONAL_ACCESS": 5, "HIPAA": 6, "HITRUST": 7, - "EU_REGIONS_AND_SUPPORT": 8 + "EU_REGIONS_AND_SUPPORT": 8, + "CA_REGIONS_AND_SUPPORT": 9 } } } @@ -522,6 +529,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "resourceSettings": { + "rule": "repeated", + "type": "Workload.ResourceSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } } From 050748d31b55e0b5d32d45b84a823bc95a830fec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Aug 2021 21:46:50 +0000 Subject: [PATCH 057/116] chore: release 1.7.0 (#104) :robot: I have created a release \*beep\* \*boop\* --- ## [1.7.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.6.0...v1.7.0) (2021-08-27) ### Features * Add Canada Regions And Support compliance regime ([#103](https://www.github.com/googleapis/nodejs-assured-workloads/issues/103)) ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) * display_name is added to ResourceSettings ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) * resource_settings is added to CreateWorkloadOperationMetadata ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) * ResourceType CONSUMER_FOLDER and KEYRING are added ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) ### Bug Fixes * billing_account is now optional in Workload ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) * ResourceType CONSUMER_PROJECT is deprecated ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- .../google-cloud-assuredworkloads/CHANGELOG.md | 16 ++++++++++++++++ .../google-cloud-assuredworkloads/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 3713fb812a3..e85a5d19462 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [1.7.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.6.0...v1.7.0) (2021-08-27) + + +### Features + +* Add Canada Regions And Support compliance regime ([#103](https://www.github.com/googleapis/nodejs-assured-workloads/issues/103)) ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) +* display_name is added to ResourceSettings ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) +* resource_settings is added to CreateWorkloadOperationMetadata ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) +* ResourceType CONSUMER_FOLDER and KEYRING are added ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) + + +### Bug Fixes + +* billing_account is now optional in Workload ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) +* ResourceType CONSUMER_PROJECT is deprecated ([49365ee](https://www.github.com/googleapis/nodejs-assured-workloads/commit/49365eea8ac9701957ddb508a52686e96e876bf1)) + ## [1.6.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.5.2...v1.6.0) (2021-08-23) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 2b1ed8fb067..e411a360180 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.6.0", + "version": "1.7.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 3d019d67219..28bda45f001 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.6.0" + "@google-cloud/assured-workloads": "^1.7.0" }, "devDependencies": { "c8": "^7.3.0", From 9ae948691259aa6682ce984df141b8775182bbd5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 02:52:13 +0000 Subject: [PATCH 058/116] feat: assuredworkloads v1 public protos (#108) - [ ] Regenerate this pull request now. Committer: @alexander-fenster PiperOrigin-RevId: 397207401 Source-Link: https://github.com/googleapis/googleapis/commit/b201fa03788bce7e424df847152ba1a70fd8edb3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/65e26e30f3865b90a79678d0ff46c97cf053ffe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjVlMjZlMzBmMzg2NWI5MGE3OTY3OGQwZmY0NmM5N2NmMDUzZmZlNyJ9 --- .../v1/assuredworkloads.proto | 386 ++ .../protos/protos.d.ts | 1301 +++++++ .../protos/protos.js | 3184 +++++++++++++++++ .../protos/protos.json | 429 +++ .../src/index.ts | 5 +- .../v1/assured_workloads_service_client.ts | 1155 ++++++ ...sured_workloads_service_client_config.json | 51 + .../assured_workloads_service_proto_list.json | 3 + .../src/v1/gapic_metadata.json | 77 + .../src/v1/index.ts | 19 + .../gapic_assured_workloads_service_v1.ts | 1257 +++++++ 11 files changed, 7865 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto create mode 100644 packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts create mode 100644 packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json create mode 100644 packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_proto_list.json create mode 100644 packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-assuredworkloads/src/v1/index.ts create mode 100644 packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto new file mode 100644 index 00000000000..75272749511 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -0,0 +1,386 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.assuredworkloads.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1;assuredworkloads"; +option java_multiple_files = true; +option java_outer_classname = "AssuredworkloadsProto"; +option java_package = "com.google.cloud.assuredworkloads.v1"; +option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1"; +option ruby_package = "Google::Cloud::AssuredWorkloads::V1"; +option (google.api.resource_definition) = { + type: "assuredworkloads.googleapis.com/Location" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service to manage AssuredWorkloads. +service AssuredWorkloadsService { + option (google.api.default_host) = "assuredworkloads.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates Assured Workload. + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/workloads" + body: "workload" + }; + option (google.api.method_signature) = "parent,workload"; + option (google.longrunning.operation_info) = { + response_type: "Workload" + metadata_type: "CreateWorkloadOperationMetadata" + }; + } + + // Updates an existing workload. + // Currently allows updating of workload display_name and labels. + // For force updates don't set etag field in the Workload. + // Only one update operation per workload can be in progress. + rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { + option (google.api.http) = { + patch: "/v1/{workload.name=organizations/*/locations/*/workloads/*}" + body: "workload" + }; + option (google.api.method_signature) = "workload,update_mask"; + } + + // Deletes the workload. Make sure that workload's direct children are already + // in a deleted state, otherwise the request will fail with a + // FAILED_PRECONDITION error. + rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets Assured Workload associated with a CRM Node + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Assured Workloads under a CRM Node. + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for creating a workload. +message CreateWorkloadRequest { + // Required. The resource name of the new Workload's parent. + // Must be of the form `organizations/{org_id}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Required. Assured Workload to create + Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value + // provided for the identifier will add a label to the workload and contained + // projects with the identifier as the value. + string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for Updating a workload. +message UpdateWorkloadRequest { + // Required. The workload to update. + // The workload’s `name` field is used to identify the workload to be updated. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for deleting a Workload. +message DeleteWorkloadRequest { + // Required. The `name` field is used to identify the workload. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Optional. The etag of the workload. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for fetching a workload. +message GetWorkloadRequest { + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; +} + +// Request for fetching workloads in an organization. +message ListWorkloadsRequest { + // Required. Parent Resource to list workloads from. + // Must be of the form `organizations/{org_id}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token returned from previous request. Page token contains context from + // previous request. Page token needs to be passed in the second and following + // requests. + string page_token = 3; + + // A custom filter for filtering by properties of a workload. At this time, + // only filtering by labels is supported. + string filter = 4; +} + +// Response of ListWorkloads endpoint. +message ListWorkloadsResponse { + // List of Workloads under a given parent. + repeated Workload workloads = 1; + + // The next page token. Return empty if reached the last page. + string next_page_token = 2; +} + +// An Workload object for managing highly regulated workloads of cloud +// customers. +message Workload { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}" + }; + + // Represent the resources that are children of this Workload. + message ResourceInfo { + // The type of resource. + enum ResourceType { + // Unknown resource type. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Consumer project. + CONSUMER_PROJECT = 1; + + // Consumer project containing encryption keys. + ENCRYPTION_KEYS_PROJECT = 2; + + // Keyring resource that hosts encryption keys. + KEYRING = 3; + } + + // Resource identifier. + // For a project this represents project_number. + int64 resource_id = 1; + + // Indicates the type of resource. + ResourceType resource_type = 2; + } + + // Settings specific to the Key Management Service. + message KMSSettings { + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. + google.protobuf.Timestamp next_rotation_time = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. + google.protobuf.Duration rotation_period = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Represent the custom settings for the resources to be created. + message ResourceSettings { + // Resource identifier. + // For a project this represents project_id. If the project is already + // taken, the workload creation will fail. + string resource_id = 1; + + // Indicates the type of resource. This field should be specified to + // correspond the id to the right project type (CONSUMER_PROJECT or + // ENCRYPTION_KEYS_PROJECT) + ResourceInfo.ResourceType resource_type = 2; + + // User-assigned resource display name. + // If not empty it will be used to create a resource with the specified + // name. + string display_name = 3; + } + + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; + } + + // Optional. The resource name of the workload. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload} + // + // Read-only. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The user-assigned display name of the Workload. + // When present it must be between 4 to 30 characters. + // Allowed characters are: lowercase and uppercase letters, numbers, + // hyphen, and spaces. + // + // Example: My Workload + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The resources associated with this workload. + // These resources will be created when creating the workload. + // If any of the projects already exist, the workload creation will fail. + // Always read only. + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Compliance Regime associated with this workload. + ComplianceRegime compliance_regime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. The Workload creation timestamp. + google.protobuf.Timestamp create_time = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. The billing account used for the resources which are + // direct children of workload. This billing account is initially associated + // with the resources created as part of Workload creation. + // After the initial creation of these resources, the customer can change + // the assigned billing account. + // The resource name has the form + // `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF`. + string billing_account = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Optional. ETag of the workload, it is calculated on the basis + // of the Workload contents. It will be used in Update & Delete operations. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels applied to the workload. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. The parent resource for the resources managed by this Assured Workload. May + // be either empty or a folder resource which is a child of the + // Workload parent. If not specified all resources are created under the + // parent organization. + // Format: + // folders/{folder_id} + string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set a project with a KMS + // CMEK key is provisioned. This field is mandatory for a subset of Compliance + // Regimes. + KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Resource properties that are used to customize workload resources. + // These properties (such as custom project id) will be used to create + // workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// Operation metadata to give request details of CreateWorkload. +message CreateWorkloadOperationMetadata { + // Optional. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The display name of the workload. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The parent of the workload. + string parent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 01b308bb83c..db570b5ee9a 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -23,6 +23,1307 @@ export namespace google { /** Namespace assuredworkloads. */ namespace assuredworkloads { + /** Namespace v1. */ + namespace v1 { + + /** Represents an AssuredWorkloadsService */ + class AssuredWorkloadsService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssuredWorkloadsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssuredWorkloadsService; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkload(request: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkloadCallback): void; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @returns Promise + */ + public createWorkload(request: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest): Promise; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkloadCallback): void; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @returns Promise + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest): Promise; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkloadCallback): void; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @returns Promise + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest): Promise; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public getWorkload(request: google.cloud.assuredworkloads.v1.IGetWorkloadRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkloadCallback): void; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @returns Promise + */ + public getWorkload(request: google.cloud.assuredworkloads.v1.IGetWorkloadRequest): Promise; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkloadsResponse + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1.IListWorkloadsRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloadsCallback): void; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @returns Promise + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1.IListWorkloadsRequest): Promise; + } + + namespace AssuredWorkloadsService { + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#createWorkload}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#updateWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#deleteWorkload}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#getWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#listWorkloads}. + * @param error Error, if any + * @param [response] ListWorkloadsResponse + */ + type ListWorkloadsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.ListWorkloadsResponse) => void; + } + + /** Properties of a CreateWorkloadRequest. */ + interface ICreateWorkloadRequest { + + /** CreateWorkloadRequest parent */ + parent?: (string|null); + + /** CreateWorkloadRequest workload */ + workload?: (google.cloud.assuredworkloads.v1.IWorkload|null); + + /** CreateWorkloadRequest externalId */ + externalId?: (string|null); + } + + /** Represents a CreateWorkloadRequest. */ + class CreateWorkloadRequest implements ICreateWorkloadRequest { + + /** + * Constructs a new CreateWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest); + + /** CreateWorkloadRequest parent. */ + public parent: string; + + /** CreateWorkloadRequest workload. */ + public workload?: (google.cloud.assuredworkloads.v1.IWorkload|null); + + /** CreateWorkloadRequest externalId. */ + public externalId: string; + + /** + * Creates a new CreateWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest): google.cloud.assuredworkloads.v1.CreateWorkloadRequest; + + /** + * Encodes the specified CreateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadRequest.verify|verify} messages. + * @param message CreateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadRequest.verify|verify} messages. + * @param message CreateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.CreateWorkloadRequest; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.CreateWorkloadRequest; + + /** + * Verifies a CreateWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.CreateWorkloadRequest; + + /** + * Creates a plain object from a CreateWorkloadRequest message. Also converts values to other types if specified. + * @param message CreateWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.CreateWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateWorkloadRequest. */ + interface IUpdateWorkloadRequest { + + /** UpdateWorkloadRequest workload */ + workload?: (google.cloud.assuredworkloads.v1.IWorkload|null); + + /** UpdateWorkloadRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateWorkloadRequest. */ + class UpdateWorkloadRequest implements IUpdateWorkloadRequest { + + /** + * Constructs a new UpdateWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest); + + /** UpdateWorkloadRequest workload. */ + public workload?: (google.cloud.assuredworkloads.v1.IWorkload|null); + + /** UpdateWorkloadRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest): google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; + + /** + * Encodes the specified UpdateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.verify|verify} messages. + * @param message UpdateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.verify|verify} messages. + * @param message UpdateWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; + + /** + * Verifies an UpdateWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.UpdateWorkloadRequest; + + /** + * Creates a plain object from an UpdateWorkloadRequest message. Also converts values to other types if specified. + * @param message UpdateWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.UpdateWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteWorkloadRequest. */ + interface IDeleteWorkloadRequest { + + /** DeleteWorkloadRequest name */ + name?: (string|null); + + /** DeleteWorkloadRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteWorkloadRequest. */ + class DeleteWorkloadRequest implements IDeleteWorkloadRequest { + + /** + * Constructs a new DeleteWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest); + + /** DeleteWorkloadRequest name. */ + public name: string; + + /** DeleteWorkloadRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest): google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; + + /** + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; + + /** + * Verifies a DeleteWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.DeleteWorkloadRequest; + + /** + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @param message DeleteWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.DeleteWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetWorkloadRequest. */ + interface IGetWorkloadRequest { + + /** GetWorkloadRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkloadRequest. */ + class GetWorkloadRequest implements IGetWorkloadRequest { + + /** + * Constructs a new GetWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IGetWorkloadRequest); + + /** GetWorkloadRequest name. */ + public name: string; + + /** + * Creates a new GetWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IGetWorkloadRequest): google.cloud.assuredworkloads.v1.GetWorkloadRequest; + + /** + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.GetWorkloadRequest; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.GetWorkloadRequest; + + /** + * Verifies a GetWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.GetWorkloadRequest; + + /** + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * @param message GetWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.GetWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListWorkloadsRequest. */ + interface IListWorkloadsRequest { + + /** ListWorkloadsRequest parent */ + parent?: (string|null); + + /** ListWorkloadsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkloadsRequest pageToken */ + pageToken?: (string|null); + + /** ListWorkloadsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListWorkloadsRequest. */ + class ListWorkloadsRequest implements IListWorkloadsRequest { + + /** + * Constructs a new ListWorkloadsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IListWorkloadsRequest); + + /** ListWorkloadsRequest parent. */ + public parent: string; + + /** ListWorkloadsRequest pageSize. */ + public pageSize: number; + + /** ListWorkloadsRequest pageToken. */ + public pageToken: string; + + /** ListWorkloadsRequest filter. */ + public filter: string; + + /** + * Creates a new ListWorkloadsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkloadsRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IListWorkloadsRequest): google.cloud.assuredworkloads.v1.ListWorkloadsRequest; + + /** + * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsRequest.verify|verify} messages. + * @param message ListWorkloadsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IListWorkloadsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsRequest.verify|verify} messages. + * @param message ListWorkloadsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IListWorkloadsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.ListWorkloadsRequest; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.ListWorkloadsRequest; + + /** + * Verifies a ListWorkloadsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkloadsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.ListWorkloadsRequest; + + /** + * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * @param message ListWorkloadsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.ListWorkloadsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkloadsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListWorkloadsResponse. */ + interface IListWorkloadsResponse { + + /** ListWorkloadsResponse workloads */ + workloads?: (google.cloud.assuredworkloads.v1.IWorkload[]|null); + + /** ListWorkloadsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWorkloadsResponse. */ + class ListWorkloadsResponse implements IListWorkloadsResponse { + + /** + * Constructs a new ListWorkloadsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IListWorkloadsResponse); + + /** ListWorkloadsResponse workloads. */ + public workloads: google.cloud.assuredworkloads.v1.IWorkload[]; + + /** ListWorkloadsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWorkloadsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkloadsResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IListWorkloadsResponse): google.cloud.assuredworkloads.v1.ListWorkloadsResponse; + + /** + * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsResponse.verify|verify} messages. + * @param message ListWorkloadsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IListWorkloadsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsResponse.verify|verify} messages. + * @param message ListWorkloadsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IListWorkloadsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.ListWorkloadsResponse; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.ListWorkloadsResponse; + + /** + * Verifies a ListWorkloadsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkloadsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.ListWorkloadsResponse; + + /** + * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * @param message ListWorkloadsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.ListWorkloadsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkloadsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Workload. */ + interface IWorkload { + + /** Workload name */ + name?: (string|null); + + /** Workload displayName */ + displayName?: (string|null); + + /** Workload resources */ + resources?: (google.cloud.assuredworkloads.v1.Workload.IResourceInfo[]|null); + + /** Workload complianceRegime */ + complianceRegime?: (google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|null); + + /** Workload createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Workload billingAccount */ + billingAccount?: (string|null); + + /** Workload etag */ + etag?: (string|null); + + /** Workload labels */ + labels?: ({ [k: string]: string }|null); + + /** Workload provisionedResourcesParent */ + provisionedResourcesParent?: (string|null); + + /** Workload kmsSettings */ + kmsSettings?: (google.cloud.assuredworkloads.v1.Workload.IKMSSettings|null); + + /** Workload resourceSettings */ + resourceSettings?: (google.cloud.assuredworkloads.v1.Workload.IResourceSettings[]|null); + } + + /** Represents a Workload. */ + class Workload implements IWorkload { + + /** + * Constructs a new Workload. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IWorkload); + + /** Workload name. */ + public name: string; + + /** Workload displayName. */ + public displayName: string; + + /** Workload resources. */ + public resources: google.cloud.assuredworkloads.v1.Workload.IResourceInfo[]; + + /** Workload complianceRegime. */ + public complianceRegime: (google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1.Workload.ComplianceRegime); + + /** Workload createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Workload billingAccount. */ + public billingAccount: string; + + /** Workload etag. */ + public etag: string; + + /** Workload labels. */ + public labels: { [k: string]: string }; + + /** Workload provisionedResourcesParent. */ + public provisionedResourcesParent: string; + + /** Workload kmsSettings. */ + public kmsSettings?: (google.cloud.assuredworkloads.v1.Workload.IKMSSettings|null); + + /** Workload resourceSettings. */ + public resourceSettings: google.cloud.assuredworkloads.v1.Workload.IResourceSettings[]; + + /** + * Creates a new Workload instance using the specified properties. + * @param [properties] Properties to set + * @returns Workload instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IWorkload): google.cloud.assuredworkloads.v1.Workload; + + /** + * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.verify|verify} messages. + * @param message Workload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IWorkload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.verify|verify} messages. + * @param message Workload message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IWorkload, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Workload message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Workload; + + /** + * Decodes a Workload message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Workload; + + /** + * Verifies a Workload message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Workload + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Workload; + + /** + * Creates a plain object from a Workload message. Also converts values to other types if specified. + * @param message Workload + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Workload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Workload to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Workload { + + /** Properties of a ResourceInfo. */ + interface IResourceInfo { + + /** ResourceInfo resourceId */ + resourceId?: (number|Long|string|null); + + /** ResourceInfo resourceType */ + resourceType?: (google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|null); + } + + /** Represents a ResourceInfo. */ + class ResourceInfo implements IResourceInfo { + + /** + * Constructs a new ResourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Workload.IResourceInfo); + + /** ResourceInfo resourceId. */ + public resourceId: (number|Long|string); + + /** ResourceInfo resourceType. */ + public resourceType: (google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType); + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceInfo instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Workload.IResourceInfo): google.cloud.assuredworkloads.v1.Workload.ResourceInfo; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Workload.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceInfo.verify|verify} messages. + * @param message ResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Workload.IResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Workload.ResourceInfo; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Workload.ResourceInfo; + + /** + * Verifies a ResourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Workload.ResourceInfo; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @param message ResourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Workload.ResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceInfo { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + CONSUMER_PROJECT = 1, + ENCRYPTION_KEYS_PROJECT = 2, + KEYRING = 3 + } + } + + /** Properties of a KMSSettings. */ + interface IKMSSettings { + + /** KMSSettings nextRotationTime */ + nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** KMSSettings rotationPeriod */ + rotationPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a KMSSettings. */ + class KMSSettings implements IKMSSettings { + + /** + * Constructs a new KMSSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Workload.IKMSSettings); + + /** KMSSettings nextRotationTime. */ + public nextRotationTime?: (google.protobuf.ITimestamp|null); + + /** KMSSettings rotationPeriod. */ + public rotationPeriod?: (google.protobuf.IDuration|null); + + /** + * Creates a new KMSSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns KMSSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Workload.IKMSSettings): google.cloud.assuredworkloads.v1.Workload.KMSSettings; + + /** + * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.KMSSettings.verify|verify} messages. + * @param message KMSSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Workload.IKMSSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.KMSSettings.verify|verify} messages. + * @param message KMSSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Workload.IKMSSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KMSSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Workload.KMSSettings; + + /** + * Decodes a KMSSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Workload.KMSSettings; + + /** + * Verifies a KMSSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KMSSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Workload.KMSSettings; + + /** + * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. + * @param message KMSSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Workload.KMSSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KMSSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceSettings. */ + interface IResourceSettings { + + /** ResourceSettings resourceId */ + resourceId?: (string|null); + + /** ResourceSettings resourceType */ + resourceType?: (google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|null); + + /** ResourceSettings displayName */ + displayName?: (string|null); + } + + /** Represents a ResourceSettings. */ + class ResourceSettings implements IResourceSettings { + + /** + * Constructs a new ResourceSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Workload.IResourceSettings); + + /** ResourceSettings resourceId. */ + public resourceId: string; + + /** ResourceSettings resourceType. */ + public resourceType: (google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|keyof typeof google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType); + + /** ResourceSettings displayName. */ + public displayName: string; + + /** + * Creates a new ResourceSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSettings instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Workload.IResourceSettings): google.cloud.assuredworkloads.v1.Workload.ResourceSettings; + + /** + * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceSettings.verify|verify} messages. + * @param message ResourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Workload.IResourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceSettings.verify|verify} messages. + * @param message ResourceSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Workload.IResourceSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Workload.ResourceSettings; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Workload.ResourceSettings; + + /** + * Verifies a ResourceSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Workload.ResourceSettings; + + /** + * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. + * @param message ResourceSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Workload.ResourceSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** ComplianceRegime enum. */ + enum ComplianceRegime { + COMPLIANCE_REGIME_UNSPECIFIED = 0, + IL4 = 1, + CJIS = 2, + FEDRAMP_HIGH = 3, + FEDRAMP_MODERATE = 4, + US_REGIONAL_ACCESS = 5, + HIPAA = 6, + HITRUST = 7, + EU_REGIONS_AND_SUPPORT = 8, + CA_REGIONS_AND_SUPPORT = 9 + } + } + + /** Properties of a CreateWorkloadOperationMetadata. */ + interface ICreateWorkloadOperationMetadata { + + /** CreateWorkloadOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkloadOperationMetadata displayName */ + displayName?: (string|null); + + /** CreateWorkloadOperationMetadata parent */ + parent?: (string|null); + + /** CreateWorkloadOperationMetadata complianceRegime */ + complianceRegime?: (google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|null); + } + + /** Represents a CreateWorkloadOperationMetadata. */ + class CreateWorkloadOperationMetadata implements ICreateWorkloadOperationMetadata { + + /** + * Constructs a new CreateWorkloadOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata); + + /** CreateWorkloadOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkloadOperationMetadata displayName. */ + public displayName: string; + + /** CreateWorkloadOperationMetadata parent. */ + public parent: string; + + /** CreateWorkloadOperationMetadata complianceRegime. */ + public complianceRegime: (google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|keyof typeof google.cloud.assuredworkloads.v1.Workload.ComplianceRegime); + + /** + * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkloadOperationMetadata instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata): google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @param message CreateWorkloadOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @param message CreateWorkloadOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; + + /** + * Verifies a CreateWorkloadOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkloadOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata; + + /** + * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. + * @param message CreateWorkloadOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkloadOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + /** Namespace v1beta1. */ namespace v1beta1 { diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 7f2bb0a6fee..108e2e76dc7 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -57,6 +57,3190 @@ */ var assuredworkloads = {}; + assuredworkloads.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.assuredworkloads + * @namespace + */ + var v1 = {}; + + v1.AssuredWorkloadsService = (function() { + + /** + * Constructs a new AssuredWorkloadsService service. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents an AssuredWorkloadsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AssuredWorkloadsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssuredWorkloadsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssuredWorkloadsService; + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssuredWorkloadsService} RPC service. Useful where requests and/or responses are streamed. + */ + AssuredWorkloadsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#createWorkload}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef CreateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkloadCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.createWorkload = function createWorkload(request, callback) { + return this.rpcCall(createWorkload, $root.google.cloud.assuredworkloads.v1.CreateWorkloadRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkload" }); + + /** + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#updateWorkload}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef UpdateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.Workload} [response] Workload + */ + + /** + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.updateWorkload = function updateWorkload(request, callback) { + return this.rpcCall(updateWorkload, $root.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest, $root.google.cloud.assuredworkloads.v1.Workload, request, callback); + }, "name", { value: "UpdateWorkload" }); + + /** + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#deleteWorkload}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef DeleteWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkloadCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.deleteWorkload = function deleteWorkload(request, callback) { + return this.rpcCall(deleteWorkload, $root.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWorkload" }); + + /** + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#getWorkload}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef GetWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.Workload} [response] Workload + */ + + /** + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.getWorkload = function getWorkload(request, callback) { + return this.rpcCall(getWorkload, $root.google.cloud.assuredworkloads.v1.GetWorkloadRequest, $root.google.cloud.assuredworkloads.v1.Workload, request, callback); + }, "name", { value: "GetWorkload" }); + + /** + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#listWorkloads}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef ListWorkloadsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} [response] ListWorkloadsResponse + */ + + /** + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloadsCallback} callback Node-style callback called with the error, if any, and ListWorkloadsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.listWorkloads = function listWorkloads(request, callback) { + return this.rpcCall(listWorkloads, $root.google.cloud.assuredworkloads.v1.ListWorkloadsRequest, $root.google.cloud.assuredworkloads.v1.ListWorkloadsResponse, request, callback); + }, "name", { value: "ListWorkloads" }); + + /** + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssuredWorkloadsService; + })(); + + v1.CreateWorkloadRequest = (function() { + + /** + * Properties of a CreateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface ICreateWorkloadRequest + * @property {string|null} [parent] CreateWorkloadRequest parent + * @property {google.cloud.assuredworkloads.v1.IWorkload|null} [workload] CreateWorkloadRequest workload + * @property {string|null} [externalId] CreateWorkloadRequest externalId + */ + + /** + * Constructs a new CreateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a CreateWorkloadRequest. + * @implements ICreateWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest=} [properties] Properties to set + */ + function CreateWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkloadRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.parent = ""; + + /** + * CreateWorkloadRequest workload. + * @member {google.cloud.assuredworkloads.v1.IWorkload|null|undefined} workload + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.workload = null; + + /** + * CreateWorkloadRequest externalId. + * @member {string} externalId + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @instance + */ + CreateWorkloadRequest.prototype.externalId = ""; + + /** + * Creates a new CreateWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadRequest} CreateWorkloadRequest instance + */ + CreateWorkloadRequest.create = function create(properties) { + return new CreateWorkloadRequest(properties); + }; + + /** + * Encodes the specified CreateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest} message CreateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.workload != null && Object.hasOwnProperty.call(message, "workload")) + $root.google.cloud.assuredworkloads.v1.Workload.encode(message.workload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalId != null && Object.hasOwnProperty.call(message, "externalId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalId); + return writer; + }; + + /** + * Encodes the specified CreateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadRequest} message CreateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadRequest} CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.CreateWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); + break; + case 3: + message.externalId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadRequest} CreateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.workload != null && message.hasOwnProperty("workload")) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.verify(message.workload); + if (error) + return "workload." + error; + } + if (message.externalId != null && message.hasOwnProperty("externalId")) + if (!$util.isString(message.externalId)) + return "externalId: string expected"; + return null; + }; + + /** + * Creates a CreateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadRequest} CreateWorkloadRequest + */ + CreateWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.CreateWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.CreateWorkloadRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workload != null) { + if (typeof object.workload !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.CreateWorkloadRequest.workload: object expected"); + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.fromObject(object.workload); + } + if (object.externalId != null) + message.externalId = String(object.externalId); + return message; + }; + + /** + * Creates a plain object from a CreateWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.CreateWorkloadRequest} message CreateWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workload = null; + object.externalId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workload != null && message.hasOwnProperty("workload")) + object.workload = $root.google.cloud.assuredworkloads.v1.Workload.toObject(message.workload, options); + if (message.externalId != null && message.hasOwnProperty("externalId")) + object.externalId = message.externalId; + return object; + }; + + /** + * Converts this CreateWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkloadRequest; + })(); + + v1.UpdateWorkloadRequest = (function() { + + /** + * Properties of an UpdateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IUpdateWorkloadRequest + * @property {google.cloud.assuredworkloads.v1.IWorkload|null} [workload] UpdateWorkloadRequest workload + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkloadRequest updateMask + */ + + /** + * Constructs a new UpdateWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents an UpdateWorkloadRequest. + * @implements IUpdateWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest=} [properties] Properties to set + */ + function UpdateWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkloadRequest workload. + * @member {google.cloud.assuredworkloads.v1.IWorkload|null|undefined} workload + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @instance + */ + UpdateWorkloadRequest.prototype.workload = null; + + /** + * UpdateWorkloadRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @instance + */ + UpdateWorkloadRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.UpdateWorkloadRequest} UpdateWorkloadRequest instance + */ + UpdateWorkloadRequest.create = function create(properties) { + return new UpdateWorkloadRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest} message UpdateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workload != null && Object.hasOwnProperty.call(message, "workload")) + $root.google.cloud.assuredworkloads.v1.Workload.encode(message.workload, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest} message UpdateWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.UpdateWorkloadRequest} UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.UpdateWorkloadRequest} UpdateWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workload != null && message.hasOwnProperty("workload")) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.verify(message.workload); + if (error) + return "workload." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.UpdateWorkloadRequest} UpdateWorkloadRequest + */ + UpdateWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest(); + if (object.workload != null) { + if (typeof object.workload !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.workload: object expected"); + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.fromObject(object.workload); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.UpdateWorkloadRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.UpdateWorkloadRequest} message UpdateWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workload = null; + object.updateMask = null; + } + if (message.workload != null && message.hasOwnProperty("workload")) + object.workload = $root.google.cloud.assuredworkloads.v1.Workload.toObject(message.workload, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateWorkloadRequest; + })(); + + v1.DeleteWorkloadRequest = (function() { + + /** + * Properties of a DeleteWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IDeleteWorkloadRequest + * @property {string|null} [name] DeleteWorkloadRequest name + * @property {string|null} [etag] DeleteWorkloadRequest etag + */ + + /** + * Constructs a new DeleteWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a DeleteWorkloadRequest. + * @implements IDeleteWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest=} [properties] Properties to set + */ + function DeleteWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkloadRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @instance + */ + DeleteWorkloadRequest.prototype.name = ""; + + /** + * DeleteWorkloadRequest etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @instance + */ + DeleteWorkloadRequest.prototype.etag = ""; + + /** + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.DeleteWorkloadRequest} DeleteWorkloadRequest instance + */ + DeleteWorkloadRequest.create = function create(properties) { + return new DeleteWorkloadRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.DeleteWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.DeleteWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.etag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.DeleteWorkloadRequest} DeleteWorkloadRequest + */ + DeleteWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.DeleteWorkloadRequest} message DeleteWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteWorkloadRequest; + })(); + + v1.GetWorkloadRequest = (function() { + + /** + * Properties of a GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IGetWorkloadRequest + * @property {string|null} [name] GetWorkloadRequest name + */ + + /** + * Constructs a new GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a GetWorkloadRequest. + * @implements IGetWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest=} [properties] Properties to set + */ + function GetWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkloadRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @instance + */ + GetWorkloadRequest.prototype.name = ""; + + /** + * Creates a new GetWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.GetWorkloadRequest} GetWorkloadRequest instance + */ + GetWorkloadRequest.create = function create(properties) { + return new GetWorkloadRequest(properties); + }; + + /** + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.GetWorkloadRequest} GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.GetWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.GetWorkloadRequest} GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.GetWorkloadRequest} GetWorkloadRequest + */ + GetWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.GetWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.GetWorkloadRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1.GetWorkloadRequest} message GetWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetWorkloadRequest; + })(); + + v1.ListWorkloadsRequest = (function() { + + /** + * Properties of a ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IListWorkloadsRequest + * @property {string|null} [parent] ListWorkloadsRequest parent + * @property {number|null} [pageSize] ListWorkloadsRequest pageSize + * @property {string|null} [pageToken] ListWorkloadsRequest pageToken + * @property {string|null} [filter] ListWorkloadsRequest filter + */ + + /** + * Constructs a new ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a ListWorkloadsRequest. + * @implements IListWorkloadsRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest=} [properties] Properties to set + */ + function ListWorkloadsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkloadsRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.parent = ""; + + /** + * ListWorkloadsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageSize = 0; + + /** + * ListWorkloadsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageToken = ""; + + /** + * ListWorkloadsRequest filter. + * @member {string} filter + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.filter = ""; + + /** + * Creates a new ListWorkloadsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsRequest} ListWorkloadsRequest instance + */ + ListWorkloadsRequest.create = function create(properties) { + return new ListWorkloadsRequest(properties); + }; + + /** + * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.ListWorkloadsRequest(); + 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 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkloadsRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsRequest} ListWorkloadsRequest + */ + ListWorkloadsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.ListWorkloadsRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.ListWorkloadsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.ListWorkloadsRequest} message ListWorkloadsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListWorkloadsRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkloadsRequest; + })(); + + v1.ListWorkloadsResponse = (function() { + + /** + * Properties of a ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IListWorkloadsResponse + * @property {Array.|null} [workloads] ListWorkloadsResponse workloads + * @property {string|null} [nextPageToken] ListWorkloadsResponse nextPageToken + */ + + /** + * Constructs a new ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a ListWorkloadsResponse. + * @implements IListWorkloadsResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsResponse=} [properties] Properties to set + */ + function ListWorkloadsResponse(properties) { + this.workloads = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkloadsResponse workloads. + * @member {Array.} workloads + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.workloads = $util.emptyArray; + + /** + * ListWorkloadsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWorkloadsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} ListWorkloadsResponse instance + */ + ListWorkloadsResponse.create = function create(properties) { + return new ListWorkloadsResponse(properties); + }; + + /** + * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workloads != null && message.workloads.length) + for (var i = 0; i < message.workloads.length; ++i) + $root.google.cloud.assuredworkloads.v1.Workload.encode(message.workloads[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListWorkloadsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.ListWorkloadsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.workloads && message.workloads.length)) + message.workloads = []; + message.workloads.push($root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkloadsResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workloads != null && message.hasOwnProperty("workloads")) { + if (!Array.isArray(message.workloads)) + return "workloads: array expected"; + for (var i = 0; i < message.workloads.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.verify(message.workloads[i]); + if (error) + return "workloads." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} ListWorkloadsResponse + */ + ListWorkloadsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.ListWorkloadsResponse) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.ListWorkloadsResponse(); + if (object.workloads) { + if (!Array.isArray(object.workloads)) + throw TypeError(".google.cloud.assuredworkloads.v1.ListWorkloadsResponse.workloads: array expected"); + message.workloads = []; + for (var i = 0; i < object.workloads.length; ++i) { + if (typeof object.workloads[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.ListWorkloadsResponse.workloads: object expected"); + message.workloads[i] = $root.google.cloud.assuredworkloads.v1.Workload.fromObject(object.workloads[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.ListWorkloadsResponse} message ListWorkloadsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workloads = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workloads && message.workloads.length) { + object.workloads = []; + for (var j = 0; j < message.workloads.length; ++j) + object.workloads[j] = $root.google.cloud.assuredworkloads.v1.Workload.toObject(message.workloads[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWorkloadsResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListWorkloadsResponse; + })(); + + v1.Workload = (function() { + + /** + * Properties of a Workload. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IWorkload + * @property {string|null} [name] Workload name + * @property {string|null} [displayName] Workload displayName + * @property {Array.|null} [resources] Workload resources + * @property {google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|null} [complianceRegime] Workload complianceRegime + * @property {google.protobuf.ITimestamp|null} [createTime] Workload createTime + * @property {string|null} [billingAccount] Workload billingAccount + * @property {string|null} [etag] Workload etag + * @property {Object.|null} [labels] Workload labels + * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent + * @property {google.cloud.assuredworkloads.v1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings + * @property {Array.|null} [resourceSettings] Workload resourceSettings + */ + + /** + * Constructs a new Workload. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a Workload. + * @implements IWorkload + * @constructor + * @param {google.cloud.assuredworkloads.v1.IWorkload=} [properties] Properties to set + */ + function Workload(properties) { + this.resources = []; + this.labels = {}; + this.resourceSettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Workload name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.name = ""; + + /** + * Workload displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.displayName = ""; + + /** + * Workload resources. + * @member {Array.} resources + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.resources = $util.emptyArray; + + /** + * Workload complianceRegime. + * @member {google.cloud.assuredworkloads.v1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.complianceRegime = 0; + + /** + * Workload createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.createTime = null; + + /** + * Workload billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.billingAccount = ""; + + /** + * Workload etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.etag = ""; + + /** + * Workload labels. + * @member {Object.} labels + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.labels = $util.emptyObject; + + /** + * Workload provisionedResourcesParent. + * @member {string} provisionedResourcesParent + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.provisionedResourcesParent = ""; + + /** + * Workload kmsSettings. + * @member {google.cloud.assuredworkloads.v1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.kmsSettings = null; + + /** + * Workload resourceSettings. + * @member {Array.} resourceSettings + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.resourceSettings = $util.emptyArray; + + /** + * Creates a new Workload instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1.IWorkload=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Workload} Workload instance + */ + Workload.create = function create(properties) { + return new Workload(properties); + }; + + /** + * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.encode(message.resources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.billingAccount); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.provisionedResourcesParent != null && Object.hasOwnProperty.call(message, "provisionedResourcesParent")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.provisionedResourcesParent); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.resourceSettings != null && message.resourceSettings.length) + for (var i = 0; i < message.resourceSettings.length; ++i) + $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Workload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Workload(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.decode(reader, reader.uint32())); + break; + case 4: + message.complianceRegime = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.billingAccount = reader.string(); + break; + case 9: + message.etag = reader.string(); + break; + case 10: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 13: + message.provisionedResourcesParent = reader.string(); + break; + case 14: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + case 15: + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Workload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Workload message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Workload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + if (!$util.isString(message.provisionedResourcesParent)) + return "provisionedResourcesParent: string expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { + if (!Array.isArray(message.resourceSettings)) + return "resourceSettings: array expected"; + for (var i = 0; i < message.resourceSettings.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.verify(message.resourceSettings[i]); + if (error) + return "resourceSettings." + error; + } + } + return null; + }; + + /** + * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Workload} Workload + */ + Workload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Workload) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Workload(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.resources: object expected"); + message.resources[i] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.fromObject(object.resources[i]); + } + } + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.provisionedResourcesParent != null) + message.provisionedResourcesParent = String(object.provisionedResourcesParent); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + if (object.resourceSettings) { + if (!Array.isArray(object.resourceSettings)) + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.resourceSettings: array expected"); + message.resourceSettings = []; + for (var i = 0; i < object.resourceSettings.length; ++i) { + if (typeof object.resourceSettings[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.resourceSettings: object expected"); + message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Workload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1.Workload} message Workload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Workload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.resourceSettings = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + object.createTime = null; + object.billingAccount = ""; + object.etag = ""; + object.provisionedResourcesParent = ""; + object.kmsSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.toObject(message.resources[j], options); + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + object.provisionedResourcesParent = message.provisionedResourcesParent; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.toObject(message.kmsSettings, options); + if (message.resourceSettings && message.resourceSettings.length) { + object.resourceSettings = []; + for (var j = 0; j < message.resourceSettings.length; ++j) + object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); + } + return object; + }; + + /** + * Converts this Workload to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + * @returns {Object.} JSON object + */ + Workload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Workload.ResourceInfo = (function() { + + /** + * Properties of a ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @interface IResourceInfo + * @property {number|Long|null} [resourceId] ResourceInfo resourceId + * @property {google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceInfo resourceType + */ + + /** + * Constructs a new ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @classdesc Represents a ResourceInfo. + * @implements IResourceInfo + * @constructor + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceInfo=} [properties] Properties to set + */ + function ResourceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceInfo resourceId. + * @member {number|Long} resourceId + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResourceInfo resourceType. + * @member {google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceType = 0; + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceInfo=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceInfo} ResourceInfo instance + */ + ResourceInfo.create = function create(properties) { + return new ResourceInfo(properties); + }; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + return writer; + }; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int64(); + break; + case 2: + message.resourceType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceInfo message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isInteger(message.resourceId) && !(message.resourceId && $util.isInteger(message.resourceId.low) && $util.isInteger(message.resourceId.high))) + return "resourceId: integer|Long expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceInfo} ResourceInfo + */ + ResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo(); + if (object.resourceId != null) + if ($util.Long) + (message.resourceId = $util.Long.fromValue(object.resourceId)).unsigned = false; + else if (typeof object.resourceId === "string") + message.resourceId = parseInt(object.resourceId, 10); + else if (typeof object.resourceId === "number") + message.resourceId = object.resourceId; + else if (typeof object.resourceId === "object") + message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.ResourceInfo} message ResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceId = options.longs === String ? "0" : 0; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (typeof message.resourceId === "number") + object.resourceId = options.longs === String ? String(message.resourceId) : message.resourceId; + else + object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + return object; + }; + + /** + * Converts this ResourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @instance + * @returns {Object.} JSON object + */ + ResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ResourceType enum. + * @name google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value + * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value + * @property {number} KEYRING=3 KEYRING value + */ + ResourceInfo.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONSUMER_PROJECT"] = 1; + values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; + values[valuesById[3] = "KEYRING"] = 3; + return values; + })(); + + return ResourceInfo; + })(); + + Workload.KMSSettings = (function() { + + /** + * Properties of a KMSSettings. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @interface IKMSSettings + * @property {google.protobuf.ITimestamp|null} [nextRotationTime] KMSSettings nextRotationTime + * @property {google.protobuf.IDuration|null} [rotationPeriod] KMSSettings rotationPeriod + */ + + /** + * Constructs a new KMSSettings. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @classdesc Represents a KMSSettings. + * @implements IKMSSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1.Workload.IKMSSettings=} [properties] Properties to set + */ + function KMSSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSSettings nextRotationTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.nextRotationTime = null; + + /** + * KMSSettings rotationPeriod. + * @member {google.protobuf.IDuration|null|undefined} rotationPeriod + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.rotationPeriod = null; + + /** + * Creates a new KMSSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IKMSSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Workload.KMSSettings} KMSSettings instance + */ + KMSSettings.create = function create(properties) { + return new KMSSettings(properties); + }; + + /** + * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.KMSSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextRotationTime != null && Object.hasOwnProperty.call(message, "nextRotationTime")) + $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rotationPeriod != null && Object.hasOwnProperty.call(message, "rotationPeriod")) + $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.KMSSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); + if (error) + return "nextRotationTime." + error; + } + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); + if (error) + return "rotationPeriod." + error; + } + return null; + }; + + /** + * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Workload.KMSSettings} KMSSettings + */ + KMSSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings(); + if (object.nextRotationTime != null) { + if (typeof object.nextRotationTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.KMSSettings.nextRotationTime: object expected"); + message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); + } + if (object.rotationPeriod != null) { + if (typeof object.rotationPeriod !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.KMSSettings.rotationPeriod: object expected"); + message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); + } + return message; + }; + + /** + * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.KMSSettings} message KMSSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nextRotationTime = null; + object.rotationPeriod = null; + } + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) + object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); + return object; + }; + + /** + * Converts this KMSSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @instance + * @returns {Object.} JSON object + */ + KMSSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KMSSettings; + })(); + + Workload.ResourceSettings = (function() { + + /** + * Properties of a ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @interface IResourceSettings + * @property {string|null} [resourceId] ResourceSettings resourceId + * @property {google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceSettings resourceType + * @property {string|null} [displayName] ResourceSettings displayName + */ + + /** + * Constructs a new ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @classdesc Represents a ResourceSettings. + * @implements IResourceSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceSettings=} [properties] Properties to set + */ + function ResourceSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceSettings resourceId. + * @member {string} resourceId + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceId = ""; + + /** + * ResourceSettings resourceType. + * @member {google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceType = 0; + + /** + * ResourceSettings displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.displayName = ""; + + /** + * Creates a new ResourceSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceSettings} ResourceSettings instance + */ + ResourceSettings.create = function create(properties) { + return new ResourceSettings(properties); + }; + + /** + * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.ResourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.resourceType = reader.int32(); + break; + case 3: + message.displayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isString(message.resourceId)) + return "resourceId: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Workload.ResourceSettings} ResourceSettings + */ + ResourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings(); + if (object.resourceId != null) + message.resourceId = String(object.resourceId); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.ResourceSettings} message ResourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceId = ""; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + object.resourceId = message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourceSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @instance + * @returns {Object.} JSON object + */ + ResourceSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceSettings; + })(); + + /** + * ComplianceRegime enum. + * @name google.cloud.assuredworkloads.v1.Workload.ComplianceRegime + * @enum {number} + * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value + * @property {number} IL4=1 IL4 value + * @property {number} CJIS=2 CJIS value + * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value + * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value + * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value + * @property {number} HIPAA=6 HIPAA value + * @property {number} HITRUST=7 HITRUST value + * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value + * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value + */ + Workload.ComplianceRegime = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; + values[valuesById[1] = "IL4"] = 1; + values[valuesById[2] = "CJIS"] = 2; + values[valuesById[3] = "FEDRAMP_HIGH"] = 3; + values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; + values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; + values[valuesById[6] = "HIPAA"] = 6; + values[valuesById[7] = "HITRUST"] = 7; + values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; + values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; + return values; + })(); + + return Workload; + })(); + + v1.CreateWorkloadOperationMetadata = (function() { + + /** + * Properties of a CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1 + * @interface ICreateWorkloadOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkloadOperationMetadata createTime + * @property {string|null} [displayName] CreateWorkloadOperationMetadata displayName + * @property {string|null} [parent] CreateWorkloadOperationMetadata parent + * @property {google.cloud.assuredworkloads.v1.Workload.ComplianceRegime|null} [complianceRegime] CreateWorkloadOperationMetadata complianceRegime + */ + + /** + * Constructs a new CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a CreateWorkloadOperationMetadata. + * @implements ICreateWorkloadOperationMetadata + * @constructor + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + */ + function CreateWorkloadOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkloadOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.createTime = null; + + /** + * CreateWorkloadOperationMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.displayName = ""; + + /** + * CreateWorkloadOperationMetadata parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.parent = ""; + + /** + * CreateWorkloadOperationMetadata complianceRegime. + * @member {google.cloud.assuredworkloads.v1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.complianceRegime = 0; + + /** + * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata instance + */ + CreateWorkloadOperationMetadata.create = function create(properties) { + return new CreateWorkloadOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + return writer; + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.parent = reader.string(); + break; + case 4: + message.complianceRegime = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkloadOperationMetadata message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkloadOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + return null; + }; + + /** + * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + */ + CreateWorkloadOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkloadOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.displayName = ""; + object.parent = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + return object; + }; + + /** + * Converts this CreateWorkloadOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateWorkloadOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkloadOperationMetadata; + })(); + + return v1; + })(); + assuredworkloads.v1beta1 = (function() { /** diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 835239d6545..3b03c00dc1f 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -6,6 +6,435 @@ "nested": { "assuredworkloads": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.AssuredWorkloads.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1;assuredworkloads", + "java_multiple_files": true, + "java_outer_classname": "AssuredworkloadsProto", + "java_package": "com.google.cloud.assuredworkloads.v1", + "php_namespace": "Google\\Cloud\\AssuredWorkloads\\V1", + "ruby_package": "Google::Cloud::AssuredWorkloads::V1", + "(google.api.resource_definition).type": "assuredworkloads.googleapis.com/Location", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" + }, + "nested": { + "AssuredWorkloadsService": { + "options": { + "(google.api.default_host)": "assuredworkloads.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWorkload": { + "requestType": "CreateWorkloadRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/locations/*}/workloads", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "parent,workload", + "(google.longrunning.operation_info).response_type": "Workload", + "(google.longrunning.operation_info).metadata_type": "CreateWorkloadOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/locations/*}/workloads", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "parent,workload" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workload", + "metadata_type": "CreateWorkloadOperationMetadata" + } + } + ] + }, + "UpdateWorkload": { + "requestType": "UpdateWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.http).patch": "/v1/{workload.name=organizations/*/locations/*/workloads/*}", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "workload,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{workload.name=organizations/*/locations/*/workloads/*}", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "workload,update_mask" + } + ] + }, + "DeleteWorkload": { + "requestType": "DeleteWorkloadRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/locations/*/workloads/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/locations/*/workloads/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetWorkload": { + "requestType": "GetWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/locations/*/workloads/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/locations/*/workloads/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListWorkloads": { + "requestType": "ListWorkloadsRequest", + "responseType": "ListWorkloadsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/locations/*}/workloads", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/locations/*}/workloads" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateWorkloadRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "assuredworkloads.googleapis.com/Workload" + } + }, + "workload": { + "type": "Workload", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "externalId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateWorkloadRequest": { + "fields": { + "workload": { + "type": "Workload", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteWorkloadRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "assuredworkloads.googleapis.com/Workload" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetWorkloadRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "assuredworkloads.googleapis.com/Workload" + } + } + } + }, + "ListWorkloadsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "assuredworkloads.googleapis.com/Workload" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListWorkloadsResponse": { + "fields": { + "workloads": { + "rule": "repeated", + "type": "Workload", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "Workload": { + "options": { + "(google.api.resource).type": "assuredworkloads.googleapis.com/Workload", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/workloads/{workload}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resources": { + "rule": "repeated", + "type": "ResourceInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "complianceRegime": { + "type": "ComplianceRegime", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "billingAccount": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "provisionedResourcesParent": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "kmsSettings": { + "type": "KMSSettings", + "id": 14, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "resourceSettings": { + "rule": "repeated", + "type": "ResourceSettings", + "id": 15, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "ResourceInfo": { + "fields": { + "resourceId": { + "type": "int64", + "id": 1 + }, + "resourceType": { + "type": "ResourceType", + "id": 2 + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "CONSUMER_PROJECT": 1, + "ENCRYPTION_KEYS_PROJECT": 2, + "KEYRING": 3 + } + } + } + }, + "KMSSettings": { + "fields": { + "nextRotationTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "rotationPeriod": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "ResourceSettings": { + "fields": { + "resourceId": { + "type": "string", + "id": 1 + }, + "resourceType": { + "type": "ResourceInfo.ResourceType", + "id": 2 + }, + "displayName": { + "type": "string", + "id": 3 + } + } + }, + "ComplianceRegime": { + "values": { + "COMPLIANCE_REGIME_UNSPECIFIED": 0, + "IL4": 1, + "CJIS": 2, + "FEDRAMP_HIGH": 3, + "FEDRAMP_MODERATE": 4, + "US_REGIONAL_ACCESS": 5, + "HIPAA": 6, + "HITRUST": 7, + "EU_REGIONS_AND_SUPPORT": 8, + "CA_REGIONS_AND_SUPPORT": 9 + } + } + } + }, + "CreateWorkloadOperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "complianceRegime": { + "type": "Workload.ComplianceRegime", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, "v1beta1": { "options": { "csharp_namespace": "Google.Cloud.AssuredWorkloads.V1Beta1", diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index 8c2568153e8..07a44d70537 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -16,12 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; const AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; type AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; -export {v1beta1, AssuredWorkloadsServiceClient}; -export default {v1beta1, AssuredWorkloadsServiceClient}; +export {v1, v1beta1, AssuredWorkloadsServiceClient}; +export default {v1, v1beta1, AssuredWorkloadsServiceClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts new file mode 100644 index 00000000000..a887a9247df --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -0,0 +1,1155 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} 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'); +/** + * Client JSON configuration object, loaded from + * `src/v1/assured_workloads_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './assured_workloads_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service to manage AssuredWorkloads. + * @class + * @memberof v1 + */ +export class AssuredWorkloadsServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + assuredWorkloadsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssuredWorkloadsServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this + .constructor as typeof AssuredWorkloadsServiceClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + workloadPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/workloads/{workload}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listWorkloads: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workloads' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const createWorkloadResponse = protoFilesRoot.lookup( + '.google.cloud.assuredworkloads.v1.Workload' + ) as gax.protobuf.Type; + const createWorkloadMetadata = protoFilesRoot.lookup( + '.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createWorkload: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkloadResponse.decode.bind(createWorkloadResponse), + createWorkloadMetadata.decode.bind(createWorkloadMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.assuredworkloads.v1.AssuredWorkloadsService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.assuredWorkloadsServiceStub) { + return this.assuredWorkloadsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.assuredworkloads.v1.AssuredWorkloadsService. + this.assuredWorkloadsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.assuredworkloads.v1.AssuredWorkloadsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.assuredworkloads.v1 + .AssuredWorkloadsService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assuredWorkloadsServiceStubMethods = [ + 'createWorkload', + 'updateWorkload', + 'deleteWorkload', + 'getWorkload', + 'listWorkloads', + ]; + for (const methodName of assuredWorkloadsServiceStubMethods) { + const callPromise = this.assuredWorkloadsServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assuredWorkloadsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'assuredworkloads.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'assuredworkloads.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + updateWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined + ] + >; + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateWorkload( + request: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.assuredworkloads.v1.Workload} request.workload + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateWorkload(request); + */ + updateWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'workload.name': request.workload!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkload(request, options, callback); + } + deleteWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined + ] + >; + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteWorkload( + request: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {string} [request.etag] + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteWorkload(request); + */ + deleteWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkload(request, options, callback); + } + getWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | undefined, + {} | undefined + ] + >; + getWorkload( + request: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkload( + request: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets Assured Workload associated with a CRM Node + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getWorkload(request); + */ + getWorkload( + request?: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkload(request, options, callback); + } + + createWorkload( + request?: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkload( + request: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkload( + request: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, + callback: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates Assured Workload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @param {google.cloud.assuredworkloads.v1.Workload} request.workload + * Required. Assured Workload to create + * @param {string} [request.externalId] + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createWorkload(request); + * const [response] = await operation.promise(); + */ + createWorkload( + request?: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkload(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createWorkload()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateWorkloadProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateWorkloadProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.assuredworkloads.v1.Workload, + protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createWorkload, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.assuredworkloads.v1.Workload, + protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + >; + } + listWorkloads( + request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload[], + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + ] + >; + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IWorkload + > + ): void; + listWorkloads( + request: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IWorkload + > + ): void; + /** + * Lists Assured Workloads under a CRM Node. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkloads( + request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IWorkload + >, + callback?: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IWorkload + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IWorkload[], + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkloads(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkloadsStream( + request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkloads.createStream( + this.innerApiCalls.listWorkloads as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkloads`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listWorkloadsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listWorkloadsAsync( + request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkloads.asyncIterate( + this.innerApiCalls['listWorkloads'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} organization + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(organization: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + organization: organization, + location: location, + }); + } + + /** + * Parse the organization from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName) + .organization; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization: string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName) + .organization; + } + + /** + * Return a fully-qualified workload resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} workload + * @returns {string} Resource name string. + */ + workloadPath(organization: string, location: string, workload: string) { + return this.pathTemplates.workloadPathTemplate.render({ + organization: organization, + location: location, + workload: workload, + }); + } + + /** + * Parse the organization from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName) + .organization; + } + + /** + * Parse the location from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName).location; + } + + /** + * Parse the workload from Workload resource. + * + * @param {string} workloadName + * A fully-qualified path representing Workload resource. + * @returns {string} A string representing the workload. + */ + matchWorkloadFromWorkloadName(workloadName: string) { + return this.pathTemplates.workloadPathTemplate.match(workloadName).workload; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.assuredWorkloadsServiceStub!.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json new file mode 100644 index 00000000000..7265c2dfa05 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.assuredworkloads.v1.AssuredWorkloadsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkload": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkloads": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_proto_list.json b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_proto_list.json new file mode 100644 index 00000000000..841929f41cb --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto" +] diff --git a/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..adcc81183b2 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json @@ -0,0 +1,77 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.assuredworkloads.v1", + "libraryPackage": "@google-cloud/assuredworkloads", + "services": { + "AssuredWorkloadsService": { + "clients": { + "grpc": { + "libraryClient": "AssuredWorkloadsServiceClient", + "rpcs": { + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads", + "listWorkloadsStream", + "listWorkloadsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssuredWorkloadsServiceClient", + "rpcs": { + "UpdateWorkload": { + "methods": [ + "updateWorkload" + ] + }, + "DeleteWorkload": { + "methods": [ + "deleteWorkload" + ] + }, + "GetWorkload": { + "methods": [ + "getWorkload" + ] + }, + "CreateWorkload": { + "methods": [ + "createWorkload" + ] + }, + "ListWorkloads": { + "methods": [ + "listWorkloads", + "listWorkloadsStream", + "listWorkloadsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-assuredworkloads/src/v1/index.ts b/packages/google-cloud-assuredworkloads/src/v1/index.ts new file mode 100644 index 00000000000..1a8d1fab704 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {AssuredWorkloadsServiceClient} from './assured_workloads_service_client'; diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts new file mode 100644 index 00000000000..6de6b2b4070 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -0,0 +1,1257 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assuredworkloadsserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AssuredWorkloadsServiceClient', () => { + it('has servicePath', () => { + const servicePath = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + await client.initialize(); + assert(client.assuredWorkloadsServiceStub); + }); + + it('has close method', () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + 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 assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + 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); + }); + + describe('updateWorkload', () => { + it('invokes updateWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ); + client.innerApiCalls.updateWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.updateWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkload without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ); + client.innerApiCalls.updateWorkload = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkload( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IWorkload | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateWorkload with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkload(request), expectedError); + assert( + (client.innerApiCalls.updateWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteWorkload', () => { + it('invokes deleteWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteWorkload without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkload = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkload( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteWorkload with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteWorkload(request), expectedError); + assert( + (client.innerApiCalls.deleteWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getWorkload', () => { + it('invokes getWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ); + client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkload(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getWorkload without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ); + client.innerApiCalls.getWorkload = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkload( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IWorkload | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getWorkload with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkload = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkload(request), expectedError); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createWorkload', () => { + it('invokes createWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkload(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkload( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createWorkload with call error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkload(request), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload with LRO error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkload(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateWorkloadProgress without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateWorkloadProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkloadProgress with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateWorkloadProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listWorkloads', () => { + it('invokes listWorkloads without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkloads(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloads without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkloads( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IWorkload[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listWorkloads with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkloads = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkloads(request), expectedError); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloadsStream without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + ]; + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1.Workload[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkloads, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkloads.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkloadsStream with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1.Workload[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkloads, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkloads.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkloads without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Workload() + ), + ]; + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.assuredworkloads.v1.IWorkload[] = []; + const iterable = client.listWorkloadsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkloads with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkloadsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.assuredworkloads.v1.IWorkload[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + }; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath( + 'organizationValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromLocationName', () => { + const result = client.matchOrganizationFromLocationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organization', () => { + const fakePath = '/rendered/path/organization'; + const expectedParameters = { + organization: 'organizationValue', + }; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath('organizationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workload', () => { + const fakePath = '/rendered/path/workload'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + workload: 'workloadValue', + }; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workloadPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workloadPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workloadPath', () => { + const result = client.workloadPath( + 'organizationValue', + 'locationValue', + 'workloadValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workloadPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromWorkloadName', () => { + const result = client.matchOrganizationFromWorkloadName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkloadName', () => { + const result = client.matchLocationFromWorkloadName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkloadFromWorkloadName', () => { + const result = client.matchWorkloadFromWorkloadName(fakePath); + assert.strictEqual(result, 'workloadValue'); + assert( + (client.pathTemplates.workloadPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); From 06fa2120f80344f25220b7af053b4abd07ce0a9a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 17 Sep 2021 02:58:13 +0000 Subject: [PATCH 059/116] chore: release 1.8.0 (#109) :robot: I have created a release \*beep\* \*boop\* --- ## [1.8.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.7.0...v1.8.0) (2021-09-17) ### Features * assuredworkloads v1 public protos ([#108](https://www.github.com/googleapis/nodejs-assured-workloads/issues/108)) ([4e6032f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/4e6032f0778c7df042035a7e19dbf17fc1c4951d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index e85a5d19462..78d9c9ffc94 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.8.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.7.0...v1.8.0) (2021-09-17) + + +### Features + +* assuredworkloads v1 public protos ([#108](https://www.github.com/googleapis/nodejs-assured-workloads/issues/108)) ([4e6032f](https://www.github.com/googleapis/nodejs-assured-workloads/commit/4e6032f0778c7df042035a7e19dbf17fc1c4951d)) + ## [1.7.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.6.0...v1.7.0) (2021-08-27) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index e411a360180..576feefa1e5 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.7.0", + "version": "1.8.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 28bda45f001..90ea7645b35 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.7.0" + "@google-cloud/assured-workloads": "^1.8.0" }, "devDependencies": { "c8": "^7.3.0", From 203701857e37cad4468e78241813e883a77e5dd5 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 13 Oct 2021 11:41:14 -0700 Subject: [PATCH 060/116] feat!: set v1 as the default version of the API (#110) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Jeffrey Rennie --- packages/google-cloud-assuredworkloads/.repo-metadata.json | 2 +- packages/google-cloud-assuredworkloads/src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index 75c0c41ad6d..cc920ab3993 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -3,7 +3,7 @@ "api_id": "assuredworkloads.googleapis.com", "distribution_name": "@google-cloud/assured-workloads", "release_level": "beta", - "default_version": "v1beta1", + "default_version": "v1", "language": "nodejs", "name_pretty": "Assured Workloads for Government", "repo": "googleapis/nodejs-assured-workloads", diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index 07a44d70537..94b984f4237 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -19,8 +19,8 @@ import * as v1 from './v1'; import * as v1beta1 from './v1beta1'; -const AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; -type AssuredWorkloadsServiceClient = v1beta1.AssuredWorkloadsServiceClient; +const AssuredWorkloadsServiceClient = v1.AssuredWorkloadsServiceClient; +type AssuredWorkloadsServiceClient = v1.AssuredWorkloadsServiceClient; export {v1, v1beta1, AssuredWorkloadsServiceClient}; export default {v1, v1beta1, AssuredWorkloadsServiceClient}; From 9094d60b46220ddcbdcd3b28d0c087147e36317f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:48:39 +0000 Subject: [PATCH 061/116] build(node): update deps used during postprocessing (#1243) (#117) --- .../protos/protos.d.ts | 3 ++- .../protos/protos.js | 7 +++++++ .../protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index db570b5ee9a..759d1f6d5a7 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -3371,7 +3371,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 108e2e76dc7..24fac483982 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -8328,6 +8328,7 @@ * @property {number} INPUT_ONLY=4 INPUT_ONLY value * @property {number} IMMUTABLE=5 IMMUTABLE value * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8338,6 +8339,7 @@ values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; return values; })(); @@ -14506,6 +14508,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -14610,6 +14613,10 @@ case 6: message[".google.api.fieldBehavior"][i] = 6; break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 3b03c00dc1f..ec4f378f04d 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -1102,7 +1102,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -1745,6 +1746,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From cf4487abf8014a3d81537428a5a69064276a3763 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 08:10:21 -0700 Subject: [PATCH 062/116] chore: release 2.0.0 (#116) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../samples/package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 78d9c9ffc94..204a368defc 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.8.0...v2.0.0) (2021-10-14) + + +### ⚠ BREAKING CHANGES + +* set v1 as the default version of the API (#110) + +### Features + +* set v1 as the default version of the API ([#110](https://www.github.com/googleapis/nodejs-assured-workloads/issues/110)) ([746db25](https://www.github.com/googleapis/nodejs-assured-workloads/commit/746db25e12932938467e4f14c573b838d06217e2)) + ## [1.8.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.7.0...v1.8.0) (2021-09-17) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 576feefa1e5..2039f21d804 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "1.8.0", + "version": "2.0.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 90ea7645b35..97513c00abe 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^1.8.0" + "@google-cloud/assured-workloads": "^2.0.0" }, "devDependencies": { "c8": "^7.3.0", From 32c25f2952be9b032d39b8e73cc0e82eb3d2b472 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Oct 2021 09:11:32 -0700 Subject: [PATCH 063/116] build(nodejs): correct artifact name for npm (#118) docs: add samples PiperOrigin-RevId: 404411760 Source-Link: https://github.com/googleapis/googleapis/commit/3fe45e23993b2cb0f2d47dfa00510eee388f808e Source-Link: https://github.com/googleapis/googleapis-gen/commit/7e0330f9367a6fe85fd58e8213e8612b007c95d8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2UwMzMwZjkzNjdhNmZlODVmZDU4ZTgyMTNlODYxMmIwMDdjOTVkOCJ9 --- ...sured_workloads_service.create_workload.js | 67 +++++++++++++++++ ...sured_workloads_service.delete_workload.js | 60 ++++++++++++++++ .../assured_workloads_service.get_workload.js | 57 +++++++++++++++ ...ssured_workloads_service.list_workloads.js | 71 +++++++++++++++++++ ...sured_workloads_service.update_workload.js | 61 ++++++++++++++++ ...sured_workloads_service.create_workload.js | 67 +++++++++++++++++ ...sured_workloads_service.delete_workload.js | 60 ++++++++++++++++ .../assured_workloads_service.get_workload.js | 57 +++++++++++++++ ...ssured_workloads_service.list_workloads.js | 71 +++++++++++++++++++ ...sured_workloads_service.update_workload.js | 61 ++++++++++++++++ .../v1/assured_workloads_service_client.ts | 6 +- .../src/v1/gapic_metadata.json | 2 +- .../assured_workloads_service_client.ts | 6 +- 13 files changed, 641 insertions(+), 5 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js new file mode 100644 index 00000000000..13a13fbdb7d --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, workload) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + */ + // const parent = 'abc123' + /** + * Required. Assured Workload to create + */ + // const workload = '' + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + */ + // const externalId = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function createWorkload() { + // Construct request + const request = { + parent, + workload, + }; + + // Run request + const [operation] = await assuredworkloadsClient.createWorkload(request); + const [response] = await operation.promise(); + console.log(response); + } + + createWorkload(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js new file mode 100644 index 00000000000..74083c3cb11 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + */ + // const name = 'abc123' + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + */ + // const etag = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function deleteWorkload() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assuredworkloadsClient.deleteWorkload(request); + console.log(response); + } + + deleteWorkload(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js new file mode 100644 index 00000000000..4a77ae5a2bd --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const name = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function getWorkload() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assuredworkloadsClient.getWorkload(request); + console.log(response); + } + + getWorkload(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js new file mode 100644 index 00000000000..99cca5e834c --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + */ + // const pageToken = 'abc123' + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + */ + // const filter = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function listWorkloads() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assuredworkloadsClient.listWorkloadsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listWorkloads(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js new file mode 100644 index 00000000000..03ba36249b5 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -0,0 +1,61 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(workload, updateMask) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + */ + // const workload = '' + /** + * Required. The list of fields to be updated. + */ + // const updateMask = '' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function updateWorkload() { + // Construct request + const request = { + workload, + updateMask, + }; + + // Run request + const response = await assuredworkloadsClient.updateWorkload(request); + console.log(response); + } + + updateWorkload(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js new file mode 100644 index 00000000000..8c8872cc7a4 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, workload) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + */ + // const parent = 'abc123' + /** + * Required. Assured Workload to create + */ + // const workload = '' + /** + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + */ + // const externalId = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function createWorkload() { + // Construct request + const request = { + parent, + workload, + }; + + // Run request + const [operation] = await assuredworkloadsClient.createWorkload(request); + const [response] = await operation.promise(); + console.log(response); + } + + createWorkload(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js new file mode 100644 index 00000000000..bfc81d16c99 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -0,0 +1,60 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + */ + // const name = 'abc123' + /** + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + */ + // const etag = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function deleteWorkload() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assuredworkloadsClient.deleteWorkload(request); + console.log(response); + } + + deleteWorkload(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js new file mode 100644 index 00000000000..d4eb04f94fc --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(name) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const name = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function getWorkload() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assuredworkloadsClient.getWorkload(request); + console.log(response); + } + + getWorkload(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js new file mode 100644 index 00000000000..2dd9d2b615c --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Page size. + */ + // const pageSize = 1234 + /** + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + */ + // const pageToken = 'abc123' + /** + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + */ + // const filter = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function listWorkloads() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assuredworkloadsClient.listWorkloadsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listWorkloads(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js new file mode 100644 index 00000000000..78845c41c17 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -0,0 +1,61 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(workload, updateMask) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + */ + // const workload = '' + /** + * Required. The list of fields to be updated. + */ + // const updateMask = '' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = + require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function updateWorkload() { + // Construct request + const request = { + workload, + updateMask, + }; + + // Run request + const response = await assuredworkloadsClient.updateWorkload(request); + console.log(response); + } + + updateWorkload(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index a887a9247df..4d447220d1b 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -956,7 +956,8 @@ export class AssuredWorkloadsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWorkloads']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as gax.GaxCall, @@ -1012,7 +1013,8 @@ export class AssuredWorkloadsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWorkloads']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, diff --git a/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json index adcc81183b2..5871c800273 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json +++ b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.assuredworkloads.v1", - "libraryPackage": "@google-cloud/assuredworkloads", + "libraryPackage": "@google-cloud/assured-workloads", "services": { "AssuredWorkloadsService": { "clients": { diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index e3bfc44a926..6bfd6a03882 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -962,7 +962,8 @@ export class AssuredWorkloadsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWorkloads']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as gax.GaxCall, @@ -1018,7 +1019,8 @@ export class AssuredWorkloadsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listWorkloads']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, From e3b8e9095c44be45d3f085f2760f9365c6e63fda Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:26:18 -0700 Subject: [PATCH 064/116] chore: fix the wrong post processor image (#121) --- packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml b/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml index 55ce47be27e..535ba88d921 100644 --- a/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml +++ b/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging From 126c2e965f1c32bd69bdedbe39bc1d618bb5961e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 21:10:28 +0200 Subject: [PATCH 065/116] chore(deps): update dependency @types/node to v16 (#120) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.6.1` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 2039f21d804..779b29dcdee 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.3", - "@types/node": "^14.6.1", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.0", "gts": "^2.0.2", From 9bf495550c41dfda145749e07207f615d11de642 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 11:42:13 -0400 Subject: [PATCH 066/116] chore(cloud-rad): delete api-extractor config (#119) --- .../api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-assuredworkloads/api-extractor.json diff --git a/packages/google-cloud-assuredworkloads/api-extractor.json b/packages/google-cloud-assuredworkloads/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-assuredworkloads/api-extractor.json +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/protos/protos.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [ ], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true, - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning", - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - }, - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - }, - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } - -} From f7afaf3222a92cee464daab9ac48730f6b5c5b7c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:52:20 +0100 Subject: [PATCH 067/116] chore(deps): update dependency sinon to v12 (#122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 779b29dcdee..6f98dcb3418 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -54,7 +54,7 @@ "mocha": "^8.1.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "^3.9.7", "webpack": "^5.0.0", From 0bd71a1f11a43d4efb2a7827aa143074ab631e9b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:04:14 -0800 Subject: [PATCH 068/116] docs(samples): add example tags to generated samples (#123) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 2 +- ...sured_workloads_service.create_workload.js | 6 +- ...sured_workloads_service.delete_workload.js | 4 +- .../assured_workloads_service.get_workload.js | 4 +- ...ssured_workloads_service.list_workloads.js | 4 +- ...sured_workloads_service.update_workload.js | 8 +- ...sured_workloads_service.create_workload.js | 6 +- ...sured_workloads_service.delete_workload.js | 4 +- .../assured_workloads_service.get_workload.js | 4 +- ...ssured_workloads_service.list_workloads.js | 4 +- ...sured_workloads_service.update_workload.js | 8 +- .../v1/assured_workloads_service_client.ts | 270 +++++++++--------- .../assured_workloads_service_client.ts | 270 +++++++++--------- 13 files changed, 289 insertions(+), 305 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/linkinator.config.json b/packages/google-cloud-assuredworkloads/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-assuredworkloads/linkinator.config.json +++ b/packages/google-cloud-assuredworkloads/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index 13a13fbdb7d..ae63d56a860 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -27,7 +27,7 @@ function main(parent, workload) { /** * Required. Assured Workload to create */ - // const workload = '' + // const workload = {} /** * Optional. A identifier associated with the workload and underlying projects which * allows for the break down of billing costs for a workload. The value @@ -43,7 +43,7 @@ function main(parent, workload) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function createWorkload() { + async function callCreateWorkload() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent, workload) { console.log(response); } - createWorkload(); + callCreateWorkload(); // [END assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js index 74083c3cb11..d43cd42f3cd 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function deleteWorkload() { + async function callDeleteWorkload() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - deleteWorkload(); + callDeleteWorkload(); // [END assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index 4a77ae5a2bd..452ebec1122 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function getWorkload() { + async function callGetWorkload() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - getWorkload(); + callGetWorkload(); // [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js index 99cca5e834c..057363c6454 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -47,7 +47,7 @@ function main(parent) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function listWorkloads() { + async function callListWorkloads() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent) { } } - listWorkloads(); + callListWorkloads(); // [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index 03ba36249b5..a07a60cd9e6 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -25,11 +25,11 @@ function main(workload, updateMask) { * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} */ - // const workload = '' + // const workload = {} /** * Required. The list of fields to be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Assuredworkloads library const {AssuredWorkloadsServiceClient} = @@ -38,7 +38,7 @@ function main(workload, updateMask) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function updateWorkload() { + async function callUpdateWorkload() { // Construct request const request = { workload, @@ -50,7 +50,7 @@ function main(workload, updateMask) { console.log(response); } - updateWorkload(); + callUpdateWorkload(); // [END assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index 8c8872cc7a4..f0b9bae5dfb 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -27,7 +27,7 @@ function main(parent, workload) { /** * Required. Assured Workload to create */ - // const workload = '' + // const workload = {} /** * Optional. A identifier associated with the workload and underlying projects which * allows for the break down of billing costs for a workload. The value @@ -43,7 +43,7 @@ function main(parent, workload) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function createWorkload() { + async function callCreateWorkload() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent, workload) { console.log(response); } - createWorkload(); + callCreateWorkload(); // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js index bfc81d16c99..a53ad1f6bc5 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -38,7 +38,7 @@ function main(name) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function deleteWorkload() { + async function callDeleteWorkload() { // Construct request const request = { name, @@ -49,7 +49,7 @@ function main(name) { console.log(response); } - deleteWorkload(); + callDeleteWorkload(); // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index d4eb04f94fc..25edb32bf36 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function getWorkload() { + async function callGetWorkload() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - getWorkload(); + callGetWorkload(); // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js index 2dd9d2b615c..f35b79400f7 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -47,7 +47,7 @@ function main(parent) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function listWorkloads() { + async function callListWorkloads() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent) { } } - listWorkloads(); + callListWorkloads(); // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async] } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index 78845c41c17..3a834a8fe26 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -25,11 +25,11 @@ function main(workload, updateMask) { * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} */ - // const workload = '' + // const workload = {} /** * Required. The list of fields to be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Assuredworkloads library const {AssuredWorkloadsServiceClient} = @@ -38,7 +38,7 @@ function main(workload, updateMask) { // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); - async function updateWorkload() { + async function callUpdateWorkload() { // Construct request const request = { workload, @@ -50,7 +50,7 @@ function main(workload, updateMask) { console.log(response); } - updateWorkload(); + callUpdateWorkload(); // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async] } diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 4d447220d1b..c7fad9ddebf 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -357,6 +357,31 @@ export class AssuredWorkloadsServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.assuredworkloads.v1.Workload} request.workload + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.update_workload.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async + */ updateWorkload( request?: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, options?: CallOptions @@ -391,31 +416,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.assuredworkloads.v1.Workload} request.workload - * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateWorkload(request); - */ updateWorkload( request?: protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest, optionsOrCallback?: @@ -462,6 +462,30 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {string} [request.etag] + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.delete_workload.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async + */ deleteWorkload( request?: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, options?: CallOptions @@ -496,30 +520,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param {string} [request.etag] - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteWorkload(request); - */ deleteWorkload( request?: protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest, optionsOrCallback?: @@ -566,6 +566,27 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.deleteWorkload(request, options, callback); } + /** + * Gets Assured Workload associated with a CRM Node + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.get_workload.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async + */ getWorkload( request?: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, options?: CallOptions @@ -597,27 +618,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Gets Assured Workload associated with a CRM Node - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getWorkload(request); - */ getWorkload( request?: protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest, optionsOrCallback?: @@ -662,6 +662,33 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.getWorkload(request, options, callback); } + /** + * Creates Assured Workload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @param {google.cloud.assuredworkloads.v1.Workload} request.workload + * Required. Assured Workload to create + * @param {string} [request.externalId] + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.create_workload.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async + */ createWorkload( request?: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, options?: CallOptions @@ -698,34 +725,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Creates Assured Workload. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @param {google.cloud.assuredworkloads.v1.Workload} request.workload - * Required. Assured Workload to create - * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createWorkload(request); - * const [response] = await operation.promise(); - */ createWorkload( request?: protos.google.cloud.assuredworkloads.v1.ICreateWorkloadRequest, optionsOrCallback?: @@ -783,11 +782,8 @@ export class AssuredWorkloadsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateWorkloadProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/assured_workloads_service.create_workload.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async */ async checkCreateWorkloadProgress( name: string @@ -811,6 +807,36 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata >; } + /** + * Lists Assured Workloads under a CRM Node. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listWorkloads( request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, options?: CallOptions @@ -842,36 +868,6 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1.IWorkload > ): void; - /** - * Lists Assured Workloads under a CRM Node. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * @param {string} request.filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1.Workload}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkloadsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listWorkloads( request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, optionsOrCallback?: @@ -994,11 +990,8 @@ export class AssuredWorkloadsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listWorkloadsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/assured_workloads_service.list_workloads.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async */ listWorkloadsAsync( request?: protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, @@ -1012,7 +1005,6 @@ export class AssuredWorkloadsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 6bfd6a03882..983ebb39f1b 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -357,6 +357,31 @@ export class AssuredWorkloadsServiceClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Updates an existing workload. + * Currently allows updating of workload display_name and labels. + * For force updates don't set etag field in the Workload. + * Only one update operation per workload can be in progress. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload + * Required. The workload to update. + * The workload’s `name` field is used to identify the workload to be updated. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.update_workload.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async + */ updateWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, options?: CallOptions @@ -391,31 +416,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Updates an existing workload. - * Currently allows updating of workload display_name and labels. - * For force updates don't set etag field in the Workload. - * Only one update operation per workload can be in progress. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload - * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateWorkload(request); - */ updateWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, optionsOrCallback?: @@ -462,6 +462,30 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } + /** + * Deletes the workload. Make sure that workload's direct children are already + * in a deleted state, otherwise the request will fail with a + * FAILED_PRECONDITION error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The `name` field is used to identify the workload. + * Format: + * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + * @param {string} [request.etag] + * Optional. The etag of the workload. + * If this is provided, it must match the server's etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.delete_workload.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async + */ deleteWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, options?: CallOptions @@ -496,30 +520,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Deletes the workload. Make sure that workload's direct children are already - * in a deleted state, otherwise the request will fail with a - * FAILED_PRECONDITION error. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The `name` field is used to identify the workload. - * Format: - * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - * @param {string} [request.etag] - * Optional. The etag of the workload. - * If this is provided, it must match the server's etag. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteWorkload(request); - */ deleteWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, optionsOrCallback?: @@ -566,6 +566,27 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.deleteWorkload(request, options, callback); } + /** + * Gets Assured Workload associated with a CRM Node + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.get_workload.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async + */ getWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, options?: CallOptions @@ -600,27 +621,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Gets Assured Workload associated with a CRM Node - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getWorkload(request); - */ getWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, optionsOrCallback?: @@ -668,6 +668,33 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.getWorkload(request, options, callback); } + /** + * Creates Assured Workload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the new Workload's parent. + * Must be of the form `organizations/{org_id}/locations/{location_id}`. + * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload + * Required. Assured Workload to create + * @param {string} [request.externalId] + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value + * provided for the identifier will add a label to the workload and contained + * projects with the identifier as the value. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.create_workload.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async + */ createWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, options?: CallOptions @@ -704,34 +731,6 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): void; - /** - * Creates Assured Workload. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the new Workload's parent. - * Must be of the form `organizations/{org_id}/locations/{location_id}`. - * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload - * Required. Assured Workload to create - * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value - * provided for the identifier will add a label to the workload and contained - * projects with the identifier as the value. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createWorkload(request); - * const [response] = await operation.promise(); - */ createWorkload( request?: protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, optionsOrCallback?: @@ -789,11 +788,8 @@ export class AssuredWorkloadsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateWorkloadProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/assured_workloads_service.create_workload.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async */ async checkCreateWorkloadProgress( name: string @@ -817,6 +813,36 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata >; } + /** + * Lists Assured Workloads under a CRM Node. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent Resource to list workloads from. + * Must be of the form `organizations/{org_id}/locations/{location}`. + * @param {number} request.pageSize + * Page size. + * @param {string} request.pageToken + * Page token returned from previous request. Page token contains context from + * previous request. Page token needs to be passed in the second and following + * requests. + * @param {string} request.filter + * A custom filter for filtering by properties of a workload. At this time, + * only filtering by labels is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkloadsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listWorkloads( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, options?: CallOptions @@ -848,36 +874,6 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1beta1.IWorkload > ): void; - /** - * Lists Assured Workloads under a CRM Node. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent Resource to list workloads from. - * Must be of the form `organizations/{org_id}/locations/{location}`. - * @param {number} request.pageSize - * Page size. - * @param {string} request.pageToken - * Page token returned from previous request. Page token contains context from - * previous request. Page token needs to be passed in the second and following - * requests. - * @param {string} request.filter - * A custom filter for filtering by properties of a workload. At this time, - * only filtering by labels is supported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Workload]{@link google.cloud.assuredworkloads.v1beta1.Workload}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkloadsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listWorkloads( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, optionsOrCallback?: @@ -1000,11 +996,8 @@ export class AssuredWorkloadsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listWorkloadsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/assured_workloads_service.list_workloads.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async */ listWorkloadsAsync( request?: protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, @@ -1018,7 +1011,6 @@ export class AssuredWorkloadsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 88c9f27b462b31fba4755ea78de14ed7667d9184 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:20:16 +0000 Subject: [PATCH 069/116] build: add generated samples to .eslintignore (#124) --- packages/google-cloud-assuredworkloads/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-assuredworkloads/.eslintignore b/packages/google-cloud-assuredworkloads/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-assuredworkloads/.eslintignore +++ b/packages/google-cloud-assuredworkloads/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From e5b7acfd6d2d6c5b9e869f8ac0b365ee4b3b20d7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:44:16 +0000 Subject: [PATCH 070/116] feat: EU Regions and Support With Sovereign Controls (#125) - [ ] Regenerate this pull request now. Committer: @guisin PiperOrigin-RevId: 415069787 Source-Link: https://github.com/googleapis/googleapis/commit/85ffeed56bf1463c2cf3428a591208065bdd6edd Source-Link: https://github.com/googleapis/googleapis-gen/commit/479ca5e4798c527c353e3eaee562db0f2dea5044 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDc5Y2E1ZTQ3OThjNTI3YzM1M2UzZWFlZTU2MmRiMGYyZGVhNTA0NCJ9 --- .../v1/assuredworkloads.proto | 131 ++- .../v1beta1/assuredworkloads_v1beta1.proto | 156 +++- .../protos/protos.d.ts | 286 ++++++ .../protos/protos.js | 882 ++++++++++++++++++ .../protos/protos.json | 138 +++ ...sured_workloads_service.create_workload.js | 4 +- .../assured_workloads_service.get_workload.js | 4 +- ...sured_workloads_service.create_workload.js | 4 +- .../assured_workloads_service.get_workload.js | 4 +- .../v1/assured_workloads_service_client.ts | 8 +- .../assured_workloads_service_client.ts | 8 +- 11 files changed, 1544 insertions(+), 81 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 75272749511..43cab1f99e8 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -41,10 +41,12 @@ option (google.api.resource_definition) = { // Service to manage AssuredWorkloads. service AssuredWorkloadsService { option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { + rpc CreateWorkload(CreateWorkloadRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*/locations/*}/workloads" body: "workload" @@ -109,8 +111,8 @@ message CreateWorkloadRequest { // Required. Assured Workload to create Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A identifier associated with the workload and underlying projects which - // allows for the break down of billing costs for a workload. The value + // Optional. A identifier associated with the workload and underlying projects + // which allows for the break down of billing costs for a workload. The value // provided for the identifier will add a label to the workload and contained // projects with the identifier as the value. string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -125,7 +127,8 @@ message UpdateWorkloadRequest { Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request for deleting a Workload. @@ -147,8 +150,8 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the workloads's - // relative path in the API, formatted as + // Required. The resource name of the Workload to fetch. This is the + // workloads's relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, // "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -228,17 +231,18 @@ message Workload { // Settings specific to the Key Management Service. message KMSSettings { - // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - // new version of the crypto key and mark it as the primary. + // Required. Input only. Immutable. The time at which the Key Management + // Service will automatically create a new version of the crypto key and + // mark it as the primary. google.protobuf.Timestamp next_rotation_time = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - // Management Service automatically rotates a key. Must be at least 24 hours - // and at most 876,000 hours. + // Required. Input only. Immutable. [next_rotation_time] will be advanced by + // this period when the Key Management Service automatically rotates a key. + // Must be at least 24 hours and at most 876,000 hours. google.protobuf.Duration rotation_period = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -264,6 +268,48 @@ message Workload { string display_name = 3; } + // Signed Access Approvals (SAA) enrollment response. + message SaaEnrollmentResponse { + // Setup state of SAA enrollment. + enum SetupState { + // Unspecified. + SETUP_STATE_UNSPECIFIED = 0; + + // SAA enrollment pending. + STATUS_PENDING = 1; + + // SAA enrollment comopleted. + STATUS_COMPLETE = 2; + } + + // Setup error of SAA enrollment. + enum SetupError { + // Unspecified. + SETUP_ERROR_UNSPECIFIED = 0; + + // Invalid states for all customers, to be redirected to AA UI for + // additional details. + ERROR_INVALID_BASE_SETUP = 1; + + // Returned when there is not an EKM key configured. + ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + + // Returned when there are no enrolled services or the customer is + // enrolled in CAA only for a subset of services. + ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + + // Returned when exception was encountered during evaluation of other + // criteria. + ERROR_SETUP_CHECK_FAILED = 4; + } + + // Indicates SAA enrollment status of a given workload. + optional SetupState setup_status = 1; + + // Indicates SAA enrollment setup error if any. + repeated SetupError setup_errors = 2; + } + // Supported Compliance Regimes. enum ComplianceRegime { // Unknown compliance regime. @@ -297,6 +343,18 @@ message Workload { CA_REGIONS_AND_SUPPORT = 9; } + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + // Optional. The resource name of the workload. // Format: // organizations/{organization}/locations/{location}/workloads/{workload} @@ -316,7 +374,8 @@ message Workload { // These resources will be created when creating the workload. // If any of the projects already exist, the workload creation will fail. // Always read only. - repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ResourceInfo resources = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Immutable. Compliance Regime associated with this workload. ComplianceRegime compliance_regime = 4 [ @@ -350,29 +409,46 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - // Input only. The parent resource for the resources managed by this Assured Workload. May - // be either empty or a folder resource which is a child of the + // Input only. The parent resource for the resources managed by this Assured + // Workload. May be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the // parent organization. // Format: // folders/{folder_id} - string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + string provisioned_resources_parent = 13 + [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Settings used to create a CMEK crypto key. When set a project with a KMS - // CMEK key is provisioned. This field is mandatory for a subset of Compliance - // Regimes. + // Input only. Settings used to create a CMEK crypto key. When set a project + // with a KMS CMEK key is provisioned. This field is mandatory for a subset of + // Compliance Regimes. KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Resource properties that are used to customize workload resources. - // These properties (such as custom project id) will be used to create - // workload resources if possible. This field is optional. - repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Resource properties that are used to customize workload + // resources. These properties (such as custom project id) will be used to + // create workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Represents the KAJ enrollment state of the given workload. + KajEnrollmentState kaj_enrollment_state = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Indicates the sovereignty status of the given workload. + // Currently meant to be used by Europe/Canada customers. + bool enable_sovereign_controls = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the SAA enrollment response of the given workload. + // SAA enrollment response is queried during GetWorkload call. + // In failure cases, user friendly error message is shown in SAA details page. + SaaEnrollmentResponse saa_enrollment_response = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. message CreateWorkloadOperationMetadata { // Optional. Time when the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The display name of the workload. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -380,7 +456,8 @@ message CreateWorkloadOperationMetadata { // Optional. The parent of the workload. string parent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Compliance controls that should be applied to the resources managed by - // the workload. - Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Compliance controls that should be applied to the resources + // managed by the workload. + Workload.ComplianceRegime compliance_regime = 4 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto index d97441d6318..2845b2ec0ad 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto @@ -41,10 +41,12 @@ option (google.api.resource_definition) = { // Service to manage AssuredWorkloads. service AssuredWorkloadsService { option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { + rpc CreateWorkload(CreateWorkloadRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" body: "workload" @@ -109,8 +111,8 @@ message CreateWorkloadRequest { // Required. Assured Workload to create Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A identifier associated with the workload and underlying projects which - // allows for the break down of billing costs for a workload. The value + // Optional. A identifier associated with the workload and underlying projects + // which allows for the break down of billing costs for a workload. The value // provided for the identifier will add a label to the workload and contained // projects with the identifier as the value. string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -125,7 +127,8 @@ message UpdateWorkloadRequest { Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request for deleting a Workload. @@ -147,8 +150,8 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the workloads's - // relative path in the API, formatted as + // Required. The resource name of the Workload to fetch. This is the + // workloads's relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, // "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -232,17 +235,18 @@ message Workload { // Settings specific to the Key Management Service. message KMSSettings { - // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a - // new version of the crypto key and mark it as the primary. + // Required. Input only. Immutable. The time at which the Key Management + // Service will automatically create a new version of the crypto key and + // mark it as the primary. google.protobuf.Timestamp next_rotation_time = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key - // Management Service automatically rotates a key. Must be at least 24 hours - // and at most 876,000 hours. + // Required. Input only. Immutable. [next_rotation_time] will be advanced by + // this period when the Key Management Service automatically rotates a key. + // Must be at least 24 hours and at most 876,000 hours. google.protobuf.Duration rotation_period = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -254,7 +258,8 @@ message Workload { message IL4Settings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -266,7 +271,8 @@ message Workload { message CJISSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -278,7 +284,8 @@ message Workload { message FedrampHighSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -290,7 +297,8 @@ message Workload { message FedrampModerateSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto key. + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. KMSSettings kms_settings = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -316,6 +324,42 @@ message Workload { string display_name = 3; } + // Signed Access Approvals (SAA) enrollment response. + message SaaEnrollmentResponse { + // Setup state of SAA enrollment. + enum SetupState { + // Unspecified. + SETUP_STATE_UNSPECIFIED = 0; + // SAA enrollment pending. + STATUS_PENDING = 1; + // SAA enrollment comopleted. + STATUS_COMPLETE = 2; + } + + // Setup error of SAA enrollment. + enum SetupError { + // Unspecified. + SETUP_ERROR_UNSPECIFIED = 0; + // Invalid states for all customers, to be redirected to AA UI for + // additional details. + ERROR_INVALID_BASE_SETUP = 1; + // Returned when there is not an EKM key configured. + ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + // Returned when there are no enrolled services or the customer is + // enrolled in CAA only for a subset of services. + ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + // Returned when exception was encountered during evaluation of other + // criteria. + ERROR_SETUP_CHECK_FAILED = 4; + } + + // Indicates SAA enrollment status of a given workload. + optional SetupState setup_status = 1; + + // Indicates SAA enrollment setup error if any. + repeated SetupError setup_errors = 2; + } + // Supported Compliance Regimes. enum ComplianceRegime { // Unknown compliance regime. @@ -349,6 +393,18 @@ message Workload { CA_REGIONS_AND_SUPPORT = 9; } + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + // Optional. The resource name of the workload. // Format: // organizations/{organization}/locations/{location}/workloads/{workload} @@ -368,7 +424,8 @@ message Workload { // These resources will be created when creating the workload. // If any of the projects already exist, the workload creation will fail. // Always read only. - repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ResourceInfo resources = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Immutable. Compliance Regime associated with this workload. ComplianceRegime compliance_regime = 4 [ @@ -394,7 +451,8 @@ message Workload { // Settings specific to the selected [compliance_regime] oneof compliance_regime_settings { - // Required. Input only. Immutable. Settings specific to resources needed for IL4. + // Required. Input only. Immutable. Settings specific to resources needed + // for IL4. IL4Settings il4_settings = 7 [ deprecated = true, (google.api.field_behavior) = REQUIRED, @@ -402,7 +460,8 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed for CJIS. + // Required. Input only. Immutable. Settings specific to resources needed + // for CJIS. CJISSettings cjis_settings = 8 [ deprecated = true, (google.api.field_behavior) = REQUIRED, @@ -410,7 +469,8 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP High. + // Required. Input only. Immutable. Settings specific to resources needed + // for FedRAMP High. FedrampHighSettings fedramp_high_settings = 11 [ deprecated = true, (google.api.field_behavior) = REQUIRED, @@ -418,7 +478,8 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. + // Required. Input only. Immutable. Settings specific to resources needed + // for FedRAMP Moderate. FedrampModerateSettings fedramp_moderate_settings = 12 [ deprecated = true, (google.api.field_behavior) = REQUIRED, @@ -434,29 +495,46 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - // Input only. The parent resource for the resources managed by this Assured Workload. May - // be either empty or a folder resource which is a child of the + // Input only. The parent resource for the resources managed by this Assured + // Workload. May be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the // parent organization. // Format: // folders/{folder_id} - string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + string provisioned_resources_parent = 13 + [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Settings used to create a CMEK crypto key. When set a project with a KMS - // CMEK key is provisioned. This field is mandatory for a subset of Compliance - // Regimes. + // Input only. Settings used to create a CMEK crypto key. When set a project + // with a KMS CMEK key is provisioned. This field is mandatory for a subset of + // Compliance Regimes. KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; - // Input only. Resource properties that are used to customize workload resources. - // These properties (such as custom project id) will be used to create - // workload resources if possible. This field is optional. - repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Resource properties that are used to customize workload + // resources. These properties (such as custom project id) will be used to + // create workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Represents the KAJ enrollment state of the given workload. + KajEnrollmentState kaj_enrollment_state = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Indicates the sovereignty status of the given workload. + // Currently meant to be used by Europe/Canada customers. + bool enable_sovereign_controls = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the SAA enrollment response of the given workload. + // SAA enrollment response is queried during GetWorkload call. + // In failure cases, user friendly error message is shown in SAA details page. + SaaEnrollmentResponse saa_enrollment_response = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. message CreateWorkloadOperationMetadata { // Optional. Time when the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The display name of the workload. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -464,11 +542,13 @@ message CreateWorkloadOperationMetadata { // Optional. The parent of the workload. string parent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Compliance controls that should be applied to the resources managed by - // the workload. - Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Compliance controls that should be applied to the resources + // managed by the workload. + Workload.ComplianceRegime compliance_regime = 4 + [(google.api.field_behavior) = OPTIONAL]; - // Optional. Resource properties in the input that are used for creating/customizing - // workload resources. - repeated Workload.ResourceSettings resource_settings = 5 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Resource properties in the input that are used for + // creating/customizing workload resources. + repeated Workload.ResourceSettings resource_settings = 5 + [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 759d1f6d5a7..2b2cc316935 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -778,6 +778,15 @@ export namespace google { /** Workload resourceSettings */ resourceSettings?: (google.cloud.assuredworkloads.v1.Workload.IResourceSettings[]|null); + + /** Workload kajEnrollmentState */ + kajEnrollmentState?: (google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState|keyof typeof google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState|null); + + /** Workload enableSovereignControls */ + enableSovereignControls?: (boolean|null); + + /** Workload saaEnrollmentResponse */ + saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null); } /** Represents a Workload. */ @@ -822,6 +831,15 @@ export namespace google { /** Workload resourceSettings. */ public resourceSettings: google.cloud.assuredworkloads.v1.Workload.IResourceSettings[]; + /** Workload kajEnrollmentState. */ + public kajEnrollmentState: (google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState|keyof typeof google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState); + + /** Workload enableSovereignControls. */ + public enableSovereignControls: boolean; + + /** Workload saaEnrollmentResponse. */ + public saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null); + /** * Creates a new Workload instance using the specified properties. * @param [properties] Properties to set @@ -1200,6 +1218,124 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SaaEnrollmentResponse. */ + interface ISaaEnrollmentResponse { + + /** SaaEnrollmentResponse setupStatus */ + setupStatus?: (google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|keyof typeof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|null); + + /** SaaEnrollmentResponse setupErrors */ + setupErrors?: (google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[]|null); + } + + /** Represents a SaaEnrollmentResponse. */ + class SaaEnrollmentResponse implements ISaaEnrollmentResponse { + + /** + * Constructs a new SaaEnrollmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse); + + /** SaaEnrollmentResponse setupStatus. */ + public setupStatus?: (google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|keyof typeof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|null); + + /** SaaEnrollmentResponse setupErrors. */ + public setupErrors: google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[]; + + /** SaaEnrollmentResponse _setupStatus. */ + public _setupStatus?: "setupStatus"; + + /** + * Creates a new SaaEnrollmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SaaEnrollmentResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse): google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse; + + /** + * Encodes the specified SaaEnrollmentResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @param message SaaEnrollmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SaaEnrollmentResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @param message SaaEnrollmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse; + + /** + * Verifies a SaaEnrollmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SaaEnrollmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaaEnrollmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse; + + /** + * Creates a plain object from a SaaEnrollmentResponse message. Also converts values to other types if specified. + * @param message SaaEnrollmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SaaEnrollmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SaaEnrollmentResponse { + + /** SetupState enum. */ + enum SetupState { + SETUP_STATE_UNSPECIFIED = 0, + STATUS_PENDING = 1, + STATUS_COMPLETE = 2 + } + + /** SetupError enum. */ + enum SetupError { + SETUP_ERROR_UNSPECIFIED = 0, + ERROR_INVALID_BASE_SETUP = 1, + ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2, + ERROR_NOT_ALL_SERVICES_ENROLLED = 3, + ERROR_SETUP_CHECK_FAILED = 4 + } + } + /** ComplianceRegime enum. */ enum ComplianceRegime { COMPLIANCE_REGIME_UNSPECIFIED = 0, @@ -1213,6 +1349,13 @@ export namespace google { EU_REGIONS_AND_SUPPORT = 8, CA_REGIONS_AND_SUPPORT = 9 } + + /** KajEnrollmentState enum. */ + enum KajEnrollmentState { + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, + KAJ_ENROLLMENT_STATE_PENDING = 1, + KAJ_ENROLLMENT_STATE_COMPLETE = 2 + } } /** Properties of a CreateWorkloadOperationMetadata. */ @@ -2091,6 +2234,15 @@ export namespace google { /** Workload resourceSettings */ resourceSettings?: (google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]|null); + + /** Workload kajEnrollmentState */ + kajEnrollmentState?: (google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|null); + + /** Workload enableSovereignControls */ + enableSovereignControls?: (boolean|null); + + /** Workload saaEnrollmentResponse */ + saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null); } /** Represents a Workload. */ @@ -2147,6 +2299,15 @@ export namespace google { /** Workload resourceSettings. */ public resourceSettings: google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings[]; + /** Workload kajEnrollmentState. */ + public kajEnrollmentState: (google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState); + + /** Workload enableSovereignControls. */ + public enableSovereignControls: boolean; + + /** Workload saaEnrollmentResponse. */ + public saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null); + /** Workload complianceRegimeSettings. */ public complianceRegimeSettings?: ("il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"); @@ -2889,6 +3050,124 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a SaaEnrollmentResponse. */ + interface ISaaEnrollmentResponse { + + /** SaaEnrollmentResponse setupStatus */ + setupStatus?: (google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|null); + + /** SaaEnrollmentResponse setupErrors */ + setupErrors?: (google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[]|null); + } + + /** Represents a SaaEnrollmentResponse. */ + class SaaEnrollmentResponse implements ISaaEnrollmentResponse { + + /** + * Constructs a new SaaEnrollmentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse); + + /** SaaEnrollmentResponse setupStatus. */ + public setupStatus?: (google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|keyof typeof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|null); + + /** SaaEnrollmentResponse setupErrors. */ + public setupErrors: google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[]; + + /** SaaEnrollmentResponse _setupStatus. */ + public _setupStatus?: "setupStatus"; + + /** + * Creates a new SaaEnrollmentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SaaEnrollmentResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse): google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse; + + /** + * Encodes the specified SaaEnrollmentResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @param message SaaEnrollmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SaaEnrollmentResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @param message SaaEnrollmentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse; + + /** + * Verifies a SaaEnrollmentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SaaEnrollmentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SaaEnrollmentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse; + + /** + * Creates a plain object from a SaaEnrollmentResponse message. Also converts values to other types if specified. + * @param message SaaEnrollmentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SaaEnrollmentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SaaEnrollmentResponse { + + /** SetupState enum. */ + enum SetupState { + SETUP_STATE_UNSPECIFIED = 0, + STATUS_PENDING = 1, + STATUS_COMPLETE = 2 + } + + /** SetupError enum. */ + enum SetupError { + SETUP_ERROR_UNSPECIFIED = 0, + ERROR_INVALID_BASE_SETUP = 1, + ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2, + ERROR_NOT_ALL_SERVICES_ENROLLED = 3, + ERROR_SETUP_CHECK_FAILED = 4 + } + } + /** ComplianceRegime enum. */ enum ComplianceRegime { COMPLIANCE_REGIME_UNSPECIFIED = 0, @@ -2902,6 +3181,13 @@ export namespace google { EU_REGIONS_AND_SUPPORT = 8, CA_REGIONS_AND_SUPPORT = 9 } + + /** KajEnrollmentState enum. */ + enum KajEnrollmentState { + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, + KAJ_ENROLLMENT_STATE_PENDING = 1, + KAJ_ENROLLMENT_STATE_COMPLETE = 2 + } } /** Properties of a CreateWorkloadOperationMetadata. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 24fac483982..f7d9b59495f 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1622,6 +1622,9 @@ * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent * @property {google.cloud.assuredworkloads.v1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings * @property {Array.|null} [resourceSettings] Workload resourceSettings + * @property {google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState + * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls + * @property {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse */ /** @@ -1730,6 +1733,30 @@ */ Workload.prototype.resourceSettings = $util.emptyArray; + /** + * Workload kajEnrollmentState. + * @member {google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState} kajEnrollmentState + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.kajEnrollmentState = 0; + + /** + * Workload enableSovereignControls. + * @member {boolean} enableSovereignControls + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.enableSovereignControls = false; + + /** + * Workload saaEnrollmentResponse. + * @member {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null|undefined} saaEnrollmentResponse + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.saaEnrollmentResponse = null; + /** * Creates a new Workload instance using the specified properties. * @function create @@ -1779,6 +1806,12 @@ if (message.resourceSettings != null && message.resourceSettings.length) for (var i = 0; i < message.resourceSettings.length; ++i) $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.kajEnrollmentState != null && Object.hasOwnProperty.call(message, "kajEnrollmentState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.kajEnrollmentState); + if (message.enableSovereignControls != null && Object.hasOwnProperty.call(message, "enableSovereignControls")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); + if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) + $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); return writer; }; @@ -1869,6 +1902,15 @@ message.resourceSettings = []; message.resourceSettings.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.decode(reader, reader.uint32())); break; + case 17: + message.kajEnrollmentState = reader.int32(); + break; + case 18: + message.enableSovereignControls = reader.bool(); + break; + case 20: + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1971,6 +2013,23 @@ return "resourceSettings." + error; } } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + switch (message.kajEnrollmentState) { + default: + return "kajEnrollmentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + if (typeof message.enableSovereignControls !== "boolean") + return "enableSovereignControls: boolean expected"; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) { + var error = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.verify(message.saaEnrollmentResponse); + if (error) + return "saaEnrollmentResponse." + error; + } return null; }; @@ -2075,6 +2134,27 @@ message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); } } + switch (object.kajEnrollmentState) { + case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": + case 0: + message.kajEnrollmentState = 0; + break; + case "KAJ_ENROLLMENT_STATE_PENDING": + case 1: + message.kajEnrollmentState = 1; + break; + case "KAJ_ENROLLMENT_STATE_COMPLETE": + case 2: + message.kajEnrollmentState = 2; + break; + } + if (object.enableSovereignControls != null) + message.enableSovereignControls = Boolean(object.enableSovereignControls); + if (object.saaEnrollmentResponse != null) { + if (typeof object.saaEnrollmentResponse !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.saaEnrollmentResponse: object expected"); + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); + } return message; }; @@ -2106,6 +2186,9 @@ object.etag = ""; object.provisionedResourcesParent = ""; object.kmsSettings = null; + object.kajEnrollmentState = options.enums === String ? "KAJ_ENROLLMENT_STATE_UNSPECIFIED" : 0; + object.enableSovereignControls = false; + object.saaEnrollmentResponse = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2139,6 +2222,12 @@ for (var j = 0; j < message.resourceSettings.length; ++j) object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + object.enableSovereignControls = message.enableSovereignControls; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) + object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); return object; }; @@ -2893,6 +2982,342 @@ return ResourceSettings; })(); + Workload.SaaEnrollmentResponse = (function() { + + /** + * Properties of a SaaEnrollmentResponse. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @interface ISaaEnrollmentResponse + * @property {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|null} [setupStatus] SaaEnrollmentResponse setupStatus + * @property {Array.|null} [setupErrors] SaaEnrollmentResponse setupErrors + */ + + /** + * Constructs a new SaaEnrollmentResponse. + * @memberof google.cloud.assuredworkloads.v1.Workload + * @classdesc Represents a SaaEnrollmentResponse. + * @implements ISaaEnrollmentResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse=} [properties] Properties to set + */ + function SaaEnrollmentResponse(properties) { + this.setupErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SaaEnrollmentResponse setupStatus. + * @member {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState|null|undefined} setupStatus + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @instance + */ + SaaEnrollmentResponse.prototype.setupStatus = null; + + /** + * SaaEnrollmentResponse setupErrors. + * @member {Array.} setupErrors + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @instance + */ + SaaEnrollmentResponse.prototype.setupErrors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SaaEnrollmentResponse _setupStatus. + * @member {"setupStatus"|undefined} _setupStatus + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @instance + */ + Object.defineProperty(SaaEnrollmentResponse.prototype, "_setupStatus", { + get: $util.oneOfGetter($oneOfFields = ["setupStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SaaEnrollmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse instance + */ + SaaEnrollmentResponse.create = function create(properties) { + return new SaaEnrollmentResponse(properties); + }; + + /** + * Encodes the specified SaaEnrollmentResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse} message SaaEnrollmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaaEnrollmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setupStatus != null && Object.hasOwnProperty.call(message, "setupStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.setupStatus); + if (message.setupErrors != null && message.setupErrors.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.setupErrors.length; ++i) + writer.int32(message.setupErrors[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SaaEnrollmentResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse} message SaaEnrollmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaaEnrollmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaaEnrollmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.setupStatus = reader.int32(); + break; + case 2: + if (!(message.setupErrors && message.setupErrors.length)) + message.setupErrors = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.setupErrors.push(reader.int32()); + } else + message.setupErrors.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaaEnrollmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SaaEnrollmentResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SaaEnrollmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { + properties._setupStatus = 1; + switch (message.setupStatus) { + default: + return "setupStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.setupErrors != null && message.hasOwnProperty("setupErrors")) { + if (!Array.isArray(message.setupErrors)) + return "setupErrors: array expected"; + for (var i = 0; i < message.setupErrors.length; ++i) + switch (message.setupErrors[i]) { + default: + return "setupErrors: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates a SaaEnrollmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + */ + SaaEnrollmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse(); + switch (object.setupStatus) { + case "SETUP_STATE_UNSPECIFIED": + case 0: + message.setupStatus = 0; + break; + case "STATUS_PENDING": + case 1: + message.setupStatus = 1; + break; + case "STATUS_COMPLETE": + case 2: + message.setupStatus = 2; + break; + } + if (object.setupErrors) { + if (!Array.isArray(object.setupErrors)) + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.setupErrors: array expected"); + message.setupErrors = []; + for (var i = 0; i < object.setupErrors.length; ++i) + switch (object.setupErrors[i]) { + default: + case "SETUP_ERROR_UNSPECIFIED": + case 0: + message.setupErrors[i] = 0; + break; + case "ERROR_INVALID_BASE_SETUP": + case 1: + message.setupErrors[i] = 1; + break; + case "ERROR_MISSING_EXTERNAL_SIGNING_KEY": + case 2: + message.setupErrors[i] = 2; + break; + case "ERROR_NOT_ALL_SERVICES_ENROLLED": + case 3: + message.setupErrors[i] = 3; + break; + case "ERROR_SETUP_CHECK_FAILED": + case 4: + message.setupErrors[i] = 4; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SaaEnrollmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse} message SaaEnrollmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SaaEnrollmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.setupErrors = []; + if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { + object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; + if (options.oneofs) + object._setupStatus = "setupStatus"; + } + if (message.setupErrors && message.setupErrors.length) { + object.setupErrors = []; + for (var j = 0; j < message.setupErrors.length; ++j) + object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + } + return object; + }; + + /** + * Converts this SaaEnrollmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @instance + * @returns {Object.} JSON object + */ + SaaEnrollmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SetupState enum. + * @name google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState + * @enum {number} + * @property {number} SETUP_STATE_UNSPECIFIED=0 SETUP_STATE_UNSPECIFIED value + * @property {number} STATUS_PENDING=1 STATUS_PENDING value + * @property {number} STATUS_COMPLETE=2 STATUS_COMPLETE value + */ + SaaEnrollmentResponse.SetupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATUS_PENDING"] = 1; + values[valuesById[2] = "STATUS_COMPLETE"] = 2; + return values; + })(); + + /** + * SetupError enum. + * @name google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError + * @enum {number} + * @property {number} SETUP_ERROR_UNSPECIFIED=0 SETUP_ERROR_UNSPECIFIED value + * @property {number} ERROR_INVALID_BASE_SETUP=1 ERROR_INVALID_BASE_SETUP value + * @property {number} ERROR_MISSING_EXTERNAL_SIGNING_KEY=2 ERROR_MISSING_EXTERNAL_SIGNING_KEY value + * @property {number} ERROR_NOT_ALL_SERVICES_ENROLLED=3 ERROR_NOT_ALL_SERVICES_ENROLLED value + * @property {number} ERROR_SETUP_CHECK_FAILED=4 ERROR_SETUP_CHECK_FAILED value + */ + SaaEnrollmentResponse.SetupError = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_ERROR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ERROR_INVALID_BASE_SETUP"] = 1; + values[valuesById[2] = "ERROR_MISSING_EXTERNAL_SIGNING_KEY"] = 2; + values[valuesById[3] = "ERROR_NOT_ALL_SERVICES_ENROLLED"] = 3; + values[valuesById[4] = "ERROR_SETUP_CHECK_FAILED"] = 4; + return values; + })(); + + return SaaEnrollmentResponse; + })(); + /** * ComplianceRegime enum. * @name google.cloud.assuredworkloads.v1.Workload.ComplianceRegime @@ -2923,6 +3348,22 @@ return values; })(); + /** + * KajEnrollmentState enum. + * @name google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState + * @enum {number} + * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value + * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value + * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + */ + Workload.KajEnrollmentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; + values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; + return values; + })(); + return Workload; })(); @@ -4810,6 +5251,9 @@ * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings * @property {Array.|null} [resourceSettings] Workload resourceSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState + * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse */ /** @@ -4950,6 +5394,30 @@ */ Workload.prototype.resourceSettings = $util.emptyArray; + /** + * Workload kajEnrollmentState. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState} kajEnrollmentState + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.kajEnrollmentState = 0; + + /** + * Workload enableSovereignControls. + * @member {boolean} enableSovereignControls + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.enableSovereignControls = false; + + /** + * Workload saaEnrollmentResponse. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null|undefined} saaEnrollmentResponse + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.saaEnrollmentResponse = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -5021,6 +5489,12 @@ if (message.resourceSettings != null && message.resourceSettings.length) for (var i = 0; i < message.resourceSettings.length; ++i) $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.kajEnrollmentState != null && Object.hasOwnProperty.call(message, "kajEnrollmentState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.kajEnrollmentState); + if (message.enableSovereignControls != null && Object.hasOwnProperty.call(message, "enableSovereignControls")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); + if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); return writer; }; @@ -5123,6 +5597,15 @@ message.resourceSettings = []; message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); break; + case 17: + message.kajEnrollmentState = reader.int32(); + break; + case 18: + message.enableSovereignControls = reader.bool(); + break; + case 20: + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -5264,6 +5747,23 @@ return "resourceSettings." + error; } } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + switch (message.kajEnrollmentState) { + default: + return "kajEnrollmentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + if (typeof message.enableSovereignControls !== "boolean") + return "enableSovereignControls: boolean expected"; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify(message.saaEnrollmentResponse); + if (error) + return "saaEnrollmentResponse." + error; + } return null; }; @@ -5388,6 +5888,27 @@ message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); } } + switch (object.kajEnrollmentState) { + case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": + case 0: + message.kajEnrollmentState = 0; + break; + case "KAJ_ENROLLMENT_STATE_PENDING": + case 1: + message.kajEnrollmentState = 1; + break; + case "KAJ_ENROLLMENT_STATE_COMPLETE": + case 2: + message.kajEnrollmentState = 2; + break; + } + if (object.enableSovereignControls != null) + message.enableSovereignControls = Boolean(object.enableSovereignControls); + if (object.saaEnrollmentResponse != null) { + if (typeof object.saaEnrollmentResponse !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.saaEnrollmentResponse: object expected"); + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); + } return message; }; @@ -5419,6 +5940,9 @@ object.etag = ""; object.provisionedResourcesParent = ""; object.kmsSettings = null; + object.kajEnrollmentState = options.enums === String ? "KAJ_ENROLLMENT_STATE_UNSPECIFIED" : 0; + object.enableSovereignControls = false; + object.saaEnrollmentResponse = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -5472,6 +5996,12 @@ for (var j = 0; j < message.resourceSettings.length; ++j) object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + object.enableSovereignControls = message.enableSovereignControls; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) + object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); return object; }; @@ -7006,6 +7536,342 @@ return ResourceSettings; })(); + Workload.SaaEnrollmentResponse = (function() { + + /** + * Properties of a SaaEnrollmentResponse. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface ISaaEnrollmentResponse + * @property {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|null} [setupStatus] SaaEnrollmentResponse setupStatus + * @property {Array.|null} [setupErrors] SaaEnrollmentResponse setupErrors + */ + + /** + * Constructs a new SaaEnrollmentResponse. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a SaaEnrollmentResponse. + * @implements ISaaEnrollmentResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse=} [properties] Properties to set + */ + function SaaEnrollmentResponse(properties) { + this.setupErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SaaEnrollmentResponse setupStatus. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState|null|undefined} setupStatus + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @instance + */ + SaaEnrollmentResponse.prototype.setupStatus = null; + + /** + * SaaEnrollmentResponse setupErrors. + * @member {Array.} setupErrors + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @instance + */ + SaaEnrollmentResponse.prototype.setupErrors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SaaEnrollmentResponse _setupStatus. + * @member {"setupStatus"|undefined} _setupStatus + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @instance + */ + Object.defineProperty(SaaEnrollmentResponse.prototype, "_setupStatus", { + get: $util.oneOfGetter($oneOfFields = ["setupStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SaaEnrollmentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse instance + */ + SaaEnrollmentResponse.create = function create(properties) { + return new SaaEnrollmentResponse(properties); + }; + + /** + * Encodes the specified SaaEnrollmentResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse} message SaaEnrollmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaaEnrollmentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setupStatus != null && Object.hasOwnProperty.call(message, "setupStatus")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.setupStatus); + if (message.setupErrors != null && message.setupErrors.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.setupErrors.length; ++i) + writer.int32(message.setupErrors[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SaaEnrollmentResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse} message SaaEnrollmentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SaaEnrollmentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaaEnrollmentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.setupStatus = reader.int32(); + break; + case 2: + if (!(message.setupErrors && message.setupErrors.length)) + message.setupErrors = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.setupErrors.push(reader.int32()); + } else + message.setupErrors.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SaaEnrollmentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SaaEnrollmentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SaaEnrollmentResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SaaEnrollmentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { + properties._setupStatus = 1; + switch (message.setupStatus) { + default: + return "setupStatus: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.setupErrors != null && message.hasOwnProperty("setupErrors")) { + if (!Array.isArray(message.setupErrors)) + return "setupErrors: array expected"; + for (var i = 0; i < message.setupErrors.length; ++i) + switch (message.setupErrors[i]) { + default: + return "setupErrors: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + return null; + }; + + /** + * Creates a SaaEnrollmentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse} SaaEnrollmentResponse + */ + SaaEnrollmentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse(); + switch (object.setupStatus) { + case "SETUP_STATE_UNSPECIFIED": + case 0: + message.setupStatus = 0; + break; + case "STATUS_PENDING": + case 1: + message.setupStatus = 1; + break; + case "STATUS_COMPLETE": + case 2: + message.setupStatus = 2; + break; + } + if (object.setupErrors) { + if (!Array.isArray(object.setupErrors)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.setupErrors: array expected"); + message.setupErrors = []; + for (var i = 0; i < object.setupErrors.length; ++i) + switch (object.setupErrors[i]) { + default: + case "SETUP_ERROR_UNSPECIFIED": + case 0: + message.setupErrors[i] = 0; + break; + case "ERROR_INVALID_BASE_SETUP": + case 1: + message.setupErrors[i] = 1; + break; + case "ERROR_MISSING_EXTERNAL_SIGNING_KEY": + case 2: + message.setupErrors[i] = 2; + break; + case "ERROR_NOT_ALL_SERVICES_ENROLLED": + case 3: + message.setupErrors[i] = 3; + break; + case "ERROR_SETUP_CHECK_FAILED": + case 4: + message.setupErrors[i] = 4; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SaaEnrollmentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse} message SaaEnrollmentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SaaEnrollmentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.setupErrors = []; + if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { + object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; + if (options.oneofs) + object._setupStatus = "setupStatus"; + } + if (message.setupErrors && message.setupErrors.length) { + object.setupErrors = []; + for (var j = 0; j < message.setupErrors.length; ++j) + object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + } + return object; + }; + + /** + * Converts this SaaEnrollmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @instance + * @returns {Object.} JSON object + */ + SaaEnrollmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SetupState enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState + * @enum {number} + * @property {number} SETUP_STATE_UNSPECIFIED=0 SETUP_STATE_UNSPECIFIED value + * @property {number} STATUS_PENDING=1 STATUS_PENDING value + * @property {number} STATUS_COMPLETE=2 STATUS_COMPLETE value + */ + SaaEnrollmentResponse.SetupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATUS_PENDING"] = 1; + values[valuesById[2] = "STATUS_COMPLETE"] = 2; + return values; + })(); + + /** + * SetupError enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError + * @enum {number} + * @property {number} SETUP_ERROR_UNSPECIFIED=0 SETUP_ERROR_UNSPECIFIED value + * @property {number} ERROR_INVALID_BASE_SETUP=1 ERROR_INVALID_BASE_SETUP value + * @property {number} ERROR_MISSING_EXTERNAL_SIGNING_KEY=2 ERROR_MISSING_EXTERNAL_SIGNING_KEY value + * @property {number} ERROR_NOT_ALL_SERVICES_ENROLLED=3 ERROR_NOT_ALL_SERVICES_ENROLLED value + * @property {number} ERROR_SETUP_CHECK_FAILED=4 ERROR_SETUP_CHECK_FAILED value + */ + SaaEnrollmentResponse.SetupError = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_ERROR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ERROR_INVALID_BASE_SETUP"] = 1; + values[valuesById[2] = "ERROR_MISSING_EXTERNAL_SIGNING_KEY"] = 2; + values[valuesById[3] = "ERROR_NOT_ALL_SERVICES_ENROLLED"] = 3; + values[valuesById[4] = "ERROR_SETUP_CHECK_FAILED"] = 4; + return values; + })(); + + return SaaEnrollmentResponse; + })(); + /** * ComplianceRegime enum. * @name google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime @@ -7036,6 +7902,22 @@ return values; })(); + /** + * KajEnrollmentState enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState + * @enum {number} + * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value + * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value + * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + */ + Workload.KajEnrollmentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; + values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; + return values; + })(); + return Workload; })(); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index ec4f378f04d..94446d2fa97 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -326,6 +326,27 @@ "options": { "(google.api.field_behavior)": "INPUT_ONLY" } + }, + "kajEnrollmentState": { + "type": "KajEnrollmentState", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableSovereignControls": { + "type": "bool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "saaEnrollmentResponse": { + "type": "SaaEnrollmentResponse", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -385,6 +406,47 @@ } } }, + "SaaEnrollmentResponse": { + "oneofs": { + "_setupStatus": { + "oneof": [ + "setupStatus" + ] + } + }, + "fields": { + "setupStatus": { + "type": "SetupState", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "setupErrors": { + "rule": "repeated", + "type": "SetupError", + "id": 2 + } + }, + "nested": { + "SetupState": { + "values": { + "SETUP_STATE_UNSPECIFIED": 0, + "STATUS_PENDING": 1, + "STATUS_COMPLETE": 2 + } + }, + "SetupError": { + "values": { + "SETUP_ERROR_UNSPECIFIED": 0, + "ERROR_INVALID_BASE_SETUP": 1, + "ERROR_MISSING_EXTERNAL_SIGNING_KEY": 2, + "ERROR_NOT_ALL_SERVICES_ENROLLED": 3, + "ERROR_SETUP_CHECK_FAILED": 4 + } + } + } + }, "ComplianceRegime": { "values": { "COMPLIANCE_REGIME_UNSPECIFIED": 0, @@ -398,6 +460,13 @@ "EU_REGIONS_AND_SUPPORT": 8, "CA_REGIONS_AND_SUPPORT": 9 } + }, + "KajEnrollmentState": { + "values": { + "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, + "KAJ_ENROLLMENT_STATE_PENDING": 1, + "KAJ_ENROLLMENT_STATE_COMPLETE": 2 + } } } }, @@ -797,6 +866,27 @@ "options": { "(google.api.field_behavior)": "INPUT_ONLY" } + }, + "kajEnrollmentState": { + "type": "KajEnrollmentState", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableSovereignControls": { + "type": "bool", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "saaEnrollmentResponse": { + "type": "SaaEnrollmentResponse", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -913,6 +1003,47 @@ } } }, + "SaaEnrollmentResponse": { + "oneofs": { + "_setupStatus": { + "oneof": [ + "setupStatus" + ] + } + }, + "fields": { + "setupStatus": { + "type": "SetupState", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "setupErrors": { + "rule": "repeated", + "type": "SetupError", + "id": 2 + } + }, + "nested": { + "SetupState": { + "values": { + "SETUP_STATE_UNSPECIFIED": 0, + "STATUS_PENDING": 1, + "STATUS_COMPLETE": 2 + } + }, + "SetupError": { + "values": { + "SETUP_ERROR_UNSPECIFIED": 0, + "ERROR_INVALID_BASE_SETUP": 1, + "ERROR_MISSING_EXTERNAL_SIGNING_KEY": 2, + "ERROR_NOT_ALL_SERVICES_ENROLLED": 3, + "ERROR_SETUP_CHECK_FAILED": 4 + } + } + } + }, "ComplianceRegime": { "values": { "COMPLIANCE_REGIME_UNSPECIFIED": 0, @@ -926,6 +1057,13 @@ "EU_REGIONS_AND_SUPPORT": 8, "CA_REGIONS_AND_SUPPORT": 9 } + }, + "KajEnrollmentState": { + "values": { + "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, + "KAJ_ENROLLMENT_STATE_PENDING": 1, + "KAJ_ENROLLMENT_STATE_COMPLETE": 2 + } } } }, diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index ae63d56a860..3cc9f0f9bc8 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -29,8 +29,8 @@ function main(parent, workload) { */ // const workload = {} /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects + * which allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index 452ebec1122..af87a586956 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -20,8 +20,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the + * workloads's relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index f0b9bae5dfb..d58ddaf56cb 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -29,8 +29,8 @@ function main(parent, workload) { */ // const workload = {} /** - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects + * which allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index 25edb32bf36..a870b0258bb 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -20,8 +20,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the + * workloads's relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index c7fad9ddebf..1f3a2fdcf4c 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -572,8 +572,8 @@ export class AssuredWorkloadsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the + * workloads's relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -673,8 +673,8 @@ export class AssuredWorkloadsServiceClient { * @param {google.cloud.assuredworkloads.v1.Workload} request.workload * Required. Assured Workload to create * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects + * which allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. * @param {object} [options] diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 983ebb39f1b..9de8b90e365 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -572,8 +572,8 @@ export class AssuredWorkloadsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the + * workloads's relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -679,8 +679,8 @@ export class AssuredWorkloadsServiceClient { * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload * Required. Assured Workload to create * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects which - * allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects + * which allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. * @param {object} [options] From 5eb5742f7960d7d370a3a44ad279e75214db6685 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 13 Dec 2021 09:42:08 -0800 Subject: [PATCH 071/116] chore: release 2.1.0 (#126) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 204a368defc..113d54a2996 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v2.0.0...v2.1.0) (2021-12-10) + + +### Features + +* EU Regions and Support With Sovereign Controls ([#125](https://www.github.com/googleapis/nodejs-assured-workloads/issues/125)) ([29706fc](https://www.github.com/googleapis/nodejs-assured-workloads/commit/29706fc359d17fbb85af1d91fcdecf638be52a8a)) + ## [2.0.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v1.8.0...v2.0.0) (2021-10-14) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 6f98dcb3418..d91e721a022 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "2.0.0", + "version": "2.1.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 97513c00abe..6f95f4dd24d 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^2.0.0" + "@google-cloud/assured-workloads": "^2.1.0" }, "devDependencies": { "c8": "^7.3.0", From c6940accc9b7f6016026ad2480d3fa32bc8e8271 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 21:36:34 +0000 Subject: [PATCH 072/116] docs(node): support "stable"/"preview" release level (#1312) (#129) --- packages/google-cloud-assuredworkloads/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index bc4ed258b1f..3cb6ff7cf6b 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -122,6 +122,7 @@ This library follows [Semantic Versioning](http://semver.org/). + This library is considered to be in **beta**. This means it is expected to be mostly stable while we work toward a general availability release; however, complete stability is not guaranteed. We will address issues and requests @@ -130,6 +131,7 @@ against beta libraries with a high priority. + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 225f0928cb85c871640468d3594d2a52cdf6dac9 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 12:05:47 -0500 Subject: [PATCH 073/116] chore: add api_shortname and library_type to repo metadata (#128) --- .../google-cloud-assuredworkloads/.repo-metadata.json | 6 ++++-- packages/google-cloud-assuredworkloads/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index cc920ab3993..0974a820f7d 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -2,7 +2,7 @@ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest", "api_id": "assuredworkloads.googleapis.com", "distribution_name": "@google-cloud/assured-workloads", - "release_level": "beta", + "release_level": "preview", "default_version": "v1", "language": "nodejs", "name_pretty": "Assured Workloads for Government", @@ -10,5 +10,7 @@ "product_documentation": "https://cloud.google.com/assured-workloads/docs", "requires_billing": true, "name": "assuredworkloads", - "issue_tracker": "" + "issue_tracker": "", + "api_shortname": "assuredworkloads", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 3cb6ff7cf6b..39891eb9088 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -4,7 +4,7 @@ # [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + [![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) @@ -123,13 +123,12 @@ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From ba5590f3760f647d1a5e6825ffba80feefffbb3f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:18:19 +0000 Subject: [PATCH 074/116] docs(badges): tweak badge to use new preview/stable language (#1314) (#131) --- packages/google-cloud-assuredworkloads/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 39891eb9088..9071e40bd2c 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -4,9 +4,8 @@ # [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) - +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-assured-workloads/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-assured-workloads) From 40feac8508c75feeb0906abc84f7bd367b745ccd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:26:13 +0000 Subject: [PATCH 075/116] test(nodejs): remove 15 add 16 (#1322) (#133) --- packages/google-cloud-assuredworkloads/protos/protos.d.ts | 2 +- packages/google-cloud-assuredworkloads/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 2b2cc316935..91d47593b99 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index f7d9b59495f..32051105682 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 5c89a2434432562b8ac67a4deedf3c4ba7146161 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:16:59 -0800 Subject: [PATCH 076/116] build: update copyright year to 2022 (#136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/.jsdoc.js | 4 ++-- .../v1/assured_workloads_service.create_workload.js | 4 ++-- .../v1/assured_workloads_service.delete_workload.js | 4 ++-- .../generated/v1/assured_workloads_service.get_workload.js | 4 ++-- .../v1/assured_workloads_service.list_workloads.js | 6 +++--- .../v1/assured_workloads_service.update_workload.js | 4 ++-- .../v1beta1/assured_workloads_service.create_workload.js | 4 ++-- .../v1beta1/assured_workloads_service.delete_workload.js | 4 ++-- .../v1beta1/assured_workloads_service.get_workload.js | 4 ++-- .../v1beta1/assured_workloads_service.list_workloads.js | 6 +++--- .../v1beta1/assured_workloads_service.update_workload.js | 4 ++-- .../src/v1/assured_workloads_service_client.ts | 2 +- packages/google-cloud-assuredworkloads/src/v1/index.ts | 2 +- .../src/v1beta1/assured_workloads_service_client.ts | 2 +- packages/google-cloud-assuredworkloads/src/v1beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-assuredworkloads/system-test/install.ts | 2 +- .../test/gapic_assured_workloads_service_v1.ts | 2 +- .../test/gapic_assured_workloads_service_v1beta1.ts | 2 +- 20 files changed, 33 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.jsdoc.js b/packages/google-cloud-assuredworkloads/.jsdoc.js index e7da941cb9b..0590bc69992 100644 --- a/packages/google-cloud-assuredworkloads/.jsdoc.js +++ b/packages/google-cloud-assuredworkloads/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/assured-workloads', diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index 3cc9f0f9bc8..3906e8748e2 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, workload) { @@ -37,8 +38,7 @@ function main(parent, workload) { // const externalId = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js index d43cd42f3cd..8a2f3965f79 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -32,8 +33,7 @@ function main(name) { // const etag = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index af87a586956..5c7c32b50ed 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -29,8 +30,7 @@ function main(name) { // const name = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js index 057363c6454..cc6d0b6b6a0 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -41,8 +42,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); @@ -56,7 +56,7 @@ function main(parent) { // Run request const iterable = await assuredworkloadsClient.listWorkloadsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index a07a60cd9e6..0bd8e30e37a 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(workload, updateMask) { @@ -32,8 +33,7 @@ function main(workload, updateMask) { // const updateMask = {} // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index d58ddaf56cb..dec8d8689fc 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, workload) { @@ -37,8 +38,7 @@ function main(parent, workload) { // const externalId = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1beta1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js index a53ad1f6bc5..82d7874e4a6 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -32,8 +33,7 @@ function main(name) { // const etag = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1beta1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index a870b0258bb..352d5b4348a 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -29,8 +30,7 @@ function main(name) { // const name = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1beta1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js index f35b79400f7..e46ddcffda2 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -41,8 +42,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1beta1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); @@ -56,7 +56,7 @@ function main(parent) { // Run request const iterable = await assuredworkloadsClient.listWorkloadsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index 3a834a8fe26..0d9847617d7 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(workload, updateMask) { @@ -32,8 +33,7 @@ function main(workload, updateMask) { // const updateMask = {} // Imports the Assuredworkloads library - const {AssuredWorkloadsServiceClient} = - require('@google-cloud/assured-workloads').v1beta1; + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; // Instantiates a client const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 1f3a2fdcf4c..539334f19fd 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1/index.ts b/packages/google-cloud-assuredworkloads/src/v1/index.ts index 1a8d1fab704..12bd03b5380 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/index.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 9de8b90e365..b95827d6b7c 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts index 1a8d1fab704..12bd03b5380 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js index ad2f20501ed..0333febf723 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts index bd1fed47afb..80c0c3fe645 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/install.ts b/packages/google-cloud-assuredworkloads/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-assuredworkloads/system-test/install.ts +++ b/packages/google-cloud-assuredworkloads/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 6de6b2b4070..e60fbc78d55 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index a1bb990fbbf..a8ca20f3846 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 49ce832d2eeef34e0777c248a492630419f2c287 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 Jan 2022 01:12:15 +0100 Subject: [PATCH 077/116] chore(deps): update dependency gts to v3 (#134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [gts](https://togithub.com/google/gts) | [`^2.0.2` -> `^3.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.2/3.1.0) | [![age](https://badges.renovateapi.com/packages/npm/gts/3.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/gts/3.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/gts/3.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/gts/3.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gts ### [`v3.1.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​310-httpswwwgithubcomgooglegtscomparev303v310-2021-01-11) [Compare Source](https://togithub.com/google/gts/compare/v3.0.3...v3.1.0) ##### Features - support comments in JSON ([#​571](https://www.togithub.com/google/gts/issues/571)) ([cb6d2ca](https://www.github.com/google/gts/commit/cb6d2cacb5de7bcc9c8e82dd47e14fc5bf9596a3)) ##### Bug Fixes - **deps:** update dependency eslint-config-prettier to v7 ([#​601](https://www.togithub.com/google/gts/issues/601)) ([6e26681](https://www.github.com/google/gts/commit/6e266812da4b90b18e2abead9b2b5a1ca0c6654b)) - **deps:** upgrade to latest version of meow ([#​616](https://www.togithub.com/google/gts/issues/616)) ([634bad9](https://www.github.com/google/gts/commit/634bad9bbbdb4d397bba101dc38ab14881172a30)) ##### [3.0.3](https://www.github.com/google/gts/compare/v3.0.2...v3.0.3) (2020-12-03) ##### Bug Fixes - **deps:** update dependency execa to v5 ([#​600](https://www.togithub.com/google/gts/issues/600)) ([4e5f1e5](https://www.github.com/google/gts/commit/4e5f1e54facf53588bbb3b025b5240edbd7f3c8a)) - **deps:** update dependency meow to v8 ([#​591](https://www.togithub.com/google/gts/issues/591)) ([c7e223e](https://www.github.com/google/gts/commit/c7e223e6a2ff605fabad2f8359a0385033f8de66)) ##### [3.0.2](https://www.github.com/google/gts/compare/v3.0.1...v3.0.2) (2020-10-26) ##### Bug Fixes - **deps:** loosen ts peer dependency ([#​589](https://www.togithub.com/google/gts/issues/589)) ([8f1d381](https://www.github.com/google/gts/commit/8f1d381d7b166a510c42786c4a337e81b7222c84)) ##### [3.0.1](https://www.github.com/google/gts/compare/v3.0.0...v3.0.1) (2020-10-12) ##### Bug Fixes - **rule:** turn off [@​typescript-eslint/no-var-requires](https://togithub.com/typescript-eslint/no-var-requires) ([#​578](https://www.togithub.com/google/gts/issues/578)) ([3b37229](https://www.github.com/google/gts/commit/3b37229c45969a3c53af123c69bb749578ee6b0b)) ### [`v3.0.3`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​303-httpswwwgithubcomgooglegtscomparev302v303-2020-12-03) [Compare Source](https://togithub.com/google/gts/compare/v3.0.2...v3.0.3) ### [`v3.0.2`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​302-httpswwwgithubcomgooglegtscomparev301v302-2020-10-26) [Compare Source](https://togithub.com/google/gts/compare/v3.0.1...v3.0.2) ### [`v3.0.1`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​301-httpswwwgithubcomgooglegtscomparev300v301-2020-10-12) [Compare Source](https://togithub.com/google/gts/compare/v3.0.0...v3.0.1) ### [`v3.0.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​300-httpswwwgithubcomgooglegtscomparev202v300-2020-10-08) [Compare Source](https://togithub.com/google/gts/compare/v2.0.2...v3.0.0) ##### ⚠ BREAKING CHANGES - change default `check` to `lint` ([#​570](https://togithub.com/google/gts/issues/570)) - **deps:** require TypeScript 4.x ([#​565](https://togithub.com/google/gts/issues/565)) ##### Features - Add TypeScript v4 support ([#​551](https://www.togithub.com/google/gts/issues/551)) ([0883956](https://www.github.com/google/gts/commit/08839565a1d2b4b39d532c9b0b596f01b18856fe)) - change default `check` to `lint` ([#​570](https://www.togithub.com/google/gts/issues/570)) ([c527b66](https://www.github.com/google/gts/commit/c527b66be1ef6a78ea14b3d29225a8d7fb7097bd)) - generate .eslintignore when running init ([#​521](https://www.togithub.com/google/gts/issues/521)) ([8bce036](https://www.github.com/google/gts/commit/8bce0368767f0c2ad7d0700deb839962bc928d16)) ##### Bug Fixes - add build/.eslintrc.json to files field ([#​553](https://www.togithub.com/google/gts/issues/553)) ([3b516ad](https://www.github.com/google/gts/commit/3b516ad5e9f0d58201dde469461db7c6ed1c1b78)) - **deps:** require TypeScript 4.x ([#​565](https://www.togithub.com/google/gts/issues/565)) ([cbc5267](https://www.github.com/google/gts/commit/cbc5267579ef24e8c8ceaa2ef794df3ef54ea56a)) - **deps:** update dependency update-notifier to v5 ([#​574](https://www.togithub.com/google/gts/issues/574)) ([9a882bf](https://www.github.com/google/gts/commit/9a882bf4ac30ad06e7b91a65ad5721d8e8b41c4b)) - **deps:** update typescript-eslint monorepo to v2.34.0 ([#​509](https://www.togithub.com/google/gts/issues/509)) ([998a4ac](https://www.github.com/google/gts/commit/998a4ac9b75c97f04d8e5db37563f32d31652f23)) - **deps:** update typescript-eslint monorepo to v3 (major) ([#​528](https://www.togithub.com/google/gts/issues/528)) ([e22e173](https://www.github.com/google/gts/commit/e22e17338db2ddb7eb829c821037c2f4e77ff869)) - **deps:** update typescript-eslint monorepo to v4 ([#​556](https://www.togithub.com/google/gts/issues/556)) ([54148df](https://www.github.com/google/gts/commit/54148dfbd8b5f8b36a0f44f901c5db933393a661)) - better error message for broken tsconfig.json ([#​501](https://www.togithub.com/google/gts/issues/501)) ([0c17a76](https://www.github.com/google/gts/commit/0c17a76c6650eee1d8abaff11a897a432eeaa65f)) - prohibit calls for it.only and describe.only ([#​499](https://www.togithub.com/google/gts/issues/499)) ([071c33c](https://www.github.com/google/gts/commit/071c33ceef0e3765166aaebf6ed4698167ac0f98)) ##### [2.0.2](https://www.github.com/google/gts/compare/v2.0.1...v2.0.2) (2020-05-11) ##### Bug Fixes - Revert 'update dependency eslint to v7'" ([#​507](https://www.togithub.com/google/gts/issues/507)) ([0f9950b](https://www.github.com/google/gts/commit/0f9950b273329dbcce5f3cc20864c3dcd076f08c)) - **deps:** pin release of eslint-typescript ([#​508](https://www.togithub.com/google/gts/issues/508)) ([bd86b42](https://www.github.com/google/gts/commit/bd86b42e2bb904d3765dee82262e4691a11b9958)) - **deps:** update dependency eslint to v7 ([#​504](https://www.togithub.com/google/gts/issues/504)) ([6aee159](https://www.github.com/google/gts/commit/6aee1595d0486ae2c7fd68d16b1b59c4c4015753)) ##### [2.0.1](https://www.github.com/google/gts/compare/v2.0.0...v2.0.1) (2020-05-07) ##### Bug Fixes - throw an error if running with an unsupported version of nodejs ([#​493](https://www.togithub.com/google/gts/issues/493)) ([94fdf1e](https://www.github.com/google/gts/commit/94fdf1eaed634aa73c3e44c7a3d9f1325f773b07)) - **deps:** update dependency meow to v7 ([#​502](https://www.togithub.com/google/gts/issues/502)) ([cf91cda](https://www.github.com/google/gts/commit/cf91cda1afab25759427511d3c97d0037d61c649))
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index d91e721a022..13265a451ce 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -46,7 +46,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.0", - "gts": "^2.0.2", + "gts": "^3.0.0", "jsdoc": "^3.6.5", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", From b2c51ebeb62c330876f9c1aa43a9fa230109a0c3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:52:54 +0000 Subject: [PATCH 078/116] chore: update v2.12.0 gapic-generator-typescript (#138) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- .../linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/linkinator.config.json b/packages/google-cloud-assuredworkloads/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-assuredworkloads/linkinator.config.json +++ b/packages/google-cloud-assuredworkloads/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } From 99f47af7020e0c6da691d2c6e1b5c1c4c7ef72ac Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 17:02:54 +0100 Subject: [PATCH 079/116] chore(deps): update dependency sinon to v13 (#140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.1/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.1`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1301) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.0...v13.0.1) - [`ec4223f9`](https://togithub.com/sinonjs/sinon/commit/ec4223f94076d809483e3c6a7536cfc1278dd3c9) Bump nise to fix [sinonjs/nise#​193](https://togithub.com/sinonjs/nise/issues/193) (Carl-Erik Kopseng) - [`f329a010`](https://togithub.com/sinonjs/sinon/commit/f329a01040bfa5a79e039419220b21eda56935d6) Add unimported to workflow ([#​2441](https://togithub.com/sinonjs/sinon/issues/2441)) (Morgan Roderick) - [`7f16cec9`](https://togithub.com/sinonjs/sinon/commit/7f16cec968c3c8d4e580267fb00195916d6f827d) Enable updates to same major version (Carl-Erik Kopseng) - [`f784d7ad`](https://togithub.com/sinonjs/sinon/commit/f784d7ad2c86be0fc65477d69f8bdafca846ef2c) Re-introduce new version.sh script to version hook (Joel Bradshaw) > This was inadvertently removed during merge conflicts, and is required > for any of the new release process stuff to work - [`51c508ab`](https://togithub.com/sinonjs/sinon/commit/51c508ab77cf0f9fb8c5305ff626f6a2eada178f) Add dry run mode to `npm version` ([#​2436](https://togithub.com/sinonjs/sinon/issues/2436)) (Joel Bradshaw) > - Add DRY_RUN flag to skip publish/push > > - Allow overriding branch names for testing - [`05341dcf`](https://togithub.com/sinonjs/sinon/commit/05341dcf92ddca4a1d4c90966b1fcdc7039cff18) Update npm version scripts to manage new releases branch (Joel Bradshaw) - [`fe658261`](https://togithub.com/sinonjs/sinon/commit/fe65826171db69ed2986a1060db77944dbc98a6d) Remove release archives from master (Joel Bradshaw) > These archives made it difficult to find things in the GitHub interface, > and take up a lot of space in a checked-out repo for something that is > not useful to most people checking out the repository. > > The main purpose of these archives is to make old versions and > documentation available on the Sinon website that is run out of this > repo. This can be supported by using a separate branch for website > releases, and to maintain the archives. > > Following this commit, the `npm version` scripts will be updated to > automatically handle archiving the releases in the new releases branch > and keeping it up to date with master. > > Also remove the directories we removed from .prettierignore, since they > don't exist any more. *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-02-01.* ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 13265a451ce..4cbb646ab2a 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -54,7 +54,7 @@ "mocha": "^8.1.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "^3.9.7", "webpack": "^5.0.0", From f1a44b1f425c4c390dd7e345ec5def2f92678186 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:06:52 +0000 Subject: [PATCH 080/116] docs(nodejs): version support policy edits (#1346) (#142) --- .../google-cloud-assuredworkloads/README.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 9071e40bd2c..e53f28e2f90 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -99,21 +99,21 @@ also contains samples. Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/assured-workloads@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 94a1f5c0b1a35cb12f4dfdd0c3579fbe331e20b4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:07:00 +0000 Subject: [PATCH 081/116] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#143) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- ...sured_workloads_service.create_workload.js | 9 +- ...sured_workloads_service.delete_workload.js | 9 +- .../assured_workloads_service.get_workload.js | 9 +- ...ssured_workloads_service.list_workloads.js | 9 +- ...sured_workloads_service.update_workload.js | 9 +- ...data.google.cloud.assuredworkloads.v1.json | 243 ++++++++++++++++++ ...sured_workloads_service.create_workload.js | 9 +- ...sured_workloads_service.delete_workload.js | 9 +- .../assured_workloads_service.get_workload.js | 9 +- ...ssured_workloads_service.list_workloads.js | 9 +- ...sured_workloads_service.update_workload.js | 9 +- ...google.cloud.assuredworkloads.v1beta1.json | 243 ++++++++++++++++++ .../v1/assured_workloads_service_client.ts | 5 +- .../assured_workloads_service_client.ts | 5 +- .../gapic_assured_workloads_service_v1.ts | 72 +++++- ...gapic_assured_workloads_service_v1beta1.ts | 78 +++++- 16 files changed, 706 insertions(+), 30 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index 3906e8748e2..fb5e168efb3 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js index 8a2f3965f79..4aae26694ea 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index 5c7c32b50ed..9f7c7adac0f 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js index cc6d0b6b6a0..0a3312d172c 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index 0bd8e30e37a..d0d3aaa3d98 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json new file mode 100644 index 00000000000..e94a49941c5 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -0,0 +1,243 @@ +{ + "clientLibrary": { + "name": "nodejs-assuredworkloads", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.assuredworkloads.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async", + "title": "AssuredWorkloadsService createWorkload Sample", + "origin": "API_DEFINITION", + "description": " Creates Assured Workload.", + "canonical": true, + "file": "assured_workloads_service.create_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1.Workload" + }, + { + "name": "external_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async", + "title": "AssuredWorkloadsService updateWorkload Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", + "canonical": true, + "file": "assured_workloads_service.update_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", + "async": true, + "parameters": [ + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1.Workload" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async", + "title": "AssuredWorkloadsService deleteWorkload Sample", + "origin": "API_DEFINITION", + "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", + "canonical": true, + "file": "assured_workloads_service.delete_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async", + "title": "AssuredWorkloadsService getWorkload Sample", + "origin": "API_DEFINITION", + "description": " Gets Assured Workload associated with a CRM Node", + "canonical": true, + "file": "assured_workloads_service.get_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async", + "title": "AssuredWorkloadsService listWorkloads Sample", + "origin": "API_DEFINITION", + "description": " Lists Assured Workloads under a CRM Node.", + "canonical": true, + "file": "assured_workloads_service.list_workloads.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.ListWorkloadsResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index dec8d8689fc..d6dd9f58917 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js index 82d7874e4a6..37dde8c268c 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index 352d5b4348a..49b922b434d 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js index e46ddcffda2..feb34a42c2a 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index 0d9847617d7..9cf962f5394 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json new file mode 100644 index 00000000000..edebb9daa22 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -0,0 +1,243 @@ +{ + "clientLibrary": { + "name": "nodejs-assuredworkloads", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.assuredworkloads.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async", + "title": "AssuredWorkloadsService createWorkload Sample", + "origin": "API_DEFINITION", + "description": " Creates Assured Workload.", + "canonical": true, + "file": "assured_workloads_service.create_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1beta1.Workload" + }, + { + "name": "external_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async", + "title": "AssuredWorkloadsService updateWorkload Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", + "canonical": true, + "file": "assured_workloads_service.update_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", + "async": true, + "parameters": [ + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1beta1.Workload" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async", + "title": "AssuredWorkloadsService deleteWorkload Sample", + "origin": "API_DEFINITION", + "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", + "canonical": true, + "file": "assured_workloads_service.delete_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async", + "title": "AssuredWorkloadsService getWorkload Sample", + "origin": "API_DEFINITION", + "description": " Gets Assured Workload associated with a CRM Node", + "canonical": true, + "file": "assured_workloads_service.get_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async", + "title": "AssuredWorkloadsService listWorkloads Sample", + "origin": "API_DEFINITION", + "description": " Lists Assured Workloads under a CRM Node.", + "canonical": true, + "file": "assured_workloads_service.list_workloads.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + } + ] +} diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 539334f19fd..9917d1900ac 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -1136,9 +1136,8 @@ export class AssuredWorkloadsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assuredWorkloadsServiceStub!.then(stub => { + if (this.assuredWorkloadsServiceStub && !this._terminated) { + return this.assuredWorkloadsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index b95827d6b7c..3e7c04db11a 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -1142,9 +1142,8 @@ export class AssuredWorkloadsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.assuredWorkloadsServiceStub!.then(stub => { + if (this.assuredWorkloadsServiceStub && !this._terminated) { + return this.assuredWorkloadsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index e60fbc78d55..320ed05b69d 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -191,13 +191,29 @@ describe('v1.AssuredWorkloadsServiceClient', () => { assert(client.assuredWorkloadsServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assuredWorkloadsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -351,6 +367,24 @@ describe('v1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateWorkload(request), expectedError); + }); }); describe('deleteWorkload', () => { @@ -465,6 +499,23 @@ describe('v1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkload(request), expectedError); + }); }); describe('getWorkload', () => { @@ -579,6 +630,23 @@ describe('v1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkload(request), expectedError); + }); }); describe('createWorkload', () => { diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index a8ca20f3846..4d561851687 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -191,13 +191,29 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { assert(client.assuredWorkloadsServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.assuredWorkloadsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -357,6 +373,26 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes updateWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() + ); + request.workload = {}; + request.workload.name = ''; + const expectedHeaderRequestParams = 'workload.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateWorkload(request), expectedError); + }); }); describe('deleteWorkload', () => { @@ -477,6 +513,25 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes deleteWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkload(request), expectedError); + }); }); describe('getWorkload', () => { @@ -597,6 +652,25 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getWorkload with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkload(request), expectedError); + }); }); describe('createWorkload', () => { From 95dcb2fe6e5cbd0201fdd685026e315b702ddc2e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Mar 2022 21:14:40 -0700 Subject: [PATCH 082/116] chore: update v2.14.2 gapic-generator-typescript (#147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update v2.14.2 gapic-generator-typescript Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 * 🦉 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 --- .../test/gapic_assured_workloads_service_v1.ts | 3 --- .../test/gapic_assured_workloads_service_v1beta1.ts | 3 --- 2 files changed, 6 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 320ed05b69d..169f2fe6284 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -380,7 +380,6 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ); request.workload = {}; request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateWorkload(request), expectedError); @@ -511,7 +510,6 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteWorkload(request), expectedError); @@ -642,7 +640,6 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getWorkload(request), expectedError); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 4d561851687..058a0e19ade 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -388,7 +388,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); request.workload = {}; request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateWorkload(request), expectedError); @@ -527,7 +526,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteWorkload(request), expectedError); @@ -666,7 +664,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getWorkload(request), expectedError); From bc6dd594607269b1204d81c7521a4ca7f48db572 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 23 Mar 2022 13:50:18 -0700 Subject: [PATCH 083/116] feat: promote to stable (#148) Fixes #3 --- .../google-cloud-assuredworkloads/.repo-metadata.json | 2 +- packages/google-cloud-assuredworkloads/README.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index 0974a820f7d..b275a226d35 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -2,7 +2,7 @@ "client_documentation": "https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest", "api_id": "assuredworkloads.googleapis.com", "distribution_name": "@google-cloud/assured-workloads", - "release_level": "preview", + "release_level": "stable", "default_version": "v1", "language": "nodejs", "name_pretty": "Assured Workloads for Government", diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index e53f28e2f90..7dd3fce1e1d 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -4,7 +4,7 @@ # [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) -[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) @@ -121,13 +121,14 @@ This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. -This library is considered to be in **preview**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From 4334d876326ba5f4a18d9b31f55de8c450586862 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:58:20 +0000 Subject: [PATCH 084/116] chore(main): release 2.2.0 (#149) :robot: I have created a release *beep* *boop* --- ## [2.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v2.1.0...v2.2.0) (2022-03-23) ### Features * promote to stable ([#148](https://github.com/googleapis/nodejs-assured-workloads/issues/148)) ([464f0b8](https://github.com/googleapis/nodejs-assured-workloads/commit/464f0b8157c35c0bd68f39ca757844fb83d00032)), closes [#3](https://github.com/googleapis/nodejs-assured-workloads/issues/3) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 113d54a2996..f1288d43209 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v2.1.0...v2.2.0) (2022-03-23) + + +### Features + +* promote to stable ([#148](https://github.com/googleapis/nodejs-assured-workloads/issues/148)) ([464f0b8](https://github.com/googleapis/nodejs-assured-workloads/commit/464f0b8157c35c0bd68f39ca757844fb83d00032)), closes [#3](https://github.com/googleapis/nodejs-assured-workloads/issues/3) + ## [2.1.0](https://www.github.com/googleapis/nodejs-assured-workloads/compare/v2.0.0...v2.1.0) (2021-12-10) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 4cbb646ab2a..ca74b38cd10 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "2.1.0", + "version": "2.2.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 6f95f4dd24d..508914abb52 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^2.1.0" + "@google-cloud/assured-workloads": "^2.2.0" }, "devDependencies": { "c8": "^7.3.0", From 397117528a71ea69ef8214c142fb456f07d873eb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:30:44 -0700 Subject: [PATCH 085/116] build(node): update client library version in samples metadata (#1356) (#156) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- ...data.google.cloud.assuredworkloads.v1.json | 464 +++++++++--------- ...google.cloud.assuredworkloads.v1beta1.json | 464 +++++++++--------- 2 files changed, 464 insertions(+), 464 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index e94a49941c5..f997f109d0f 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,243 +1,243 @@ { - "clientLibrary": { - "name": "nodejs-assuredworkloads", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.assuredworkloads.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async", - "title": "AssuredWorkloadsService createWorkload Sample", - "origin": "API_DEFINITION", - "description": " Creates Assured Workload.", - "canonical": true, - "file": "assured_workloads_service.create_workload.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workload", - "type": ".google.cloud.assuredworkloads.v1.Workload" - }, - { - "name": "external_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" - }, - "method": { - "shortName": "CreateWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" - } - } - } + "clientLibrary": { + "name": "nodejs-assuredworkloads", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.assuredworkloads.v1", + "version": "v1" + } + ] }, - { - "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async", - "title": "AssuredWorkloadsService updateWorkload Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", - "canonical": true, - "file": "assured_workloads_service.update_workload.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", - "async": true, - "parameters": [ - { - "name": "workload", - "type": ".google.cloud.assuredworkloads.v1.Workload" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1.Workload", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_async", + "title": "AssuredWorkloadsService createWorkload Sample", + "origin": "API_DEFINITION", + "description": " Creates Assured Workload.", + "canonical": true, + "file": "assured_workloads_service.create_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1.Workload" + }, + { + "name": "external_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.CreateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "UpdateWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async", - "title": "AssuredWorkloadsService deleteWorkload Sample", - "origin": "API_DEFINITION", - "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", - "canonical": true, - "file": "assured_workloads_service.delete_workload.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_async", + "title": "AssuredWorkloadsService updateWorkload Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", + "canonical": true, + "file": "assured_workloads_service.update_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", + "async": true, + "parameters": [ + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1.Workload" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.UpdateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "DeleteWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async", - "title": "AssuredWorkloadsService getWorkload Sample", - "origin": "API_DEFINITION", - "description": " Gets Assured Workload associated with a CRM Node", - "canonical": true, - "file": "assured_workloads_service.get_workload.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1.Workload", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async", + "title": "AssuredWorkloadsService deleteWorkload Sample", + "origin": "API_DEFINITION", + "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", + "canonical": true, + "file": "assured_workloads_service.delete_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.DeleteWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "GetWorkload", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async", - "title": "AssuredWorkloadsService listWorkloads Sample", - "origin": "API_DEFINITION", - "description": " Lists Assured Workloads under a CRM Node.", - "canonical": true, - "file": "assured_workloads_service.list_workloads.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkloads", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1.ListWorkloadsResponse", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_async", + "title": "AssuredWorkloadsService getWorkload Sample", + "origin": "API_DEFINITION", + "description": " Gets Assured Workload associated with a CRM Node", + "canonical": true, + "file": "assured_workloads_service.get_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "ListWorkloads", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" - } + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_async", + "title": "AssuredWorkloadsService listWorkloads Sample", + "origin": "API_DEFINITION", + "description": " Lists Assured Workloads under a CRM Node.", + "canonical": true, + "file": "assured_workloads_service.list_workloads.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.ListWorkloadsResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListWorkloads", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index edebb9daa22..a1444f6e6c0 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,243 +1,243 @@ { - "clientLibrary": { - "name": "nodejs-assuredworkloads", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.assuredworkloads.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async", - "title": "AssuredWorkloadsService createWorkload Sample", - "origin": "API_DEFINITION", - "description": " Creates Assured Workload.", - "canonical": true, - "file": "assured_workloads_service.create_workload.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workload", - "type": ".google.cloud.assuredworkloads.v1beta1.Workload" - }, - { - "name": "external_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" - }, - "method": { - "shortName": "CreateWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } - } - } + "clientLibrary": { + "name": "nodejs-assuredworkloads", + "version": "2.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.assuredworkloads.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async", - "title": "AssuredWorkloadsService updateWorkload Sample", - "origin": "API_DEFINITION", - "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", - "canonical": true, - "file": "assured_workloads_service.update_workload.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", - "async": true, - "parameters": [ - { - "name": "workload", - "type": ".google.cloud.assuredworkloads.v1beta1.Workload" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_async", + "title": "AssuredWorkloadsService createWorkload Sample", + "origin": "API_DEFINITION", + "description": " Creates Assured Workload.", + "canonical": true, + "file": "assured_workloads_service.create_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1beta1.Workload" + }, + { + "name": "external_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "CreateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "UpdateWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async", - "title": "AssuredWorkloadsService deleteWorkload Sample", - "origin": "API_DEFINITION", - "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", - "canonical": true, - "file": "assured_workloads_service.delete_workload.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "etag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_async", + "title": "AssuredWorkloadsService updateWorkload Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", + "canonical": true, + "file": "assured_workloads_service.update_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", + "async": true, + "parameters": [ + { + "name": "workload", + "type": ".google.cloud.assuredworkloads.v1beta1.Workload" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "UpdateWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "DeleteWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async", - "title": "AssuredWorkloadsService getWorkload Sample", - "origin": "API_DEFINITION", - "description": " Gets Assured Workload associated with a CRM Node", - "canonical": true, - "file": "assured_workloads_service.get_workload.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async", + "title": "AssuredWorkloadsService deleteWorkload Sample", + "origin": "API_DEFINITION", + "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", + "canonical": true, + "file": "assured_workloads_service.delete_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "DeleteWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "GetWorkload", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } - } - } - }, - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async", - "title": "AssuredWorkloadsService listWorkloads Sample", - "origin": "API_DEFINITION", - "description": " Lists Assured Workloads under a CRM Node.", - "canonical": true, - "file": "assured_workloads_service.list_workloads.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkloads", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_async", + "title": "AssuredWorkloadsService getWorkload Sample", + "origin": "API_DEFINITION", + "description": " Gets Assured Workload associated with a CRM Node", + "canonical": true, + "file": "assured_workloads_service.get_workload.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.Workload", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "GetWorkload", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkload", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } }, - "method": { - "shortName": "ListWorkloads", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async", + "title": "AssuredWorkloadsService listWorkloads Sample", + "origin": "API_DEFINITION", + "description": " Lists Assured Workloads under a CRM Node.", + "canonical": true, + "file": "assured_workloads_service.list_workloads.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "ListWorkloads", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloads", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 294864c3343f10820f0e5a24ee8683aceb0f847b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 03:24:26 +0200 Subject: [PATCH 086/116] chore(deps): update dependency @types/mocha to v9 (#157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.3` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index ca74b38cd10..c056a885a48 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -42,7 +42,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.3", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.0", From 4958caf4bf56fca27145ed8836020a1efa95e5fe Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:42:23 +0200 Subject: [PATCH 087/116] chore(deps): update dependency sinon to v14 (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **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 [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index c056a885a48..d30227bed3a 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -54,7 +54,7 @@ "mocha": "^8.1.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "^3.9.7", "webpack": "^5.0.0", From 65d7ee8599145c22a08804ec98b467cde78b0b21 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 18:45:37 -0700 Subject: [PATCH 088/116] build!: update library to use Node 12 (#162) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/package.json | 10 +++++----- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index d30227bed3a..78884a5904c 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,28 +39,28 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.6.5", "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.1.2", - "mocha": "^8.1.2", + "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.0.0", - "typescript": "^3.9.7", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 508914abb52..5f518475923 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 6e9d2fadaa2e9deedc684cfb484aec580cff5139 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 11:57:22 -0400 Subject: [PATCH 089/116] chore(main): release 3.0.0 (#163) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- ...pet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...etadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index f1288d43209..6fb48b4357f 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [3.0.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v2.2.0...v3.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#162) + +### Build System + +* update library to use Node 12 ([#162](https://github.com/googleapis/nodejs-assured-workloads/issues/162)) ([fab651b](https://github.com/googleapis/nodejs-assured-workloads/commit/fab651b66009a9d747e3a207544c2a5e41a1576c)) + ## [2.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v2.1.0...v2.2.0) (2022-03-23) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 78884a5904c..bff60c98379 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "2.2.0", + "version": "3.0.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index f997f109d0f..a070b3f8eac 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "2.2.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index a1444f6e6c0..a7d587c0fd0 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "2.2.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 5f518475923..6397775b626 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^2.2.0" + "@google-cloud/assured-workloads": "^3.0.0" }, "devDependencies": { "c8": "^7.3.0", From 9da60a972b2f5568d79e0afe6083c731a1814094 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:06:12 +0200 Subject: [PATCH 090/116] chore(deps): update dependency jsdoc-fresh to v2 (#166) 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 | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### 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-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index bff60c98379..e5013584353 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -48,7 +48,7 @@ "c8": "^7.3.0", "gts": "^3.1.0", "jsdoc": "^3.6.5", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^1.0.4", "linkinator": "^2.1.2", "mocha": "^9.2.2", From 5afe7f215b824cd081b4da23504f74179f030c2a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:28:11 +0200 Subject: [PATCH 091/116] chore(deps): update dependency jsdoc-region-tag to v2 (#167) 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 | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.4` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### 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-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index e5013584353..c9e8b86d2ba 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -49,7 +49,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.5", "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^1.0.4", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.1.2", "mocha": "^9.2.2", "null-loader": "^4.0.0", From 43d893a95c93a90446c13d5056a6772335be1e38 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:01:33 -0700 Subject: [PATCH 092/116] feat: Removed _v1beta1 suffix from proto file names (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Removed _v1beta1 suffix from proto file names BREAKING CHANGE: proto file name is changed from assuredworkloads_v1beta1.proto to assuredworkloads.proto PiperOrigin-RevId: 454705538 Source-Link: https://github.com/googleapis/googleapis/commit/cf681da4ed81542d38210228e84ed64a02d25604 Source-Link: https://github.com/googleapis/googleapis-gen/commit/988099009f8094b9c2f3efd773a12696c93c8e38 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTg4MDk5MDA5ZjgwOTRiOWMyZjNlZmQ3NzNhMTI2OTZjOTNjOGUzOCJ9 * 🦉 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 --- .../v1beta1/assuredworkloads.proto | 554 ++++++++++++++++++ .../assured_workloads_service_proto_list.json | 2 +- 2 files changed, 555 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto new file mode 100644 index 00000000000..2845b2ec0ad --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -0,0 +1,554 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.assuredworkloads.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads"; +option java_multiple_files = true; +option java_outer_classname = "AssuredworkloadsProto"; +option java_package = "com.google.cloud.assuredworkloads.v1beta1"; +option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1beta1"; +option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1"; +option (google.api.resource_definition) = { + type: "assuredworkloads.googleapis.com/Location" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service to manage AssuredWorkloads. +service AssuredWorkloadsService { + option (google.api.default_host) = "assuredworkloads.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates Assured Workload. + rpc CreateWorkload(CreateWorkloadRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + body: "workload" + }; + option (google.api.method_signature) = "parent,workload"; + option (google.longrunning.operation_info) = { + response_type: "Workload" + metadata_type: "CreateWorkloadOperationMetadata" + }; + } + + // Updates an existing workload. + // Currently allows updating of workload display_name and labels. + // For force updates don't set etag field in the Workload. + // Only one update operation per workload can be in progress. + rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { + option (google.api.http) = { + patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" + body: "workload" + }; + option (google.api.method_signature) = "workload,update_mask"; + } + + // Deletes the workload. Make sure that workload's direct children are already + // in a deleted state, otherwise the request will fail with a + // FAILED_PRECONDITION error. + rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets Assured Workload associated with a CRM Node + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.http) = { + get: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists Assured Workloads under a CRM Node. + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for creating a workload. +message CreateWorkloadRequest { + // Required. The resource name of the new Workload's parent. + // Must be of the form `organizations/{org_id}/locations/{location_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Required. Assured Workload to create + Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A identifier associated with the workload and underlying projects + // which allows for the break down of billing costs for a workload. The value + // provided for the identifier will add a label to the workload and contained + // projects with the identifier as the value. + string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for Updating a workload. +message UpdateWorkloadRequest { + // Required. The workload to update. + // The workload’s `name` field is used to identify the workload to be updated. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for deleting a Workload. +message DeleteWorkloadRequest { + // Required. The `name` field is used to identify the workload. + // Format: + // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Optional. The etag of the workload. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for fetching a workload. +message GetWorkloadRequest { + // Required. The resource name of the Workload to fetch. This is the + // workloads's relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Workload" + } + ]; +} + +// Request for fetching workloads in an organization. +message ListWorkloadsRequest { + // Required. Parent Resource to list workloads from. + // Must be of the form `organizations/{org_id}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Workload" + } + ]; + + // Page size. + int32 page_size = 2; + + // Page token returned from previous request. Page token contains context from + // previous request. Page token needs to be passed in the second and following + // requests. + string page_token = 3; + + // A custom filter for filtering by properties of a workload. At this time, + // only filtering by labels is supported. + string filter = 4; +} + +// Response of ListWorkloads endpoint. +message ListWorkloadsResponse { + // List of Workloads under a given parent. + repeated Workload workloads = 1; + + // The next page token. Return empty if reached the last page. + string next_page_token = 2; +} + +// An Workload object for managing highly regulated workloads of cloud +// customers. +message Workload { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Workload" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}" + }; + + // Represent the resources that are children of this Workload. + message ResourceInfo { + // The type of resource. + enum ResourceType { + // Unknown resource type. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Deprecated. Existing workloads will continue to support this, but new + // CreateWorkloadRequests should not specify this as an input value. + CONSUMER_PROJECT = 1 [deprecated = true]; + + // Consumer Folder. + CONSUMER_FOLDER = 4; + + // Consumer project containing encryption keys. + ENCRYPTION_KEYS_PROJECT = 2; + + // Keyring resource that hosts encryption keys. + KEYRING = 3; + } + + // Resource identifier. + // For a project this represents project_number. + int64 resource_id = 1; + + // Indicates the type of resource. + ResourceType resource_type = 2; + } + + // Settings specific to the Key Management Service. + message KMSSettings { + // Required. Input only. Immutable. The time at which the Key Management + // Service will automatically create a new version of the crypto key and + // mark it as the primary. + google.protobuf.Timestamp next_rotation_time = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. [next_rotation_time] will be advanced by + // this period when the Key Management Service automatically rotates a key. + // Must be at least 24 hours and at most 876,000 hours. + google.protobuf.Duration rotation_period = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for IL4. + message IL4Settings { + option deprecated = true; + + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for CJIS. + message CJISSettings { + option deprecated = true; + + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP High. + message FedrampHighSettings { + option deprecated = true; + + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Settings specific to resources needed for FedRAMP Moderate. + message FedrampModerateSettings { + option deprecated = true; + + // Required. Input only. Immutable. Settings used to create a CMEK crypto + // key. + KMSSettings kms_settings = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Represent the custom settings for the resources to be created. + message ResourceSettings { + // Resource identifier. + // For a project this represents project_id. If the project is already + // taken, the workload creation will fail. + string resource_id = 1; + + // Indicates the type of resource. This field should be specified to + // correspond the id to the right project type (CONSUMER_PROJECT or + // ENCRYPTION_KEYS_PROJECT) + ResourceInfo.ResourceType resource_type = 2; + + // User-assigned resource display name. + // If not empty it will be used to create a resource with the specified + // name. + string display_name = 3; + } + + // Signed Access Approvals (SAA) enrollment response. + message SaaEnrollmentResponse { + // Setup state of SAA enrollment. + enum SetupState { + // Unspecified. + SETUP_STATE_UNSPECIFIED = 0; + // SAA enrollment pending. + STATUS_PENDING = 1; + // SAA enrollment comopleted. + STATUS_COMPLETE = 2; + } + + // Setup error of SAA enrollment. + enum SetupError { + // Unspecified. + SETUP_ERROR_UNSPECIFIED = 0; + // Invalid states for all customers, to be redirected to AA UI for + // additional details. + ERROR_INVALID_BASE_SETUP = 1; + // Returned when there is not an EKM key configured. + ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + // Returned when there are no enrolled services or the customer is + // enrolled in CAA only for a subset of services. + ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + // Returned when exception was encountered during evaluation of other + // criteria. + ERROR_SETUP_CHECK_FAILED = 4; + } + + // Indicates SAA enrollment status of a given workload. + optional SetupState setup_status = 1; + + // Indicates SAA enrollment setup error if any. + repeated SetupError setup_errors = 2; + } + + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; + } + + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + + // Optional. The resource name of the workload. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload} + // + // Read-only. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The user-assigned display name of the Workload. + // When present it must be between 4 to 30 characters. + // Allowed characters are: lowercase and uppercase letters, numbers, + // hyphen, and spaces. + // + // Example: My Workload + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The resources associated with this workload. + // These resources will be created when creating the workload. + // If any of the projects already exist, the workload creation will fail. + // Always read only. + repeated ResourceInfo resources = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Immutable. Compliance Regime associated with this workload. + ComplianceRegime compliance_regime = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. The Workload creation timestamp. + google.protobuf.Timestamp create_time = 5 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Input only. The billing account used for the resources which are + // direct children of workload. This billing account is initially associated + // with the resources created as part of Workload creation. + // After the initial creation of these resources, the customer can change + // the assigned billing account. + // The resource name has the form + // `billingAccounts/{billing_account_id}`. For example, + // `billingAccounts/012345-567890-ABCDEF`. + string billing_account = 6 [(google.api.field_behavior) = INPUT_ONLY]; + + // Settings specific to the selected [compliance_regime] + oneof compliance_regime_settings { + // Required. Input only. Immutable. Settings specific to resources needed + // for IL4. + IL4Settings il4_settings = 7 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed + // for CJIS. + CJISSettings cjis_settings = 8 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed + // for FedRAMP High. + FedrampHighSettings fedramp_high_settings = 11 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Input only. Immutable. Settings specific to resources needed + // for FedRAMP Moderate. + FedrampModerateSettings fedramp_moderate_settings = 12 [ + deprecated = true, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Optional. ETag of the workload, it is calculated on the basis + // of the Workload contents. It will be used in Update & Delete operations. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels applied to the workload. + map labels = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Input only. The parent resource for the resources managed by this Assured + // Workload. May be either empty or a folder resource which is a child of the + // Workload parent. If not specified all resources are created under the + // parent organization. + // Format: + // folders/{folder_id} + string provisioned_resources_parent = 13 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set a project + // with a KMS CMEK key is provisioned. This field is mandatory for a subset of + // Compliance Regimes. + KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Resource properties that are used to customize workload + // resources. These properties (such as custom project id) will be used to + // create workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Output only. Represents the KAJ enrollment state of the given workload. + KajEnrollmentState kaj_enrollment_state = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Indicates the sovereignty status of the given workload. + // Currently meant to be used by Europe/Canada customers. + bool enable_sovereign_controls = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Represents the SAA enrollment response of the given workload. + // SAA enrollment response is queried during GetWorkload call. + // In failure cases, user friendly error message is shown in SAA details page. + SaaEnrollmentResponse saa_enrollment_response = 20 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Operation metadata to give request details of CreateWorkload. +message CreateWorkloadOperationMetadata { + // Optional. Time when the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The display name of the workload. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The parent of the workload. + string parent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Compliance controls that should be applied to the resources + // managed by the workload. + Workload.ComplianceRegime compliance_regime = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource properties in the input that are used for + // creating/customizing workload resources. + repeated Workload.ResourceSettings resource_settings = 5 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json index 42e23062aa0..d2953e3b11d 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json @@ -1,3 +1,3 @@ [ - "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_v1beta1.proto" + "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto" ] From f7e4d68a1ce1ebc7d926cefe300d37a4155beb81 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:34:03 -0700 Subject: [PATCH 093/116] chore(main): release 3.1.0 (#171) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../snippet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...pet_metadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 6fb48b4357f..daba3a08f7b 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.1.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.0.0...v3.1.0) (2022-06-16) + + +### Features + +* proto file name is changed from assuredworkloads_v1beta1.proto to assuredworkloads.proto ([e1ff7cd](https://github.com/googleapis/nodejs-assured-workloads/commit/e1ff7cd5272c99a5824a0319ab0aec73135aa667)) + ## [3.0.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v2.2.0...v3.0.0) (2022-05-19) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index c9e8b86d2ba..f0f5624ce8c 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.0.0", + "version": "3.1.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index a070b3f8eac..feb8979b1e3 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index a7d587c0fd0..317ca4a4023 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 6397775b626..bd5d02e7d34 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.0.0" + "@google-cloud/assured-workloads": "^3.1.0" }, "devDependencies": { "c8": "^7.3.0", From 7c63056f7baaac17147847c9af3b4104bd9be197 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 16:39:56 -0400 Subject: [PATCH 094/116] feat: support regapic LRO (#172) PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/assured_workloads_service_client.ts | 36 ++++++++++++------- .../assured_workloads_service_client.ts | 36 ++++++++++++------- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 9917d1900ac..9a64b5b2123 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class AssuredWorkloadsServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class AssuredWorkloadsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * 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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -190,16 +190,28 @@ export class AssuredWorkloadsServiceClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=organizations/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=organizations/*/locations/*}/operations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createWorkloadResponse = protoFilesRoot.lookup( '.google.cloud.assuredworkloads.v1.Workload' diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 3e7c04db11a..114058c0807 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class AssuredWorkloadsServiceClient { * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] @@ -95,11 +96,10 @@ export class AssuredWorkloadsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * 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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -190,16 +190,28 @@ export class AssuredWorkloadsServiceClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=organizations/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=organizations/*/locations/*}/operations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createWorkloadResponse = protoFilesRoot.lookup( '.google.cloud.assuredworkloads.v1beta1.Workload' From 6c7c99ad60125c352afc0be51e6a1513fd3c000b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:08:21 +0000 Subject: [PATCH 095/116] chore(main): release 3.2.0 (#173) :robot: I have created a release *beep* *boop* --- ## [3.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.1.0...v3.2.0) (2022-06-29) ### Features * support regapic LRO ([#172](https://github.com/googleapis/nodejs-assured-workloads/issues/172)) ([d0dcdef](https://github.com/googleapis/nodejs-assured-workloads/commit/d0dcdefe8846cf0629a0aeca19c013b8ce53fc90)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../snippet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...pet_metadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index daba3a08f7b..158291231a4 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.1.0...v3.2.0) (2022-06-29) + + +### Features + +* support regapic LRO ([#172](https://github.com/googleapis/nodejs-assured-workloads/issues/172)) ([d0dcdef](https://github.com/googleapis/nodejs-assured-workloads/commit/d0dcdefe8846cf0629a0aeca19c013b8ce53fc90)) + ## [3.1.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.0.0...v3.1.0) (2022-06-16) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index f0f5624ce8c..24ee716afca 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.1.0", + "version": "3.2.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index feb8979b1e3..c5aff550edd 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 317ca4a4023..be1d6443b03 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.1.0", + "version": "3.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index bd5d02e7d34..26c419669c8 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.1.0" + "@google-cloud/assured-workloads": "^3.2.0" }, "devDependencies": { "c8": "^7.3.0", From 3beaf88dd22b7ade7980ab954230659ef7b56146 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 14:49:21 -0400 Subject: [PATCH 096/116] feat: ITAR June Preview Launch PiperOrigin-RevId: 458302463 Source-Link: https://github.com/googleapis/googleapis/commit/523fdaf19c9e4fc30e07ff49be6b9387a5a933ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/b3f1325af8bdfc19d92d34eec02e06cdbed14479 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjNmMTMyNWFmOGJkZmMxOWQ5MmQzNGVlYzAyZTA2Y2RiZWQxNDQ3OSJ9 Source-Link: https://github.com/googleapis/googleapis/commit/ae65014049c6eb195741d7efbd0b10bee3f83d4f Source-Link: https://github.com/googleapis/googleapis-gen/commit/b09ede435cce110446d4ab9f62a081b571d37e3f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjA5ZWRlNDM1Y2NlMTEwNDQ2ZDRhYjlmNjJhMDgxYjU3MWQzN2UzZiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/assuredworkloads.proto | 3 +++ .../v1beta1/assuredworkloads.proto | 3 +++ .../protos/protos.d.ts | 6 +++-- .../protos/protos.js | 24 +++++++++++++++++++ .../protos/protos.json | 6 +++-- 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 43cab1f99e8..9d4045e46d2 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -341,6 +341,9 @@ message Workload { // Assured Workloads For Canada Regions and Support controls CA_REGIONS_AND_SUPPORT = 9; + + // International Traffic in Arms Regulations + ITAR = 10; } // Key Access Justifications(KAJ) Enrollment State. diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto index 2845b2ec0ad..be0243f8bf9 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -391,6 +391,9 @@ message Workload { // Assured Workloads For Canada Regions and Support controls CA_REGIONS_AND_SUPPORT = 9; + + // International Traffic in Arms Regulations + ITAR = 10; } // Key Access Justifications(KAJ) Enrollment State. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 91d47593b99..513eafb300d 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1347,7 +1347,8 @@ export namespace google { HIPAA = 6, HITRUST = 7, EU_REGIONS_AND_SUPPORT = 8, - CA_REGIONS_AND_SUPPORT = 9 + CA_REGIONS_AND_SUPPORT = 9, + ITAR = 10 } /** KajEnrollmentState enum. */ @@ -3179,7 +3180,8 @@ export namespace google { HIPAA = 6, HITRUST = 7, EU_REGIONS_AND_SUPPORT = 8, - CA_REGIONS_AND_SUPPORT = 9 + CA_REGIONS_AND_SUPPORT = 9, + ITAR = 10 } /** KajEnrollmentState enum. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 32051105682..0077d12590f 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1975,6 +1975,7 @@ case 7: case 8: case 9: + case 10: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2100,6 +2101,10 @@ case 9: message.complianceRegime = 9; break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -3332,6 +3337,7 @@ * @property {number} HITRUST=7 HITRUST value * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value + * @property {number} ITAR=10 ITAR value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3345,6 +3351,7 @@ values[valuesById[7] = "HITRUST"] = 7; values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; + values[valuesById[10] = "ITAR"] = 10; return values; })(); @@ -3564,6 +3571,7 @@ case 7: case 8: case 9: + case 10: break; } return null; @@ -3631,6 +3639,10 @@ case 9: message.complianceRegime = 9; break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; } return message; }; @@ -5671,6 +5683,7 @@ case 7: case 8: case 9: + case 10: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -5834,6 +5847,10 @@ case 9: message.complianceRegime = 9; break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -7886,6 +7903,7 @@ * @property {number} HITRUST=7 HITRUST value * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value + * @property {number} ITAR=10 ITAR value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7899,6 +7917,7 @@ values[valuesById[7] = "HITRUST"] = 7; values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; + values[valuesById[10] = "ITAR"] = 10; return values; })(); @@ -8136,6 +8155,7 @@ case 7: case 8: case 9: + case 10: break; } if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { @@ -8212,6 +8232,10 @@ case 9: message.complianceRegime = 9; break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; } if (object.resourceSettings) { if (!Array.isArray(object.resourceSettings)) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 94446d2fa97..c9911fac613 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -458,7 +458,8 @@ "HIPAA": 6, "HITRUST": 7, "EU_REGIONS_AND_SUPPORT": 8, - "CA_REGIONS_AND_SUPPORT": 9 + "CA_REGIONS_AND_SUPPORT": 9, + "ITAR": 10 } }, "KajEnrollmentState": { @@ -1055,7 +1056,8 @@ "HIPAA": 6, "HITRUST": 7, "EU_REGIONS_AND_SUPPORT": 8, - "CA_REGIONS_AND_SUPPORT": 9 + "CA_REGIONS_AND_SUPPORT": 9, + "ITAR": 10 } }, "KajEnrollmentState": { From 601d6b4515c1bf20eabca95b6d232175fe563749 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 14:58:33 -0400 Subject: [PATCH 097/116] chore(main): release 3.3.0 (#177) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../snippet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...pet_metadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 158291231a4..effdc402b13 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.3.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.2.0...v3.3.0) (2022-07-04) + + +### Features + +* ITAR June Preview Launch ([f4304b4](https://github.com/googleapis/nodejs-assured-workloads/commit/f4304b4c6974445d22d03f890e784e3767e30dd4)) + ## [3.2.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.1.0...v3.2.0) (2022-06-29) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 24ee716afca..0fb40281057 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.2.0", + "version": "3.3.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index c5aff550edd..a1afd67f585 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.2.0", + "version": "3.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index be1d6443b03..112f6430428 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.2.0", + "version": "3.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 26c419669c8..966c9947be7 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.2.0" + "@google-cloud/assured-workloads": "^3.3.0" }, "devDependencies": { "c8": "^7.3.0", From 31b3ac82cfb5158f31ffecda6bde5be986f20190 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 01:58:53 +0200 Subject: [PATCH 098/116] chore(deps): update dependency linkinator to v4 (#178) 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.1.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-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 0fb40281057..ebeec967f2d 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -50,7 +50,7 @@ "jsdoc": "^3.6.5", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.1.2", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From d515d7d80104ebd05a5715e10ce0957b37f7bd16 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 29 Jul 2022 06:57:48 -0700 Subject: [PATCH 099/116] feat: Updated the method signature of analyzeWorkloadMove for v1beta API to accept project as source. AnalyzeWorkloadMove now also returns information about org policy differences between the project and target folder (#179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Updated the method signature of analyzeWorkloadMove for v1beta API to accept project as source. AnalyzeWorkloadMove now also returns information about org policy differences between the project and target folder Committer: @ketanbshah PiperOrigin-RevId: 461626403 Source-Link: https://github.com/googleapis/googleapis/commit/6aee59cd91487ae5a3cd5a5768a4b42b4587dd25 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1e4553d63e79ed253db11974bc6c740567bcb03c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWU0NTUzZDYzZTc5ZWQyNTNkYjExOTc0YmM2Yzc0MDU2N2JjYjAzYyJ9 * 🦉 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 --- .../v1beta1/assuredworkloads.proto | 389 +- .../v1beta1/assuredworkloads_service.proto | 117 + .../protos/protos.d.ts | 1076 ++- .../protos/protos.js | 7370 ++++++++++------- .../protos/protos.json | 386 +- ...workloads_service.analyze_workload_move.js | 81 + ...sured_workloads_service.create_workload.js | 4 +- .../assured_workloads_service.get_workload.js | 4 +- ...oads_service.restrict_allowed_resources.js | 67 + ...loads_service.restrict_allowed_services.js | 67 + ...sured_workloads_service.update_workload.js | 2 +- ...google.cloud.assuredworkloads.v1beta1.json | 138 +- .../assured_workloads_service_client.ts | 579 +- ...sured_workloads_service_client_config.json | 13 + .../assured_workloads_service_proto_list.json | 3 +- .../src/v1beta1/gapic_metadata.json | 30 + ...gapic_assured_workloads_service_v1beta1.ts | 1378 ++- 17 files changed, 7672 insertions(+), 4032 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto index be0243f8bf9..5967dd884fd 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,13 +16,9 @@ syntax = "proto3"; package google.cloud.assuredworkloads.v1beta1; -import "google/api/annotations.proto"; -import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -38,65 +34,6 @@ option (google.api.resource_definition) = { pattern: "organizations/{organization}/locations/{location}" }; -// Service to manage AssuredWorkloads. -service AssuredWorkloadsService { - option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" - body: "workload" - }; - option (google.api.method_signature) = "parent,workload"; - option (google.longrunning.operation_info) = { - response_type: "Workload" - metadata_type: "CreateWorkloadOperationMetadata" - }; - } - - // Updates an existing workload. - // Currently allows updating of workload display_name and labels. - // For force updates don't set etag field in the Workload. - // Only one update operation per workload can be in progress. - rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { - option (google.api.http) = { - patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" - body: "workload" - }; - option (google.api.method_signature) = "workload,update_mask"; - } - - // Deletes the workload. Make sure that workload's direct children are already - // in a deleted state, otherwise the request will fail with a - // FAILED_PRECONDITION error. - rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets Assured Workload associated with a CRM Node - rpc GetWorkload(GetWorkloadRequest) returns (Workload) { - option (google.api.http) = { - get: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Assured Workloads under a CRM Node. - rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=organizations/*/locations/*}/workloads" - }; - option (google.api.method_signature) = "parent"; - } -} - // Request for creating a workload. message CreateWorkloadRequest { // Required. The resource name of the new Workload's parent. @@ -111,8 +48,8 @@ message CreateWorkloadRequest { // Required. Assured Workload to create Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A identifier associated with the workload and underlying projects - // which allows for the break down of billing costs for a workload. The value + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value // provided for the identifier will add a label to the workload and contained // projects with the identifier as the value. string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -121,14 +58,80 @@ message CreateWorkloadRequest { // Request for Updating a workload. message UpdateWorkloadRequest { // Required. The workload to update. - // The workload’s `name` field is used to identify the workload to be updated. + // The workload's `name` field is used to identify the workload to be updated. // Format: // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for restricting list of available services in Workload environment. +message RestrictAllowedServicesRequest { + // The type of restriction. + enum RestrictionType { + // Unknown restriction type. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Allow the use all services. This effectively remove all restrictions + // placed on the Folder. + ALLOW_ALL_GCP_SERVICES = 1; + + // Based on Workload's compliance regime, allowed list changes. + // See - https://cloud.google.com/assured-workloads/docs/supported-products + // for the list of allowed services. + ALLOW_COMPLIANT_SERVICES = 2; + } + + // Required. The resource name of the Workload. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of restriction for using gcp services in the Workload environment. + RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for restricting the list of allowed services. +message RestrictAllowedServicesResponse { + +} + +// Request for restricting list of available resources in Workload environment. +message RestrictAllowedResourcesRequest { + // The type of restriction. + enum RestrictionType { + // Unknown restriction type. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Allow the use all of all gcp products, irrespective of the compliance + // posture. This effectively removes gcp.restrictServiceUsage OrgPolicy + // on the AssuredWorkloads Folder. + ALLOW_ALL_GCP_RESOURCES = 1; + + // Based on Workload's compliance regime, allowed list changes. + // See - https://cloud.google.com/assured-workloads/docs/supported-products + // for the list of supported resources. + ALLOW_COMPLIANT_RESOURCES = 2; + } + + // Required. The resource name of the Workload. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of restriction for using gcp products in the Workload environment. + RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for restricting the list of allowed resources. +message RestrictAllowedResourcesResponse { + } // Request for deleting a Workload. @@ -150,8 +153,8 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the - // workloads's relative path in the API, formatted as + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, // "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -163,6 +166,44 @@ message GetWorkloadRequest { ]; } +// Request to check if source workload can be moved to target workload. +message AnalyzeWorkloadMoveRequest { + // Kind of resource to be moved to the destination workload + oneof projectOrWorkloadResource { + // The Source is project based Workload to be moved. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string source = 1; + + // The Source is a project based to be moved. + // This is the project's relative path in the API, formatted as + // "cloudresourcemanager.googleapis.com/projects/{project_number}" + // "projects/{project_number}" + // "cloudresourcemanager.googleapis.com/projects/{project_id}" + // "projects/{project_id}" + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string project = 3; + } + + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-2". + string target = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response with the analysis if the source workload can be moved to the target +// workload +message AnalyzeWorkloadMoveResponse { + // List of blockers that prevent moving the source workload to the target + // workload + repeated string blockers = 1; +} + // Request for fetching workloads in an organization. message ListWorkloadsRequest { // Required. Parent Resource to list workloads from. @@ -233,20 +274,57 @@ message Workload { ResourceType resource_type = 2; } + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; + + // International Traffic in Arms Regulations + ITAR = 10; + } + // Settings specific to the Key Management Service. message KMSSettings { - // Required. Input only. Immutable. The time at which the Key Management - // Service will automatically create a new version of the crypto key and - // mark it as the primary. + option deprecated = true; + + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. google.protobuf.Timestamp next_rotation_time = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. [next_rotation_time] will be advanced by - // this period when the Key Management Service automatically rotates a key. - // Must be at least 24 hours and at most 876,000 hours. + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. google.protobuf.Duration rotation_period = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -258,10 +336,8 @@ message Workload { message IL4Settings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto - // key. + // Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; @@ -271,10 +347,8 @@ message Workload { message CJISSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto - // key. + // Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; @@ -284,10 +358,8 @@ message Workload { message FedrampHighSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto - // key. + // Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; @@ -297,10 +369,8 @@ message Workload { message FedrampModerateSettings { option deprecated = true; - // Required. Input only. Immutable. Settings used to create a CMEK crypto - // key. + // Input only. Immutable. Settings used to create a CMEK crypto key. KMSSettings kms_settings = 1 [ - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; @@ -311,6 +381,8 @@ message Workload { // Resource identifier. // For a project this represents project_id. If the project is already // taken, the workload creation will fail. + // For KeyRing, this represents the keyring_id. + // For a folder, don't set this value as folder_id is assigned by Google. string resource_id = 1; // Indicates the type of resource. This field should be specified to @@ -324,14 +396,28 @@ message Workload { string display_name = 3; } + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + // Signed Access Approvals (SAA) enrollment response. message SaaEnrollmentResponse { // Setup state of SAA enrollment. enum SetupState { // Unspecified. SETUP_STATE_UNSPECIFIED = 0; + // SAA enrollment pending. STATUS_PENDING = 1; + // SAA enrollment comopleted. STATUS_COMPLETE = 2; } @@ -340,14 +426,18 @@ message Workload { enum SetupError { // Unspecified. SETUP_ERROR_UNSPECIFIED = 0; + // Invalid states for all customers, to be redirected to AA UI for // additional details. ERROR_INVALID_BASE_SETUP = 1; + // Returned when there is not an EKM key configured. ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2; + // Returned when there are no enrolled services or the customer is // enrolled in CAA only for a subset of services. ERROR_NOT_ALL_SERVICES_ENROLLED = 3; + // Returned when exception was encountered during evaluation of other // criteria. ERROR_SETUP_CHECK_FAILED = 4; @@ -360,54 +450,6 @@ message Workload { repeated SetupError setup_errors = 2; } - // Supported Compliance Regimes. - enum ComplianceRegime { - // Unknown compliance regime. - COMPLIANCE_REGIME_UNSPECIFIED = 0; - - // Information protection as per DoD IL4 requirements. - IL4 = 1; - - // Criminal Justice Information Services (CJIS) Security policies. - CJIS = 2; - - // FedRAMP High data protection controls - FEDRAMP_HIGH = 3; - - // FedRAMP Moderate data protection controls - FEDRAMP_MODERATE = 4; - - // Assured Workloads For US Regions data protection controls - US_REGIONAL_ACCESS = 5; - - // Health Insurance Portability and Accountability Act controls - HIPAA = 6; - - // Health Information Trust Alliance controls - HITRUST = 7; - - // Assured Workloads For EU Regions and Support controls - EU_REGIONS_AND_SUPPORT = 8; - - // Assured Workloads For Canada Regions and Support controls - CA_REGIONS_AND_SUPPORT = 9; - - // International Traffic in Arms Regulations - ITAR = 10; - } - - // Key Access Justifications(KAJ) Enrollment State. - enum KajEnrollmentState { - // Default State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - - // Pending State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_PENDING = 1; - - // Complete State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_COMPLETE = 2; - } - // Optional. The resource name of the workload. // Format: // organizations/{organization}/locations/{location}/workloads/{workload} @@ -427,8 +469,7 @@ message Workload { // These resources will be created when creating the workload. // If any of the projects already exist, the workload creation will fail. // Always read only. - repeated ResourceInfo resources = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Immutable. Compliance Regime associated with this workload. ComplianceRegime compliance_regime = 4 [ @@ -454,38 +495,30 @@ message Workload { // Settings specific to the selected [compliance_regime] oneof compliance_regime_settings { - // Required. Input only. Immutable. Settings specific to resources needed - // for IL4. + // Input only. Immutable. Settings specific to resources needed for IL4. IL4Settings il4_settings = 7 [ deprecated = true, - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed - // for CJIS. + // Input only. Immutable. Settings specific to resources needed for CJIS. CJISSettings cjis_settings = 8 [ deprecated = true, - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed - // for FedRAMP High. + // Input only. Immutable. Settings specific to resources needed for FedRAMP High. FedrampHighSettings fedramp_high_settings = 11 [ deprecated = true, - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. Settings specific to resources needed - // for FedRAMP Moderate. + // Input only. Immutable. Settings specific to resources needed for FedRAMP Moderate. FedrampModerateSettings fedramp_moderate_settings = 12 [ deprecated = true, - (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; @@ -498,29 +531,31 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - // Input only. The parent resource for the resources managed by this Assured - // Workload. May be either empty or a folder resource which is a child of the + // Input only. The parent resource for the resources managed by this Assured Workload. May + // be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the // parent organization. // Format: // folders/{folder_id} - string provisioned_resources_parent = 13 - [(google.api.field_behavior) = INPUT_ONLY]; - - // Input only. Settings used to create a CMEK crypto key. When set a project - // with a KMS CMEK key is provisioned. This field is mandatory for a subset of - // Compliance Regimes. - KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + // CMEK key is provisioned. + // This field is deprecated as of Feb 28, 2022. + // In order to create a Keyring, callers should specify, + // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + KMSSettings kms_settings = 14 [ + deprecated = true, + (google.api.field_behavior) = INPUT_ONLY + ]; - // Input only. Resource properties that are used to customize workload - // resources. These properties (such as custom project id) will be used to - // create workload resources if possible. This field is optional. - repeated ResourceSettings resource_settings = 15 - [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Resource properties that are used to customize workload resources. + // These properties (such as custom project id) will be used to create + // workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; // Output only. Represents the KAJ enrollment state of the given workload. - KajEnrollmentState kaj_enrollment_state = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; + KajEnrollmentState kaj_enrollment_state = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Indicates the sovereignty status of the given workload. // Currently meant to be used by Europe/Canada customers. @@ -529,15 +564,13 @@ message Workload { // Output only. Represents the SAA enrollment response of the given workload. // SAA enrollment response is queried during GetWorkload call. // In failure cases, user friendly error message is shown in SAA details page. - SaaEnrollmentResponse saa_enrollment_response = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; + SaaEnrollmentResponse saa_enrollment_response = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. message CreateWorkloadOperationMetadata { // Optional. Time when the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The display name of the workload. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -545,13 +578,11 @@ message CreateWorkloadOperationMetadata { // Optional. The parent of the workload. string parent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Compliance controls that should be applied to the resources - // managed by the workload. - Workload.ComplianceRegime compliance_regime = 4 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Resource properties in the input that are used for - // creating/customizing workload resources. - repeated Workload.ResourceSettings resource_settings = 5 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Resource properties in the input that are used for creating/customizing + // workload resources. + repeated Workload.ResourceSettings resource_settings = 5 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto new file mode 100644 index 00000000000..fff7655f664 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto @@ -0,0 +1,117 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.assuredworkloads.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; + +option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads"; +option java_multiple_files = true; +option java_outer_classname = "AssuredworkloadsServiceProto"; +option java_package = "com.google.cloud.assuredworkloads.v1beta1"; +option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1beta1"; +option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1"; + +// Service to manage AssuredWorkloads. +service AssuredWorkloadsService { + option (google.api.default_host) = "assuredworkloads.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates Assured Workload. + rpc CreateWorkload(CreateWorkloadRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" + body: "workload" + }; + option (google.api.method_signature) = "parent,workload"; + option (google.longrunning.operation_info) = { + response_type: "Workload" + metadata_type: "CreateWorkloadOperationMetadata" + }; + } + + // Updates an existing workload. + // Currently allows updating of workload display_name and labels. + // For force updates don't set etag field in the Workload. + // Only one update operation per workload can be in progress. + rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { + option (google.api.http) = { + patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" + body: "workload" + }; + option (google.api.method_signature) = "workload,update_mask"; + } + + // Restrict the list of services allowed in the Workload environment. + // The current list of allowed services can be found at + // https://cloud.google.com/assured-workloads/docs/supported-products + // In addition to assuredworkloads.workload.update permission, the user should + // also have orgpolicy.policy.set permission on the folder resource + // to use this functionality. + rpc RestrictAllowedServices(RestrictAllowedServicesRequest) + returns (RestrictAllowedServicesResponse) {} + + // Restrict the list of resources allowed in the Workload environment. + // The current list of allowed products can be found at + // https://cloud.google.com/assured-workloads/docs/supported-products + // In addition to assuredworkloads.workload.update permission, the user should + // also have orgpolicy.policy.set permission on the folder resource + // to use this functionality. + rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) + returns (RestrictAllowedResourcesResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources" + body: "*" + }; + } + + // Deletes the workload. Make sure that workload's direct children are already + // in a deleted state, otherwise the request will fail with a + // FAILED_PRECONDITION error. + // In addition to assuredworkloads.workload.delete permission, the user should + // also have orgpolicy.policy.set permission on the deleted folder to remove + // Assured Workloads OrgPolicies. + rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets Assured Workload associated with a CRM Node + rpc GetWorkload(GetWorkloadRequest) returns (Workload) { + option (google.api.method_signature) = "name"; + } + + // Analyze if the source Assured Workloads can be moved to the target Assured + // Workload + rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) + returns (AnalyzeWorkloadMoveResponse) { + option (google.api.method_signature) = "project,target"; + } + + // Lists Assured Workloads under a CRM Node. + rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) { + option (google.api.method_signature) = "parent"; + } +} diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 513eafb300d..b9921c913dd 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1471,135 +1471,6 @@ export namespace google { /** Namespace v1beta1. */ namespace v1beta1 { - /** Represents an AssuredWorkloadsService */ - class AssuredWorkloadsService extends $protobuf.rpc.Service { - - /** - * Constructs a new AssuredWorkloadsService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new AssuredWorkloadsService service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssuredWorkloadsService; - - /** - * Calls CreateWorkload. - * @param request CreateWorkloadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback): void; - - /** - * Calls CreateWorkload. - * @param request CreateWorkloadRequest message or plain object - * @returns Promise - */ - public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest): Promise; - - /** - * Calls UpdateWorkload. - * @param request UpdateWorkloadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Workload - */ - public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback): void; - - /** - * Calls UpdateWorkload. - * @param request UpdateWorkloadRequest message or plain object - * @returns Promise - */ - public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest): Promise; - - /** - * Calls DeleteWorkload. - * @param request DeleteWorkloadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback): void; - - /** - * Calls DeleteWorkload. - * @param request DeleteWorkloadRequest message or plain object - * @returns Promise - */ - public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): Promise; - - /** - * Calls GetWorkload. - * @param request GetWorkloadRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Workload - */ - public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback): void; - - /** - * Calls GetWorkload. - * @param request GetWorkloadRequest message or plain object - * @returns Promise - */ - public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): Promise; - - /** - * Calls ListWorkloads. - * @param request ListWorkloadsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListWorkloadsResponse - */ - public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback): void; - - /** - * Calls ListWorkloads. - * @param request ListWorkloadsRequest message or plain object - * @returns Promise - */ - public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest): Promise; - } - - namespace AssuredWorkloadsService { - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. - * @param error Error, if any - * @param [response] Workload - */ - type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. - * @param error Error, if any - * @param [response] Workload - */ - type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. - * @param error Error, if any - * @param [response] ListWorkloadsResponse - */ - type ListWorkloadsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) => void; - } - /** Properties of a CreateWorkloadRequest. */ interface ICreateWorkloadRequest { @@ -1798,187 +1669,762 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteWorkloadRequest. */ - interface IDeleteWorkloadRequest { + /** Properties of a RestrictAllowedServicesRequest. */ + interface IRestrictAllowedServicesRequest { - /** DeleteWorkloadRequest name */ + /** RestrictAllowedServicesRequest name */ name?: (string|null); - /** DeleteWorkloadRequest etag */ - etag?: (string|null); + /** RestrictAllowedServicesRequest restrictionType */ + restrictionType?: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|null); } - /** Represents a DeleteWorkloadRequest. */ - class DeleteWorkloadRequest implements IDeleteWorkloadRequest { + /** Represents a RestrictAllowedServicesRequest. */ + class RestrictAllowedServicesRequest implements IRestrictAllowedServicesRequest { /** - * Constructs a new DeleteWorkloadRequest. + * Constructs a new RestrictAllowedServicesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest); + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest); - /** DeleteWorkloadRequest name. */ + /** RestrictAllowedServicesRequest name. */ public name: string; - /** DeleteWorkloadRequest etag. */ - public etag: string; + /** RestrictAllowedServicesRequest restrictionType. */ + public restrictionType: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType); /** - * Creates a new DeleteWorkloadRequest instance using the specified properties. + * Creates a new RestrictAllowedServicesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteWorkloadRequest instance + * @returns RestrictAllowedServicesRequest instance */ - public static create(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; /** - * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. - * @param message DeleteWorkloadRequest message or plain object to encode + * Encodes the specified RestrictAllowedServicesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. + * @param message RestrictAllowedServicesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedServicesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. + * @param message RestrictAllowedServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; + + /** + * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; + + /** + * Verifies a RestrictAllowedServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; + + /** + * Creates a plain object from a RestrictAllowedServicesRequest message. Also converts values to other types if specified. + * @param message RestrictAllowedServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RestrictAllowedServicesRequest { + + /** RestrictionType enum. */ + enum RestrictionType { + RESTRICTION_TYPE_UNSPECIFIED = 0, + ALLOW_ALL_GCP_SERVICES = 1, + ALLOW_COMPLIANT_SERVICES = 2 + } + } + + /** Properties of a RestrictAllowedServicesResponse. */ + interface IRestrictAllowedServicesResponse { + } + + /** Represents a RestrictAllowedServicesResponse. */ + class RestrictAllowedServicesResponse implements IRestrictAllowedServicesResponse { + + /** + * Constructs a new RestrictAllowedServicesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse); + + /** + * Creates a new RestrictAllowedServicesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictAllowedServicesResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; + + /** + * Encodes the specified RestrictAllowedServicesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. + * @param message RestrictAllowedServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedServicesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. + * @param message RestrictAllowedServicesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; + + /** + * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedServicesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; + + /** + * Verifies a RestrictAllowedServicesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedServicesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedServicesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; + + /** + * Creates a plain object from a RestrictAllowedServicesResponse message. Also converts values to other types if specified. + * @param message RestrictAllowedServicesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedServicesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestrictAllowedResourcesRequest. */ + interface IRestrictAllowedResourcesRequest { + + /** RestrictAllowedResourcesRequest name */ + name?: (string|null); + + /** RestrictAllowedResourcesRequest restrictionType */ + restrictionType?: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType|null); + } + + /** Represents a RestrictAllowedResourcesRequest. */ + class RestrictAllowedResourcesRequest implements IRestrictAllowedResourcesRequest { + + /** + * Constructs a new RestrictAllowedResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest); + + /** RestrictAllowedResourcesRequest name. */ + public name: string; + + /** RestrictAllowedResourcesRequest restrictionType. */ + public restrictionType: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType); + + /** + * Creates a new RestrictAllowedResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictAllowedResourcesRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @param message RestrictAllowedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @param message RestrictAllowedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest; + + /** + * Verifies a RestrictAllowedResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest; + + /** + * Creates a plain object from a RestrictAllowedResourcesRequest message. Also converts values to other types if specified. + * @param message RestrictAllowedResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RestrictAllowedResourcesRequest { + + /** RestrictionType enum. */ + enum RestrictionType { + RESTRICTION_TYPE_UNSPECIFIED = 0, + ALLOW_ALL_GCP_RESOURCES = 1, + ALLOW_COMPLIANT_RESOURCES = 2 + } + } + + /** Properties of a RestrictAllowedResourcesResponse. */ + interface IRestrictAllowedResourcesResponse { + } + + /** Represents a RestrictAllowedResourcesResponse. */ + class RestrictAllowedResourcesResponse implements IRestrictAllowedResourcesResponse { + + /** + * Constructs a new RestrictAllowedResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse); + + /** + * Creates a new RestrictAllowedResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictAllowedResourcesResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @param message RestrictAllowedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @param message RestrictAllowedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse; + + /** + * Verifies a RestrictAllowedResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse; + + /** + * Creates a plain object from a RestrictAllowedResourcesResponse message. Also converts values to other types if specified. + * @param message RestrictAllowedResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteWorkloadRequest. */ + interface IDeleteWorkloadRequest { + + /** DeleteWorkloadRequest name */ + name?: (string|null); + + /** DeleteWorkloadRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteWorkloadRequest. */ + class DeleteWorkloadRequest implements IDeleteWorkloadRequest { + + /** + * Constructs a new DeleteWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest); + + /** DeleteWorkloadRequest name. */ + public name: string; + + /** DeleteWorkloadRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @param message DeleteWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Verifies a DeleteWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + + /** + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @param message DeleteWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetWorkloadRequest. */ + interface IGetWorkloadRequest { + + /** GetWorkloadRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkloadRequest. */ + class GetWorkloadRequest implements IGetWorkloadRequest { + + /** + * Constructs a new GetWorkloadRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest); + + /** GetWorkloadRequest name. */ + public name: string; + + /** + * Creates a new GetWorkloadRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkloadRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * @param message GetWorkloadRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Verifies a GetWorkloadRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkloadRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + + /** + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * @param message GetWorkloadRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkloadRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnalyzeWorkloadMoveRequest. */ + interface IAnalyzeWorkloadMoveRequest { + + /** AnalyzeWorkloadMoveRequest source */ + source?: (string|null); + + /** AnalyzeWorkloadMoveRequest project */ + project?: (string|null); + + /** AnalyzeWorkloadMoveRequest target */ + target?: (string|null); + } + + /** Represents an AnalyzeWorkloadMoveRequest. */ + class AnalyzeWorkloadMoveRequest implements IAnalyzeWorkloadMoveRequest { + + /** + * Constructs a new AnalyzeWorkloadMoveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest); + + /** AnalyzeWorkloadMoveRequest source. */ + public source?: (string|null); + + /** AnalyzeWorkloadMoveRequest project. */ + public project?: (string|null); + + /** AnalyzeWorkloadMoveRequest target. */ + public target: string; + + /** AnalyzeWorkloadMoveRequest projectOrWorkloadResource. */ + public projectOrWorkloadResource?: ("source"|"project"); + + /** + * Creates a new AnalyzeWorkloadMoveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeWorkloadMoveRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest; + + /** + * Encodes the specified AnalyzeWorkloadMoveRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest.verify|verify} messages. + * @param message AnalyzeWorkloadMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. - * @param message DeleteWorkloadRequest message or plain object to encode + * Encodes the specified AnalyzeWorkloadMoveRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest.verify|verify} messages. + * @param message AnalyzeWorkloadMoveRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * Decodes an AnalyzeWorkloadMoveRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteWorkloadRequest + * @returns AnalyzeWorkloadMoveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest; /** - * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeWorkloadMoveRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteWorkloadRequest + * @returns AnalyzeWorkloadMoveRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest; /** - * Verifies a DeleteWorkloadRequest message. + * Verifies an AnalyzeWorkloadMoveRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeWorkloadMoveRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteWorkloadRequest + * @returns AnalyzeWorkloadMoveRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest; /** - * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. - * @param message DeleteWorkloadRequest + * Creates a plain object from an AnalyzeWorkloadMoveRequest message. Also converts values to other types if specified. + * @param message AnalyzeWorkloadMoveRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteWorkloadRequest to JSON. + * Converts this AnalyzeWorkloadMoveRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetWorkloadRequest. */ - interface IGetWorkloadRequest { + /** Properties of an AnalyzeWorkloadMoveResponse. */ + interface IAnalyzeWorkloadMoveResponse { - /** GetWorkloadRequest name */ - name?: (string|null); + /** AnalyzeWorkloadMoveResponse blockers */ + blockers?: (string[]|null); } - /** Represents a GetWorkloadRequest. */ - class GetWorkloadRequest implements IGetWorkloadRequest { + /** Represents an AnalyzeWorkloadMoveResponse. */ + class AnalyzeWorkloadMoveResponse implements IAnalyzeWorkloadMoveResponse { /** - * Constructs a new GetWorkloadRequest. + * Constructs a new AnalyzeWorkloadMoveResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest); + constructor(properties?: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse); - /** GetWorkloadRequest name. */ - public name: string; + /** AnalyzeWorkloadMoveResponse blockers. */ + public blockers: string[]; /** - * Creates a new GetWorkloadRequest instance using the specified properties. + * Creates a new AnalyzeWorkloadMoveResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetWorkloadRequest instance + * @returns AnalyzeWorkloadMoveResponse instance */ - public static create(properties?: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + public static create(properties?: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse; /** - * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. - * @param message GetWorkloadRequest message or plain object to encode + * Encodes the specified AnalyzeWorkloadMoveResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.verify|verify} messages. + * @param message AnalyzeWorkloadMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. - * @param message GetWorkloadRequest message or plain object to encode + * Encodes the specified AnalyzeWorkloadMoveResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.verify|verify} messages. + * @param message AnalyzeWorkloadMoveResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * Decodes an AnalyzeWorkloadMoveResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetWorkloadRequest + * @returns AnalyzeWorkloadMoveResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse; /** - * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeWorkloadMoveResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetWorkloadRequest + * @returns AnalyzeWorkloadMoveResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse; /** - * Verifies a GetWorkloadRequest message. + * Verifies an AnalyzeWorkloadMoveResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeWorkloadMoveResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetWorkloadRequest + * @returns AnalyzeWorkloadMoveResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse; /** - * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. - * @param message GetWorkloadRequest + * Creates a plain object from an AnalyzeWorkloadMoveResponse message. Also converts values to other types if specified. + * @param message AnalyzeWorkloadMoveResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetWorkloadRequest to JSON. + * Converts this AnalyzeWorkloadMoveResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2493,6 +2939,21 @@ export namespace google { } } + /** ComplianceRegime enum. */ + enum ComplianceRegime { + COMPLIANCE_REGIME_UNSPECIFIED = 0, + IL4 = 1, + CJIS = 2, + FEDRAMP_HIGH = 3, + FEDRAMP_MODERATE = 4, + US_REGIONAL_ACCESS = 5, + HIPAA = 6, + HITRUST = 7, + EU_REGIONS_AND_SUPPORT = 8, + CA_REGIONS_AND_SUPPORT = 9, + ITAR = 10 + } + /** Properties of a KMSSettings. */ interface IKMSSettings { @@ -3051,6 +3512,13 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** KajEnrollmentState enum. */ + enum KajEnrollmentState { + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, + KAJ_ENROLLMENT_STATE_PENDING = 1, + KAJ_ENROLLMENT_STATE_COMPLETE = 2 + } + /** Properties of a SaaEnrollmentResponse. */ interface ISaaEnrollmentResponse { @@ -3168,28 +3636,6 @@ export namespace google { ERROR_SETUP_CHECK_FAILED = 4 } } - - /** ComplianceRegime enum. */ - enum ComplianceRegime { - COMPLIANCE_REGIME_UNSPECIFIED = 0, - IL4 = 1, - CJIS = 2, - FEDRAMP_HIGH = 3, - FEDRAMP_MODERATE = 4, - US_REGIONAL_ACCESS = 5, - HIPAA = 6, - HITRUST = 7, - EU_REGIONS_AND_SUPPORT = 8, - CA_REGIONS_AND_SUPPORT = 9, - ITAR = 10 - } - - /** KajEnrollmentState enum. */ - enum KajEnrollmentState { - KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, - KAJ_ENROLLMENT_STATE_PENDING = 1, - KAJ_ENROLLMENT_STATE_COMPLETE = 2 - } } /** Properties of a CreateWorkloadOperationMetadata. */ @@ -3305,6 +3751,198 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Represents an AssuredWorkloadsService */ + class AssuredWorkloadsService extends $protobuf.rpc.Service { + + /** + * Constructs a new AssuredWorkloadsService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AssuredWorkloadsService; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback): void; + + /** + * Calls CreateWorkload. + * @param request CreateWorkloadRequest message or plain object + * @returns Promise + */ + public createWorkload(request: google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest): Promise; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback): void; + + /** + * Calls UpdateWorkload. + * @param request UpdateWorkloadRequest message or plain object + * @returns Promise + */ + public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest): Promise; + + /** + * Calls RestrictAllowedServices. + * @param request RestrictAllowedServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestrictAllowedServicesResponse + */ + public restrictAllowedServices(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServicesCallback): void; + + /** + * Calls RestrictAllowedServices. + * @param request RestrictAllowedServicesRequest message or plain object + * @returns Promise + */ + public restrictAllowedServices(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest): Promise; + + /** + * Calls RestrictAllowedResources. + * @param request RestrictAllowedResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestrictAllowedResourcesResponse + */ + public restrictAllowedResources(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedResourcesCallback): void; + + /** + * Calls RestrictAllowedResources. + * @param request RestrictAllowedResourcesRequest message or plain object + * @returns Promise + */ + public restrictAllowedResources(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest): Promise; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback): void; + + /** + * Calls DeleteWorkload. + * @param request DeleteWorkloadRequest message or plain object + * @returns Promise + */ + public deleteWorkload(request: google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest): Promise; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workload + */ + public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback): void; + + /** + * Calls GetWorkload. + * @param request GetWorkloadRequest message or plain object + * @returns Promise + */ + public getWorkload(request: google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest): Promise; + + /** + * Calls AnalyzeWorkloadMove. + * @param request AnalyzeWorkloadMoveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeWorkloadMoveResponse + */ + public analyzeWorkloadMove(request: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.AnalyzeWorkloadMoveCallback): void; + + /** + * Calls AnalyzeWorkloadMove. + * @param request AnalyzeWorkloadMoveRequest message or plain object + * @returns Promise + */ + public analyzeWorkloadMove(request: google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest): Promise; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkloadsResponse + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback): void; + + /** + * Calls ListWorkloads. + * @param request ListWorkloadsRequest message or plain object + * @returns Promise + */ + public listWorkloads(request: google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest): Promise; + } + + namespace AssuredWorkloadsService { + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedServices}. + * @param error Error, if any + * @param [response] RestrictAllowedServicesResponse + */ + type RestrictAllowedServicesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedResources}. + * @param error Error, if any + * @param [response] RestrictAllowedResourcesResponse + */ + type RestrictAllowedResourcesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * @param error Error, if any + * @param [response] Workload + */ + type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#analyzeWorkloadMove}. + * @param error Error, if any + * @param [response] AnalyzeWorkloadMoveResponse + */ + type AnalyzeWorkloadMoveCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * @param error Error, if any + * @param [response] ListWorkloadsResponse + */ + type ListWorkloadsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) => void; + } } } } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 0077d12590f..6f5ddd3a425 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -3703,206 +3703,6 @@ */ var v1beta1 = {}; - v1beta1.AssuredWorkloadsService = (function() { - - /** - * Constructs a new AssuredWorkloadsService service. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents an AssuredWorkloadsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function AssuredWorkloadsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AssuredWorkloadsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssuredWorkloadsService; - - /** - * Creates new AssuredWorkloadsService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {AssuredWorkloadsService} RPC service. Useful where requests and/or responses are streamed. - */ - AssuredWorkloadsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef CreateWorkloadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateWorkload. - * @function createWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.createWorkload = function createWorkload(request, callback) { - return this.rpcCall(createWorkload, $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateWorkload" }); - - /** - * Calls CreateWorkload. - * @function createWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef UpdateWorkloadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload - */ - - /** - * Calls UpdateWorkload. - * @function updateWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback} callback Node-style callback called with the error, if any, and Workload - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.updateWorkload = function updateWorkload(request, callback) { - return this.rpcCall(updateWorkload, $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); - }, "name", { value: "UpdateWorkload" }); - - /** - * Calls UpdateWorkload. - * @function updateWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef DeleteWorkloadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteWorkload. - * @function deleteWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.deleteWorkload = function deleteWorkload(request, callback) { - return this.rpcCall(deleteWorkload, $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteWorkload" }); - - /** - * Calls DeleteWorkload. - * @function deleteWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef GetWorkloadCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload - */ - - /** - * Calls GetWorkload. - * @function getWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback} callback Node-style callback called with the error, if any, and Workload - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.getWorkload = function getWorkload(request, callback) { - return this.rpcCall(getWorkload, $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); - }, "name", { value: "GetWorkload" }); - - /** - * Calls GetWorkload. - * @function getWorkload - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef ListWorkloadsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} [response] ListWorkloadsResponse - */ - - /** - * Calls ListWorkloads. - * @function listWorkloads - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback} callback Node-style callback called with the error, if any, and ListWorkloadsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.listWorkloads = function listWorkloads(request, callback) { - return this.rpcCall(listWorkloads, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse, request, callback); - }, "name", { value: "ListWorkloads" }); - - /** - * Calls ListWorkloads. - * @function listWorkloads - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AssuredWorkloadsService; - })(); - v1beta1.CreateWorkloadRequest = (function() { /** @@ -4360,25 +4160,25 @@ return UpdateWorkloadRequest; })(); - v1beta1.DeleteWorkloadRequest = (function() { + v1beta1.RestrictAllowedServicesRequest = (function() { /** - * Properties of a DeleteWorkloadRequest. + * Properties of a RestrictAllowedServicesRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IDeleteWorkloadRequest - * @property {string|null} [name] DeleteWorkloadRequest name - * @property {string|null} [etag] DeleteWorkloadRequest etag + * @interface IRestrictAllowedServicesRequest + * @property {string|null} [name] RestrictAllowedServicesRequest name + * @property {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|null} [restrictionType] RestrictAllowedServicesRequest restrictionType */ /** - * Constructs a new DeleteWorkloadRequest. + * Constructs a new RestrictAllowedServicesRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a DeleteWorkloadRequest. - * @implements IDeleteWorkloadRequest + * @classdesc Represents a RestrictAllowedServicesRequest. + * @implements IRestrictAllowedServicesRequest * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest=} [properties] Properties to set */ - function DeleteWorkloadRequest(properties) { + function RestrictAllowedServicesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4386,80 +4186,80 @@ } /** - * DeleteWorkloadRequest name. + * RestrictAllowedServicesRequest name. * @member {string} name - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @instance */ - DeleteWorkloadRequest.prototype.name = ""; + RestrictAllowedServicesRequest.prototype.name = ""; /** - * DeleteWorkloadRequest etag. - * @member {string} etag - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * RestrictAllowedServicesRequest restrictionType. + * @member {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType} restrictionType + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @instance */ - DeleteWorkloadRequest.prototype.etag = ""; + RestrictAllowedServicesRequest.prototype.restrictionType = 0; /** - * Creates a new DeleteWorkloadRequest instance using the specified properties. + * Creates a new RestrictAllowedServicesRequest instance using the specified properties. * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest instance */ - DeleteWorkloadRequest.create = function create(properties) { - return new DeleteWorkloadRequest(properties); + RestrictAllowedServicesRequest.create = function create(properties) { + return new RestrictAllowedServicesRequest(properties); }; /** - * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedServicesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} message RestrictAllowedServicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteWorkloadRequest.encode = function encode(message, writer) { + RestrictAllowedServicesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.restrictionType != null && Object.hasOwnProperty.call(message, "restrictionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.restrictionType); return writer; }; /** - * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedServicesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} message RestrictAllowedServicesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestrictAllowedServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteWorkloadRequest.decode = function decode(reader, length) { + RestrictAllowedServicesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4467,7 +4267,7 @@ message.name = reader.string(); break; case 2: - message.etag = reader.string(); + message.restrictionType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -4478,116 +4278,149 @@ }; /** - * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + RestrictAllowedServicesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteWorkloadRequest message. + * Verifies a RestrictAllowedServicesRequest message. * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteWorkloadRequest.verify = function verify(message) { + RestrictAllowedServicesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + switch (message.restrictionType) { + default: + return "restrictionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RestrictAllowedServicesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest */ - DeleteWorkloadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + RestrictAllowedServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest) return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + var message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest(); if (object.name != null) message.name = String(object.name); - if (object.etag != null) - message.etag = String(object.etag); + switch (object.restrictionType) { + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.restrictionType = 0; + break; + case "ALLOW_ALL_GCP_SERVICES": + case 1: + message.restrictionType = 1; + break; + case "ALLOW_COMPLIANT_SERVICES": + case 2: + message.restrictionType = 2; + break; + } return message; }; /** - * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * Creates a plain object from a RestrictAllowedServicesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} message DeleteWorkloadRequest + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} message RestrictAllowedServicesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteWorkloadRequest.toObject = function toObject(message, options) { + RestrictAllowedServicesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.etag = ""; + object.restrictionType = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType[message.restrictionType] : message.restrictionType; return object; }; /** - * Converts this DeleteWorkloadRequest to JSON. + * Converts this RestrictAllowedServicesRequest to JSON. * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest * @instance * @returns {Object.} JSON object */ - DeleteWorkloadRequest.prototype.toJSON = function toJSON() { + RestrictAllowedServicesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteWorkloadRequest; + /** + * RestrictionType enum. + * @name google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType + * @enum {number} + * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value + * @property {number} ALLOW_ALL_GCP_SERVICES=1 ALLOW_ALL_GCP_SERVICES value + * @property {number} ALLOW_COMPLIANT_SERVICES=2 ALLOW_COMPLIANT_SERVICES value + */ + RestrictAllowedServicesRequest.RestrictionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW_ALL_GCP_SERVICES"] = 1; + values[valuesById[2] = "ALLOW_COMPLIANT_SERVICES"] = 2; + return values; + })(); + + return RestrictAllowedServicesRequest; })(); - v1beta1.GetWorkloadRequest = (function() { + v1beta1.RestrictAllowedServicesResponse = (function() { /** - * Properties of a GetWorkloadRequest. + * Properties of a RestrictAllowedServicesResponse. * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IGetWorkloadRequest - * @property {string|null} [name] GetWorkloadRequest name + * @interface IRestrictAllowedServicesResponse */ /** - * Constructs a new GetWorkloadRequest. + * Constructs a new RestrictAllowedServicesResponse. * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a GetWorkloadRequest. - * @implements IGetWorkloadRequest + * @classdesc Represents a RestrictAllowedServicesResponse. + * @implements IRestrictAllowedServicesResponse * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse=} [properties] Properties to set */ - function GetWorkloadRequest(properties) { + function RestrictAllowedServicesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4595,76 +4428,63 @@ } /** - * GetWorkloadRequest name. - * @member {string} name - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest - * @instance - */ - GetWorkloadRequest.prototype.name = ""; - - /** - * Creates a new GetWorkloadRequest instance using the specified properties. + * Creates a new RestrictAllowedServicesResponse instance using the specified properties. * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse instance */ - GetWorkloadRequest.create = function create(properties) { - return new GetWorkloadRequest(properties); + RestrictAllowedServicesResponse.create = function create(properties) { + return new RestrictAllowedServicesResponse(properties); }; /** - * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedServicesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse} message RestrictAllowedServicesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetWorkloadRequest.encode = function encode(message, writer) { + RestrictAllowedServicesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedServicesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse} message RestrictAllowedServicesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestrictAllowedServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetWorkloadRequest message from the specified reader or buffer. + * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetWorkloadRequest.decode = function decode(reader, length) { + RestrictAllowedServicesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -4674,110 +4494,95 @@ }; /** - * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. + * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + RestrictAllowedServicesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetWorkloadRequest message. + * Verifies a RestrictAllowedServicesResponse message. * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetWorkloadRequest.verify = function verify(message) { + RestrictAllowedServicesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RestrictAllowedServicesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse */ - GetWorkloadRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) + RestrictAllowedServicesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse) return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse(); }; /** - * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. + * Creates a plain object from a RestrictAllowedServicesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} message GetWorkloadRequest + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} message RestrictAllowedServicesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetWorkloadRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; + RestrictAllowedServicesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this GetWorkloadRequest to JSON. + * Converts this RestrictAllowedServicesResponse to JSON. * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse * @instance * @returns {Object.} JSON object */ - GetWorkloadRequest.prototype.toJSON = function toJSON() { + RestrictAllowedServicesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetWorkloadRequest; + return RestrictAllowedServicesResponse; })(); - v1beta1.ListWorkloadsRequest = (function() { + v1beta1.RestrictAllowedResourcesRequest = (function() { /** - * Properties of a ListWorkloadsRequest. + * Properties of a RestrictAllowedResourcesRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IListWorkloadsRequest - * @property {string|null} [parent] ListWorkloadsRequest parent - * @property {number|null} [pageSize] ListWorkloadsRequest pageSize - * @property {string|null} [pageToken] ListWorkloadsRequest pageToken - * @property {string|null} [filter] ListWorkloadsRequest filter + * @interface IRestrictAllowedResourcesRequest + * @property {string|null} [name] RestrictAllowedResourcesRequest name + * @property {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType|null} [restrictionType] RestrictAllowedResourcesRequest restrictionType */ /** - * Constructs a new ListWorkloadsRequest. + * Constructs a new RestrictAllowedResourcesRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a ListWorkloadsRequest. - * @implements IListWorkloadsRequest + * @classdesc Represents a RestrictAllowedResourcesRequest. + * @implements IRestrictAllowedResourcesRequest * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest=} [properties] Properties to set */ - function ListWorkloadsRequest(properties) { + function RestrictAllowedResourcesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4785,114 +4590,88 @@ } /** - * ListWorkloadsRequest parent. - * @member {string} parent - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest - * @instance - */ - ListWorkloadsRequest.prototype.parent = ""; - - /** - * ListWorkloadsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest - * @instance - */ - ListWorkloadsRequest.prototype.pageSize = 0; - - /** - * ListWorkloadsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * RestrictAllowedResourcesRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @instance */ - ListWorkloadsRequest.prototype.pageToken = ""; + RestrictAllowedResourcesRequest.prototype.name = ""; /** - * ListWorkloadsRequest filter. - * @member {string} filter - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * RestrictAllowedResourcesRequest restrictionType. + * @member {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType} restrictionType + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @instance */ - ListWorkloadsRequest.prototype.filter = ""; + RestrictAllowedResourcesRequest.prototype.restrictionType = 0; /** - * Creates a new ListWorkloadsRequest instance using the specified properties. + * Creates a new RestrictAllowedResourcesRequest instance using the specified properties. * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest instance */ - ListWorkloadsRequest.create = function create(properties) { - return new ListWorkloadsRequest(properties); + RestrictAllowedResourcesRequest.create = function create(properties) { + return new RestrictAllowedResourcesRequest(properties); }; /** - * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedResourcesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkloadsRequest.encode = function encode(message, writer) { + RestrictAllowedResourcesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.restrictionType != null && Object.hasOwnProperty.call(message, "restrictionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.restrictionType); return writer; }; /** - * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * Encodes the specified RestrictAllowedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkloadsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RestrictAllowedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkloadsRequest.decode = function decode(reader, length) { + RestrictAllowedResourcesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); + message.restrictionType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -4903,134 +4682,149 @@ }; /** - * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkloadsRequest.decodeDelimited = function decodeDelimited(reader) { + RestrictAllowedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListWorkloadsRequest message. + * Verifies a RestrictAllowedResourcesRequest message. * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListWorkloadsRequest.verify = function verify(message) { + RestrictAllowedResourcesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + switch (message.restrictionType) { + default: + return "restrictionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RestrictAllowedResourcesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest */ - ListWorkloadsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + RestrictAllowedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest) return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.restrictionType) { + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.restrictionType = 0; + break; + case "ALLOW_ALL_GCP_RESOURCES": + case 1: + message.restrictionType = 1; + break; + case "ALLOW_COMPLIANT_RESOURCES": + case 2: + message.restrictionType = 2; + break; + } return message; }; /** - * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RestrictAllowedResourcesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} message ListWorkloadsRequest + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListWorkloadsRequest.toObject = function toObject(message, options) { + RestrictAllowedResourcesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.name = ""; + object.restrictionType = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; return object; }; /** - * Converts this ListWorkloadsRequest to JSON. + * Converts this RestrictAllowedResourcesRequest to JSON. * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest * @instance * @returns {Object.} JSON object */ - ListWorkloadsRequest.prototype.toJSON = function toJSON() { + RestrictAllowedResourcesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListWorkloadsRequest; + /** + * RestrictionType enum. + * @name google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType + * @enum {number} + * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value + * @property {number} ALLOW_ALL_GCP_RESOURCES=1 ALLOW_ALL_GCP_RESOURCES value + * @property {number} ALLOW_COMPLIANT_RESOURCES=2 ALLOW_COMPLIANT_RESOURCES value + */ + RestrictAllowedResourcesRequest.RestrictionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW_ALL_GCP_RESOURCES"] = 1; + values[valuesById[2] = "ALLOW_COMPLIANT_RESOURCES"] = 2; + return values; + })(); + + return RestrictAllowedResourcesRequest; })(); - v1beta1.ListWorkloadsResponse = (function() { + v1beta1.RestrictAllowedResourcesResponse = (function() { /** - * Properties of a ListWorkloadsResponse. + * Properties of a RestrictAllowedResourcesResponse. * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IListWorkloadsResponse - * @property {Array.|null} [workloads] ListWorkloadsResponse workloads - * @property {string|null} [nextPageToken] ListWorkloadsResponse nextPageToken + * @interface IRestrictAllowedResourcesResponse */ /** - * Constructs a new ListWorkloadsResponse. + * Constructs a new RestrictAllowedResourcesResponse. * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a ListWorkloadsResponse. - * @implements IListWorkloadsResponse + * @classdesc Represents a RestrictAllowedResourcesResponse. + * @implements IRestrictAllowedResourcesResponse * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse=} [properties] Properties to set */ - function ListWorkloadsResponse(properties) { - this.workloads = []; + function RestrictAllowedResourcesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5038,92 +4832,63 @@ } /** - * ListWorkloadsResponse workloads. - * @member {Array.} workloads - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse - * @instance - */ - ListWorkloadsResponse.prototype.workloads = $util.emptyArray; - - /** - * ListWorkloadsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse - * @instance - */ - ListWorkloadsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListWorkloadsResponse instance using the specified properties. + * Creates a new RestrictAllowedResourcesResponse instance using the specified properties. * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse instance */ - ListWorkloadsResponse.create = function create(properties) { - return new ListWorkloadsResponse(properties); + RestrictAllowedResourcesResponse.create = function create(properties) { + return new RestrictAllowedResourcesResponse(properties); }; /** - * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * Encodes the specified RestrictAllowedResourcesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkloadsResponse.encode = function encode(message, writer) { + RestrictAllowedResourcesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.workloads != null && message.workloads.length) - for (var i = 0; i < message.workloads.length; ++i) - $root.google.cloud.assuredworkloads.v1beta1.Workload.encode(message.workloads[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * Encodes the specified RestrictAllowedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkloadsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RestrictAllowedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkloadsResponse.decode = function decode(reader, length) { + RestrictAllowedResourcesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.workloads && message.workloads.length)) - message.workloads = []; - message.workloads.push($root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -5133,153 +4898,95 @@ }; /** - * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkloadsResponse.decodeDelimited = function decodeDelimited(reader) { + RestrictAllowedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListWorkloadsResponse message. + * Verifies a RestrictAllowedResourcesResponse message. * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListWorkloadsResponse.verify = function verify(message) { + RestrictAllowedResourcesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.workloads != null && message.hasOwnProperty("workloads")) { - if (!Array.isArray(message.workloads)) - return "workloads: array expected"; - for (var i = 0; i < message.workloads.length; ++i) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.verify(message.workloads[i]); - if (error) - return "workloads." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RestrictAllowedResourcesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse */ - ListWorkloadsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) + RestrictAllowedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse) return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); - if (object.workloads) { - if (!Array.isArray(object.workloads)) - throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: array expected"); - message.workloads = []; - for (var i = 0; i < object.workloads.length; ++i) { - if (typeof object.workloads[i] !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: object expected"); - message.workloads[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.fromObject(object.workloads[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; + return new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse(); }; /** - * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RestrictAllowedResourcesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @static - * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} message ListWorkloadsResponse + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListWorkloadsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.workloads = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.workloads && message.workloads.length) { - object.workloads = []; - for (var j = 0; j < message.workloads.length; ++j) - object.workloads[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.toObject(message.workloads[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; + RestrictAllowedResourcesResponse.toObject = function toObject() { + return {}; }; /** - * Converts this ListWorkloadsResponse to JSON. + * Converts this RestrictAllowedResourcesResponse to JSON. * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse * @instance * @returns {Object.} JSON object */ - ListWorkloadsResponse.prototype.toJSON = function toJSON() { + RestrictAllowedResourcesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListWorkloadsResponse; + return RestrictAllowedResourcesResponse; })(); - v1beta1.Workload = (function() { + v1beta1.DeleteWorkloadRequest = (function() { /** - * Properties of a Workload. + * Properties of a DeleteWorkloadRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IWorkload - * @property {string|null} [name] Workload name - * @property {string|null} [displayName] Workload displayName - * @property {Array.|null} [resources] Workload resources - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] Workload complianceRegime - * @property {google.protobuf.ITimestamp|null} [createTime] Workload createTime - * @property {string|null} [billingAccount] Workload billingAccount - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null} [il4Settings] Workload il4Settings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null} [cjisSettings] Workload cjisSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null} [fedrampHighSettings] Workload fedrampHighSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null} [fedrampModerateSettings] Workload fedrampModerateSettings - * @property {string|null} [etag] Workload etag - * @property {Object.|null} [labels] Workload labels - * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings - * @property {Array.|null} [resourceSettings] Workload resourceSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState - * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse + * @interface IDeleteWorkloadRequest + * @property {string|null} [name] DeleteWorkloadRequest name + * @property {string|null} [etag] DeleteWorkloadRequest etag */ /** - * Constructs a new Workload. + * Constructs a new DeleteWorkloadRequest. * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a Workload. - * @implements IWorkload + * @classdesc Represents a DeleteWorkloadRequest. + * @implements IDeleteWorkloadRequest * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set */ - function Workload(properties) { - this.resources = []; - this.labels = {}; - this.resourceSettings = []; + function DeleteWorkloadRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5287,337 +4994,285 @@ } /** - * Workload name. + * DeleteWorkloadRequest name. * @member {string} name - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance - */ - Workload.prototype.name = ""; - - /** - * Workload displayName. - * @member {string} displayName - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest * @instance */ - Workload.prototype.displayName = ""; + DeleteWorkloadRequest.prototype.name = ""; /** - * Workload resources. - * @member {Array.} resources - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * DeleteWorkloadRequest etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest * @instance */ - Workload.prototype.resources = $util.emptyArray; + DeleteWorkloadRequest.prototype.etag = ""; /** - * Workload complianceRegime. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Creates a new DeleteWorkloadRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest instance */ - Workload.prototype.complianceRegime = 0; + DeleteWorkloadRequest.create = function create(properties) { + return new DeleteWorkloadRequest(properties); + }; /** - * Workload createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Encodes the specified DeleteWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Workload.prototype.createTime = null; + DeleteWorkloadRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; /** - * Workload billingAccount. - * @member {string} billingAccount - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Encodes the specified DeleteWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} message DeleteWorkloadRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Workload.prototype.billingAccount = ""; + DeleteWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Workload il4Settings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null|undefined} il4Settings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Workload.prototype.il4Settings = null; - - /** - * Workload cjisSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null|undefined} cjisSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance - */ - Workload.prototype.cjisSettings = null; - - /** - * Workload fedrampHighSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null|undefined} fedrampHighSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance - */ - Workload.prototype.fedrampHighSettings = null; + DeleteWorkloadRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.etag = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Workload fedrampModerateSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null|undefined} fedrampModerateSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Decodes a DeleteWorkloadRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Workload.prototype.fedrampModerateSettings = null; + DeleteWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Workload etag. - * @member {string} etag - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Verifies a DeleteWorkloadRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Workload.prototype.etag = ""; + DeleteWorkloadRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; /** - * Workload labels. - * @member {Object.} labels - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Creates a DeleteWorkloadRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} DeleteWorkloadRequest */ - Workload.prototype.labels = $util.emptyObject; + DeleteWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; /** - * Workload provisionedResourcesParent. - * @member {string} provisionedResourcesParent - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Creates a plain object from a DeleteWorkloadRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest} message DeleteWorkloadRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Workload.prototype.provisionedResourcesParent = ""; + DeleteWorkloadRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; /** - * Workload kmsSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * Converts this DeleteWorkloadRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest * @instance + * @returns {Object.} JSON object */ - Workload.prototype.kmsSettings = null; + DeleteWorkloadRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Workload resourceSettings. - * @member {Array.} resourceSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance - */ - Workload.prototype.resourceSettings = $util.emptyArray; + return DeleteWorkloadRequest; + })(); - /** - * Workload kajEnrollmentState. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState} kajEnrollmentState - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance - */ - Workload.prototype.kajEnrollmentState = 0; + v1beta1.GetWorkloadRequest = (function() { /** - * Workload enableSovereignControls. - * @member {boolean} enableSovereignControls - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Properties of a GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IGetWorkloadRequest + * @property {string|null} [name] GetWorkloadRequest name */ - Workload.prototype.enableSovereignControls = false; /** - * Workload saaEnrollmentResponse. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null|undefined} saaEnrollmentResponse - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @instance + * Constructs a new GetWorkloadRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a GetWorkloadRequest. + * @implements IGetWorkloadRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set */ - Workload.prototype.saaEnrollmentResponse = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + function GetWorkloadRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Workload complianceRegimeSettings. - * @member {"il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"|undefined} complianceRegimeSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * GetWorkloadRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @instance */ - Object.defineProperty(Workload.prototype, "complianceRegimeSettings", { - get: $util.oneOfGetter($oneOfFields = ["il4Settings", "cjisSettings", "fedrampHighSettings", "fedrampModerateSettings"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetWorkloadRequest.prototype.name = ""; /** - * Creates a new Workload instance using the specified properties. + * Creates a new GetWorkloadRequest instance using the specified properties. * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload instance + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest instance */ - Workload.create = function create(properties) { - return new Workload(properties); + GetWorkloadRequest.create = function create(properties) { + return new GetWorkloadRequest(properties); }; /** - * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * Encodes the specified GetWorkloadRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Workload.encode = function encode(message, writer) { + GetWorkloadRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.resources != null && message.resources.length) - for (var i = 0; i < message.resources.length; ++i) - $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.encode(message.resources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.billingAccount); - if (message.il4Settings != null && Object.hasOwnProperty.call(message, "il4Settings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.encode(message.il4Settings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.cjisSettings != null && Object.hasOwnProperty.call(message, "cjisSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.encode(message.cjisSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.fedrampHighSettings != null && Object.hasOwnProperty.call(message, "fedrampHighSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.encode(message.fedrampHighSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.fedrampModerateSettings != null && Object.hasOwnProperty.call(message, "fedrampModerateSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.encode(message.fedrampModerateSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.provisionedResourcesParent != null && Object.hasOwnProperty.call(message, "provisionedResourcesParent")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.provisionedResourcesParent); - if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.resourceSettings != null && message.resourceSettings.length) - for (var i = 0; i < message.resourceSettings.length; ++i) - $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.kajEnrollmentState != null && Object.hasOwnProperty.call(message, "kajEnrollmentState")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.kajEnrollmentState); - if (message.enableSovereignControls != null && Object.hasOwnProperty.call(message, "enableSovereignControls")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); - if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); return writer; }; /** - * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * Encodes the specified GetWorkloadRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} message GetWorkloadRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Workload.encodeDelimited = function encodeDelimited(message, writer) { + GetWorkloadRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Workload message from the specified reader or buffer. + * Decodes a GetWorkloadRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Workload.decode = function decode(reader, length) { + GetWorkloadRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.displayName = reader.string(); - break; - case 3: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.decode(reader, reader.uint32())); - break; - case 4: - message.complianceRegime = reader.int32(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.billingAccount = reader.string(); - break; - case 7: - message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.decode(reader, reader.uint32()); - break; - case 8: - message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.decode(reader, reader.uint32()); - break; - case 11: - message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.decode(reader, reader.uint32()); - break; - case 12: - message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.decode(reader, reader.uint32()); - break; - case 9: - message.etag = reader.string(); - break; - case 10: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - case 13: - message.provisionedResourcesParent = reader.string(); - break; - case 14: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - case 15: - if (!(message.resourceSettings && message.resourceSettings.length)) - message.resourceSettings = []; - message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); - break; - case 17: - message.kajEnrollmentState = reader.int32(); - break; - case 18: - message.enableSovereignControls = reader.bool(); - break; - case 20: - message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -5627,1920 +5282,3364 @@ }; /** - * Decodes a Workload message from the specified reader or buffer, length delimited. + * Decodes a GetWorkloadRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Workload.decodeDelimited = function decodeDelimited(reader) { + GetWorkloadRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Workload message. + * Verifies a GetWorkloadRequest message. * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Workload.verify = function verify(message) { + GetWorkloadRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.resources != null && message.hasOwnProperty("resources")) { - if (!Array.isArray(message.resources)) - return "resources: array expected"; - for (var i = 0; i < message.resources.length; ++i) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify(message.resources[i]); - if (error) - return "resources." + error; - } - } - if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - switch (message.complianceRegime) { - default: - return "complianceRegime: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - break; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) - if (!$util.isString(message.billingAccount)) - return "billingAccount: string expected"; - if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { - properties.complianceRegimeSettings = 1; - { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify(message.il4Settings); - if (error) - return "il4Settings." + error; - } - } - if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { - if (properties.complianceRegimeSettings === 1) - return "complianceRegimeSettings: multiple values"; - properties.complianceRegimeSettings = 1; - { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify(message.cjisSettings); - if (error) - return "cjisSettings." + error; - } - } - if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { - if (properties.complianceRegimeSettings === 1) - return "complianceRegimeSettings: multiple values"; - properties.complianceRegimeSettings = 1; - { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify(message.fedrampHighSettings); - if (error) - return "fedrampHighSettings." + error; - } - } - if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { - if (properties.complianceRegimeSettings === 1) - return "complianceRegimeSettings: multiple values"; - properties.complianceRegimeSettings = 1; - { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify(message.fedrampModerateSettings); - if (error) - return "fedrampModerateSettings." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) - if (!$util.isString(message.provisionedResourcesParent)) - return "provisionedResourcesParent: string expected"; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); - if (error) - return "kmsSettings." + error; - } - if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { - if (!Array.isArray(message.resourceSettings)) - return "resourceSettings: array expected"; - for (var i = 0; i < message.resourceSettings.length; ++i) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); - if (error) - return "resourceSettings." + error; - } - } - if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) - switch (message.kajEnrollmentState) { - default: - return "kajEnrollmentState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) - if (typeof message.enableSovereignControls !== "boolean") - return "enableSovereignControls: boolean expected"; - if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify(message.saaEnrollmentResponse); - if (error) - return "saaEnrollmentResponse." + error; - } return null; }; /** - * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * Creates a GetWorkloadRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @returns {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} GetWorkloadRequest */ - Workload.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload) + GetWorkloadRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest) return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(); + var message = new $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.resources) { - if (!Array.isArray(object.resources)) - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: array expected"); - message.resources = []; - for (var i = 0; i < object.resources.length; ++i) { - if (typeof object.resources[i] !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: object expected"); - message.resources[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.fromObject(object.resources[i]); - } - } - switch (object.complianceRegime) { - case "COMPLIANCE_REGIME_UNSPECIFIED": - case 0: - message.complianceRegime = 0; - break; - case "IL4": - case 1: - message.complianceRegime = 1; - break; - case "CJIS": - case 2: - message.complianceRegime = 2; - break; - case "FEDRAMP_HIGH": - case 3: - message.complianceRegime = 3; - break; - case "FEDRAMP_MODERATE": - case 4: - message.complianceRegime = 4; - break; - case "US_REGIONAL_ACCESS": - case 5: - message.complianceRegime = 5; - break; - case "HIPAA": - case 6: - message.complianceRegime = 6; - break; - case "HITRUST": - case 7: - message.complianceRegime = 7; - break; - case "EU_REGIONS_AND_SUPPORT": - case 8: - message.complianceRegime = 8; - break; - case "CA_REGIONS_AND_SUPPORT": - case 9: - message.complianceRegime = 9; - break; - case "ITAR": - case 10: - message.complianceRegime = 10; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.billingAccount != null) - message.billingAccount = String(object.billingAccount); - if (object.il4Settings != null) { - if (typeof object.il4Settings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.il4Settings: object expected"); - message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.fromObject(object.il4Settings); - } - if (object.cjisSettings != null) { - if (typeof object.cjisSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.cjisSettings: object expected"); - message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.fromObject(object.cjisSettings); - } - if (object.fedrampHighSettings != null) { - if (typeof object.fedrampHighSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampHighSettings: object expected"); - message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.fromObject(object.fedrampHighSettings); - } - if (object.fedrampModerateSettings != null) { - if (typeof object.fedrampModerateSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampModerateSettings: object expected"); - message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.fromObject(object.fedrampModerateSettings); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.provisionedResourcesParent != null) - message.provisionedResourcesParent = String(object.provisionedResourcesParent); - if (object.kmsSettings != null) { - if (typeof object.kmsSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.kmsSettings: object expected"); - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); - } - if (object.resourceSettings) { - if (!Array.isArray(object.resourceSettings)) - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: array expected"); - message.resourceSettings = []; - for (var i = 0; i < object.resourceSettings.length; ++i) { - if (typeof object.resourceSettings[i] !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: object expected"); - message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); - } - } - switch (object.kajEnrollmentState) { - case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": - case 0: - message.kajEnrollmentState = 0; - break; - case "KAJ_ENROLLMENT_STATE_PENDING": - case 1: - message.kajEnrollmentState = 1; - break; - case "KAJ_ENROLLMENT_STATE_COMPLETE": - case 2: - message.kajEnrollmentState = 2; - break; - } - if (object.enableSovereignControls != null) - message.enableSovereignControls = Boolean(object.enableSovereignControls); - if (object.saaEnrollmentResponse != null) { - if (typeof object.saaEnrollmentResponse !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.saaEnrollmentResponse: object expected"); - message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); - } return message; }; /** - * Creates a plain object from a Workload message. Also converts values to other types if specified. + * Creates a plain object from a GetWorkloadRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload} message Workload + * @param {google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest} message GetWorkloadRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Workload.toObject = function toObject(message, options) { + GetWorkloadRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.resources = []; - object.resourceSettings = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.displayName = ""; - object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; - object.createTime = null; - object.billingAccount = ""; - object.etag = ""; - object.provisionedResourcesParent = ""; - object.kmsSettings = null; - object.kajEnrollmentState = options.enums === String ? "KAJ_ENROLLMENT_STATE_UNSPECIFIED" : 0; - object.enableSovereignControls = false; - object.saaEnrollmentResponse = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.resources && message.resources.length) { - object.resources = []; - for (var j = 0; j < message.resources.length; ++j) - object.resources[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.toObject(message.resources[j], options); - } - if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) - object.billingAccount = message.billingAccount; - if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { - object.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.toObject(message.il4Settings, options); - if (options.oneofs) - object.complianceRegimeSettings = "il4Settings"; - } - if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { - object.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.toObject(message.cjisSettings, options); - if (options.oneofs) - object.complianceRegimeSettings = "cjisSettings"; - } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { - object.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.toObject(message.fedrampHighSettings, options); - if (options.oneofs) - object.complianceRegimeSettings = "fedrampHighSettings"; - } - if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { - object.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.toObject(message.fedrampModerateSettings, options); - if (options.oneofs) - object.complianceRegimeSettings = "fedrampModerateSettings"; - } - if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) - object.provisionedResourcesParent = message.provisionedResourcesParent; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) - object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); - if (message.resourceSettings && message.resourceSettings.length) { - object.resourceSettings = []; - for (var j = 0; j < message.resourceSettings.length; ++j) - object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); - } - if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) - object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; - if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) - object.enableSovereignControls = message.enableSovereignControls; - if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) - object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); return object; }; /** - * Converts this Workload to JSON. + * Converts this GetWorkloadRequest to JSON. * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest * @instance * @returns {Object.} JSON object */ - Workload.prototype.toJSON = function toJSON() { + GetWorkloadRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Workload.ResourceInfo = (function() { + return GetWorkloadRequest; + })(); - /** - * Properties of a ResourceInfo. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IResourceInfo - * @property {number|Long|null} [resourceId] ResourceInfo resourceId - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceInfo resourceType - */ + v1beta1.AnalyzeWorkloadMoveRequest = (function() { - /** - * Constructs a new ResourceInfo. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a ResourceInfo. - * @implements IResourceInfo - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set - */ - function ResourceInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an AnalyzeWorkloadMoveRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IAnalyzeWorkloadMoveRequest + * @property {string|null} [source] AnalyzeWorkloadMoveRequest source + * @property {string|null} [project] AnalyzeWorkloadMoveRequest project + * @property {string|null} [target] AnalyzeWorkloadMoveRequest target + */ - /** - * ResourceInfo resourceId. - * @member {number|Long} resourceId - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @instance - */ - ResourceInfo.prototype.resourceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Constructs a new AnalyzeWorkloadMoveRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents an AnalyzeWorkloadMoveRequest. + * @implements IAnalyzeWorkloadMoveRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest=} [properties] Properties to set + */ + function AnalyzeWorkloadMoveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ResourceInfo resourceType. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @instance - */ - ResourceInfo.prototype.resourceType = 0; + /** + * AnalyzeWorkloadMoveRequest source. + * @member {string|null|undefined} source + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @instance + */ + AnalyzeWorkloadMoveRequest.prototype.source = null; - /** - * Creates a new ResourceInfo instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo instance - */ - ResourceInfo.create = function create(properties) { - return new ResourceInfo(properties); - }; + /** + * AnalyzeWorkloadMoveRequest project. + * @member {string|null|undefined} project + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @instance + */ + AnalyzeWorkloadMoveRequest.prototype.project = null; - /** - * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resourceId); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); - return writer; - }; + /** + * AnalyzeWorkloadMoveRequest target. + * @member {string} target + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @instance + */ + AnalyzeWorkloadMoveRequest.prototype.target = ""; - /** - * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a ResourceInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceId = reader.int64(); - break; - case 2: - message.resourceType = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * AnalyzeWorkloadMoveRequest projectOrWorkloadResource. + * @member {"source"|"project"|undefined} projectOrWorkloadResource + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @instance + */ + Object.defineProperty(AnalyzeWorkloadMoveRequest.prototype, "projectOrWorkloadResource", { + get: $util.oneOfGetter($oneOfFields = ["source", "project"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new AnalyzeWorkloadMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest} AnalyzeWorkloadMoveRequest instance + */ + AnalyzeWorkloadMoveRequest.create = function create(properties) { + return new AnalyzeWorkloadMoveRequest(properties); + }; - /** - * Verifies a ResourceInfo message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceId != null && message.hasOwnProperty("resourceId")) - if (!$util.isInteger(message.resourceId) && !(message.resourceId && $util.isInteger(message.resourceId.low) && $util.isInteger(message.resourceId.high))) - return "resourceId: integer|Long expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - switch (message.resourceType) { - default: - return "resourceType: enum value expected"; - case 0: - case 1: - case 4: - case 2: - case 3: - break; - } - return null; - }; + /** + * Encodes the specified AnalyzeWorkloadMoveRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest} message AnalyzeWorkloadMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeWorkloadMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.target); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + return writer; + }; - /** - * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo - */ - ResourceInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); - if (object.resourceId != null) - if ($util.Long) - (message.resourceId = $util.Long.fromValue(object.resourceId)).unsigned = false; - else if (typeof object.resourceId === "string") - message.resourceId = parseInt(object.resourceId, 10); - else if (typeof object.resourceId === "number") - message.resourceId = object.resourceId; - else if (typeof object.resourceId === "object") - message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); - switch (object.resourceType) { - case "RESOURCE_TYPE_UNSPECIFIED": - case 0: - message.resourceType = 0; - break; - case "CONSUMER_PROJECT": + /** + * Encodes the specified AnalyzeWorkloadMoveRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest} message AnalyzeWorkloadMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeWorkloadMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeWorkloadMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest} AnalyzeWorkloadMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeWorkloadMoveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.resourceType = 1; + message.source = reader.string(); break; - case "CONSUMER_FOLDER": - case 4: - message.resourceType = 4; + case 3: + message.project = reader.string(); break; - case "ENCRYPTION_KEYS_PROJECT": case 2: - message.resourceType = 2; + message.target = reader.string(); break; - case "KEYRING": - case 3: - message.resourceType = 3; + default: + reader.skipType(tag & 7); break; } - return message; - }; - - /** - * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} message ResourceInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.resourceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.resourceId = options.longs === String ? "0" : 0; - object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; - } - if (message.resourceId != null && message.hasOwnProperty("resourceId")) - if (typeof message.resourceId === "number") - object.resourceId = options.longs === String ? String(message.resourceId) : message.resourceId; - else - object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; - return object; - }; + } + return message; + }; - /** - * Converts this ResourceInfo to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo - * @instance - * @returns {Object.} JSON object - */ - ResourceInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an AnalyzeWorkloadMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest} AnalyzeWorkloadMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeWorkloadMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResourceType enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType - * @enum {number} - * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value - * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value - * @property {number} CONSUMER_FOLDER=4 CONSUMER_FOLDER value - * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value - * @property {number} KEYRING=3 KEYRING value - */ - ResourceInfo.ResourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CONSUMER_PROJECT"] = 1; - values[valuesById[4] = "CONSUMER_FOLDER"] = 4; - values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; - values[valuesById[3] = "KEYRING"] = 3; - return values; - })(); + /** + * Verifies an AnalyzeWorkloadMoveRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeWorkloadMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.source != null && message.hasOwnProperty("source")) { + properties.projectOrWorkloadResource = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) { + if (properties.projectOrWorkloadResource === 1) + return "projectOrWorkloadResource: multiple values"; + properties.projectOrWorkloadResource = 1; + if (!$util.isString(message.project)) + return "project: string expected"; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + return null; + }; - return ResourceInfo; - })(); + /** + * Creates an AnalyzeWorkloadMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest} AnalyzeWorkloadMoveRequest + */ + AnalyzeWorkloadMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest(); + if (object.source != null) + message.source = String(object.source); + if (object.project != null) + message.project = String(object.project); + if (object.target != null) + message.target = String(object.target); + return message; + }; - Workload.KMSSettings = (function() { + /** + * Creates a plain object from an AnalyzeWorkloadMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest} message AnalyzeWorkloadMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeWorkloadMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.target = ""; + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object.projectOrWorkloadResource = "source"; + } + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.project != null && message.hasOwnProperty("project")) { + object.project = message.project; + if (options.oneofs) + object.projectOrWorkloadResource = "project"; + } + return object; + }; - /** - * Properties of a KMSSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IKMSSettings - * @property {google.protobuf.ITimestamp|null} [nextRotationTime] KMSSettings nextRotationTime - * @property {google.protobuf.IDuration|null} [rotationPeriod] KMSSettings rotationPeriod - */ + /** + * Converts this AnalyzeWorkloadMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeWorkloadMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new KMSSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a KMSSettings. - * @implements IKMSSettings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set - */ - function KMSSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return AnalyzeWorkloadMoveRequest; + })(); - /** - * KMSSettings nextRotationTime. - * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @instance - */ - KMSSettings.prototype.nextRotationTime = null; + v1beta1.AnalyzeWorkloadMoveResponse = (function() { - /** - * KMSSettings rotationPeriod. - * @member {google.protobuf.IDuration|null|undefined} rotationPeriod - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @instance - */ - KMSSettings.prototype.rotationPeriod = null; + /** + * Properties of an AnalyzeWorkloadMoveResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IAnalyzeWorkloadMoveResponse + * @property {Array.|null} [blockers] AnalyzeWorkloadMoveResponse blockers + */ - /** - * Creates a new KMSSettings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings instance - */ - KMSSettings.create = function create(properties) { - return new KMSSettings(properties); - }; + /** + * Constructs a new AnalyzeWorkloadMoveResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents an AnalyzeWorkloadMoveResponse. + * @implements IAnalyzeWorkloadMoveResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse=} [properties] Properties to set + */ + function AnalyzeWorkloadMoveResponse(properties) { + this.blockers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nextRotationTime != null && Object.hasOwnProperty.call(message, "nextRotationTime")) - $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.rotationPeriod != null && Object.hasOwnProperty.call(message, "rotationPeriod")) - $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * AnalyzeWorkloadMoveResponse blockers. + * @member {Array.} blockers + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @instance + */ + AnalyzeWorkloadMoveResponse.prototype.blockers = $util.emptyArray; - /** - * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KMSSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new AnalyzeWorkloadMoveResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} AnalyzeWorkloadMoveResponse instance + */ + AnalyzeWorkloadMoveResponse.create = function create(properties) { + return new AnalyzeWorkloadMoveResponse(properties); + }; - /** - * Decodes a KMSSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified AnalyzeWorkloadMoveResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse} message AnalyzeWorkloadMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeWorkloadMoveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockers != null && message.blockers.length) + for (var i = 0; i < message.blockers.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.blockers[i]); + return writer; + }; - /** - * Decodes a KMSSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KMSSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified AnalyzeWorkloadMoveResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse} message AnalyzeWorkloadMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeWorkloadMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a KMSSettings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KMSSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); - if (error) - return "nextRotationTime." + error; + /** + * Decodes an AnalyzeWorkloadMoveResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} AnalyzeWorkloadMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeWorkloadMoveResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); - if (error) - return "rotationPeriod." + error; - } - return null; - }; + } + return message; + }; - /** - * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings - */ - KMSSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); - if (object.nextRotationTime != null) { - if (typeof object.nextRotationTime !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.nextRotationTime: object expected"); - message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); - } - if (object.rotationPeriod != null) { - if (typeof object.rotationPeriod !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.rotationPeriod: object expected"); - message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); - } - return message; - }; + /** + * Decodes an AnalyzeWorkloadMoveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} AnalyzeWorkloadMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeWorkloadMoveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} message KMSSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KMSSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nextRotationTime = null; - object.rotationPeriod = null; - } - if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) - object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); - if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) - object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); + /** + * Verifies an AnalyzeWorkloadMoveResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeWorkloadMoveResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockers != null && message.hasOwnProperty("blockers")) { + if (!Array.isArray(message.blockers)) + return "blockers: array expected"; + for (var i = 0; i < message.blockers.length; ++i) + if (!$util.isString(message.blockers[i])) + return "blockers: string[] expected"; + } + return null; + }; + + /** + * Creates an AnalyzeWorkloadMoveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} AnalyzeWorkloadMoveResponse + */ + AnalyzeWorkloadMoveResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse) return object; - }; + var message = new $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse(); + if (object.blockers) { + if (!Array.isArray(object.blockers)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse.blockers: array expected"); + message.blockers = []; + for (var i = 0; i < object.blockers.length; ++i) + message.blockers[i] = String(object.blockers[i]); + } + return message; + }; - /** - * Converts this KMSSettings to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings - * @instance - * @returns {Object.} JSON object - */ - KMSSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AnalyzeWorkloadMoveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} message AnalyzeWorkloadMoveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeWorkloadMoveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.blockers = []; + if (message.blockers && message.blockers.length) { + object.blockers = []; + for (var j = 0; j < message.blockers.length; ++j) + object.blockers[j] = message.blockers[j]; + } + return object; + }; - return KMSSettings; - })(); + /** + * Converts this AnalyzeWorkloadMoveResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeWorkloadMoveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Workload.IL4Settings = (function() { + return AnalyzeWorkloadMoveResponse; + })(); - /** - * Properties of a IL4Settings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IIL4Settings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] IL4Settings kmsSettings - */ + v1beta1.ListWorkloadsRequest = (function() { - /** - * Constructs a new IL4Settings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a IL4Settings. - * @implements IIL4Settings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set - */ - function IL4Settings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IListWorkloadsRequest + * @property {string|null} [parent] ListWorkloadsRequest parent + * @property {number|null} [pageSize] ListWorkloadsRequest pageSize + * @property {string|null} [pageToken] ListWorkloadsRequest pageToken + * @property {string|null} [filter] ListWorkloadsRequest filter + */ - /** - * IL4Settings kmsSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @instance - */ - IL4Settings.prototype.kmsSettings = null; + /** + * Constructs a new ListWorkloadsRequest. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a ListWorkloadsRequest. + * @implements IListWorkloadsRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set + */ + function ListWorkloadsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new IL4Settings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings instance - */ - IL4Settings.create = function create(properties) { - return new IL4Settings(properties); - }; + /** + * ListWorkloadsRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.parent = ""; - /** - * Encodes the specified IL4Settings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IL4Settings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * ListWorkloadsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageSize = 0; - /** - * Encodes the specified IL4Settings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IL4Settings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListWorkloadsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.pageToken = ""; - /** - * Decodes a IL4Settings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IL4Settings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a IL4Settings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IL4Settings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a IL4Settings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IL4Settings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); - if (error) - return "kmsSettings." + error; - } - return null; - }; - - /** - * Creates a IL4Settings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings - */ - IL4Settings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); - if (object.kmsSettings != null) { - if (typeof object.kmsSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.kmsSettings: object expected"); - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); - } - return message; - }; - - /** - * Creates a plain object from a IL4Settings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} message IL4Settings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IL4Settings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsSettings = null; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) - object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); - return object; - }; - - /** - * Converts this IL4Settings to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings - * @instance - * @returns {Object.} JSON object - */ - IL4Settings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListWorkloadsRequest filter. + * @member {string} filter + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + */ + ListWorkloadsRequest.prototype.filter = ""; - return IL4Settings; - })(); + /** + * Creates a new ListWorkloadsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest instance + */ + ListWorkloadsRequest.create = function create(properties) { + return new ListWorkloadsRequest(properties); + }; - Workload.CJISSettings = (function() { + /** + * Encodes the specified ListWorkloadsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; - /** - * Properties of a CJISSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface ICJISSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] CJISSettings kmsSettings - */ + /** + * Encodes the specified ListWorkloadsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} message ListWorkloadsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new CJISSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a CJISSettings. - * @implements ICJISSettings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set - */ - function CJISSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + 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 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * CJISSettings kmsSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @instance - */ - CJISSettings.prototype.kmsSettings = null; + /** + * Decodes a ListWorkloadsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new CJISSettings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings instance - */ - CJISSettings.create = function create(properties) { - return new CJISSettings(properties); - }; + /** + * Verifies a ListWorkloadsRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Encodes the specified CJISSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CJISSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates a ListWorkloadsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} ListWorkloadsRequest + */ + ListWorkloadsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - /** - * Encodes the specified CJISSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CJISSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a ListWorkloadsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest} message ListWorkloadsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - /** - * Decodes a CJISSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CJISSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ListWorkloadsRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a CJISSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CJISSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ListWorkloadsRequest; + })(); - /** - * Verifies a CJISSettings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CJISSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); - if (error) - return "kmsSettings." + error; - } - return null; - }; + v1beta1.ListWorkloadsResponse = (function() { - /** - * Creates a CJISSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings - */ - CJISSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); - if (object.kmsSettings != null) { - if (typeof object.kmsSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.kmsSettings: object expected"); - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); - } - return message; - }; + /** + * Properties of a ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IListWorkloadsResponse + * @property {Array.|null} [workloads] ListWorkloadsResponse workloads + * @property {string|null} [nextPageToken] ListWorkloadsResponse nextPageToken + */ - /** - * Creates a plain object from a CJISSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} message CJISSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CJISSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsSettings = null; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) - object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); - return object; - }; + /** + * Constructs a new ListWorkloadsResponse. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a ListWorkloadsResponse. + * @implements IListWorkloadsResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set + */ + function ListWorkloadsResponse(properties) { + this.workloads = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this CJISSettings to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings - * @instance - * @returns {Object.} JSON object - */ - CJISSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListWorkloadsResponse workloads. + * @member {Array.} workloads + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.workloads = $util.emptyArray; - return CJISSettings; - })(); + /** + * ListWorkloadsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + */ + ListWorkloadsResponse.prototype.nextPageToken = ""; - Workload.FedrampHighSettings = (function() { + /** + * Creates a new ListWorkloadsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse instance + */ + ListWorkloadsResponse.create = function create(properties) { + return new ListWorkloadsResponse(properties); + }; - /** - * Properties of a FedrampHighSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IFedrampHighSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampHighSettings kmsSettings - */ - - /** - * Constructs a new FedrampHighSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a FedrampHighSettings. - * @implements IFedrampHighSettings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set - */ - function FedrampHighSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FedrampHighSettings kmsSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @instance - */ - FedrampHighSettings.prototype.kmsSettings = null; - - /** - * Creates a new FedrampHighSettings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings instance - */ - FedrampHighSettings.create = function create(properties) { - return new FedrampHighSettings(properties); - }; - - /** - * Encodes the specified FedrampHighSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FedrampHighSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListWorkloadsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workloads != null && message.workloads.length) + for (var i = 0; i < message.workloads.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.encode(message.workloads[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Encodes the specified FedrampHighSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FedrampHighSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListWorkloadsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse} message ListWorkloadsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkloadsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FedrampHighSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FedrampHighSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.workloads && message.workloads.length)) + message.workloads = []; + message.workloads.push($root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a FedrampHighSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FedrampHighSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ListWorkloadsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkloadsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a FedrampHighSettings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FedrampHighSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + /** + * Verifies a ListWorkloadsResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkloadsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workloads != null && message.hasOwnProperty("workloads")) { + if (!Array.isArray(message.workloads)) + return "workloads: array expected"; + for (var i = 0; i < message.workloads.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.verify(message.workloads[i]); if (error) - return "kmsSettings." + error; - } - return null; - }; - - /** - * Creates a FedrampHighSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings - */ - FedrampHighSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); - if (object.kmsSettings != null) { - if (typeof object.kmsSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.kmsSettings: object expected"); - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + return "workloads." + error; } - return message; - }; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * Creates a plain object from a FedrampHighSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} message FedrampHighSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FedrampHighSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsSettings = null; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) - object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + /** + * Creates a ListWorkloadsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} ListWorkloadsResponse + */ + ListWorkloadsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse) return object; - }; + var message = new $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse(); + if (object.workloads) { + if (!Array.isArray(object.workloads)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: array expected"); + message.workloads = []; + for (var i = 0; i < object.workloads.length; ++i) { + if (typeof object.workloads[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse.workloads: object expected"); + message.workloads[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.fromObject(object.workloads[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this FedrampHighSettings to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings - * @instance - * @returns {Object.} JSON object - */ - FedrampHighSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListWorkloadsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} message ListWorkloadsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkloadsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workloads = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workloads && message.workloads.length) { + object.workloads = []; + for (var j = 0; j < message.workloads.length; ++j) + object.workloads[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.toObject(message.workloads[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - return FedrampHighSettings; - })(); + /** + * Converts this ListWorkloadsResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkloadsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Workload.FedrampModerateSettings = (function() { + return ListWorkloadsResponse; + })(); - /** - * Properties of a FedrampModerateSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IFedrampModerateSettings - * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampModerateSettings kmsSettings - */ + v1beta1.Workload = (function() { - /** - * Constructs a new FedrampModerateSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a FedrampModerateSettings. - * @implements IFedrampModerateSettings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set - */ - function FedrampModerateSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Workload. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface IWorkload + * @property {string|null} [name] Workload name + * @property {string|null} [displayName] Workload displayName + * @property {Array.|null} [resources] Workload resources + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] Workload complianceRegime + * @property {google.protobuf.ITimestamp|null} [createTime] Workload createTime + * @property {string|null} [billingAccount] Workload billingAccount + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null} [il4Settings] Workload il4Settings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null} [cjisSettings] Workload cjisSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null} [fedrampHighSettings] Workload fedrampHighSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null} [fedrampModerateSettings] Workload fedrampModerateSettings + * @property {string|null} [etag] Workload etag + * @property {Object.|null} [labels] Workload labels + * @property {string|null} [provisionedResourcesParent] Workload provisionedResourcesParent + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] Workload kmsSettings + * @property {Array.|null} [resourceSettings] Workload resourceSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState + * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse + */ - /** - * FedrampModerateSettings kmsSettings. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @instance - */ - FedrampModerateSettings.prototype.kmsSettings = null; + /** + * Constructs a new Workload. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a Workload. + * @implements IWorkload + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set + */ + function Workload(properties) { + this.resources = []; + this.labels = {}; + this.resourceSettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new FedrampModerateSettings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings instance - */ - FedrampModerateSettings.create = function create(properties) { - return new FedrampModerateSettings(properties); - }; + /** + * Workload name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.name = ""; - /** - * Encodes the specified FedrampModerateSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FedrampModerateSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) - $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Workload displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.displayName = ""; - /** - * Encodes the specified FedrampModerateSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FedrampModerateSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Workload resources. + * @member {Array.} resources + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.resources = $util.emptyArray; - /** - * Decodes a FedrampModerateSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FedrampModerateSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Workload complianceRegime. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.complianceRegime = 0; - /** - * Decodes a FedrampModerateSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FedrampModerateSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Workload createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.createTime = null; - /** - * Verifies a FedrampModerateSettings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FedrampModerateSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); - if (error) - return "kmsSettings." + error; - } - return null; - }; + /** + * Workload billingAccount. + * @member {string} billingAccount + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.billingAccount = ""; - /** - * Creates a FedrampModerateSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings - */ - FedrampModerateSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); - if (object.kmsSettings != null) { - if (typeof object.kmsSettings !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.kmsSettings: object expected"); - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); - } - return message; - }; + /** + * Workload il4Settings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings|null|undefined} il4Settings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.il4Settings = null; - /** - * Creates a plain object from a FedrampModerateSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} message FedrampModerateSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FedrampModerateSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsSettings = null; - if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) - object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); - return object; - }; + /** + * Workload cjisSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings|null|undefined} cjisSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.cjisSettings = null; - /** - * Converts this FedrampModerateSettings to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings - * @instance - * @returns {Object.} JSON object - */ - FedrampModerateSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Workload fedrampHighSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings|null|undefined} fedrampHighSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.fedrampHighSettings = null; - return FedrampModerateSettings; - })(); + /** + * Workload fedrampModerateSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings|null|undefined} fedrampModerateSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.fedrampModerateSettings = null; - Workload.ResourceSettings = (function() { + /** + * Workload etag. + * @member {string} etag + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.etag = ""; - /** - * Properties of a ResourceSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @interface IResourceSettings - * @property {string|null} [resourceId] ResourceSettings resourceId - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceSettings resourceType - * @property {string|null} [displayName] ResourceSettings displayName - */ + /** + * Workload labels. + * @member {Object.} labels + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.labels = $util.emptyObject; - /** - * Constructs a new ResourceSettings. - * @memberof google.cloud.assuredworkloads.v1beta1.Workload - * @classdesc Represents a ResourceSettings. - * @implements IResourceSettings - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set - */ - function ResourceSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Workload provisionedResourcesParent. + * @member {string} provisionedResourcesParent + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.provisionedResourcesParent = ""; - /** - * ResourceSettings resourceId. - * @member {string} resourceId - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @instance - */ - ResourceSettings.prototype.resourceId = ""; + /** + * Workload kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.kmsSettings = null; - /** - * ResourceSettings resourceType. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @instance - */ - ResourceSettings.prototype.resourceType = 0; + /** + * Workload resourceSettings. + * @member {Array.} resourceSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.resourceSettings = $util.emptyArray; - /** - * ResourceSettings displayName. - * @member {string} displayName - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @instance - */ - ResourceSettings.prototype.displayName = ""; + /** + * Workload kajEnrollmentState. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState} kajEnrollmentState + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.kajEnrollmentState = 0; - /** - * Creates a new ResourceSettings instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings instance - */ - ResourceSettings.create = function create(properties) { - return new ResourceSettings(properties); - }; + /** + * Workload enableSovereignControls. + * @member {boolean} enableSovereignControls + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.enableSovereignControls = false; - /** - * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceId); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); - return writer; - }; + /** + * Workload saaEnrollmentResponse. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null|undefined} saaEnrollmentResponse + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.saaEnrollmentResponse = null; - /** - * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a ResourceSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.resourceId = reader.string(); - break; - case 2: - message.resourceType = reader.int32(); - break; - case 3: - message.displayName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Workload complianceRegimeSettings. + * @member {"il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"|undefined} complianceRegimeSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Object.defineProperty(Workload.prototype, "complianceRegimeSettings", { + get: $util.oneOfGetter($oneOfFields = ["il4Settings", "cjisSettings", "fedrampHighSettings", "fedrampModerateSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new Workload instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload instance + */ + Workload.create = function create(properties) { + return new Workload(properties); + }; - /** - * Verifies a ResourceSettings message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceId != null && message.hasOwnProperty("resourceId")) - if (!$util.isString(message.resourceId)) - return "resourceId: string expected"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - switch (message.resourceType) { - default: - return "resourceType: enum value expected"; - case 0: - case 1: - case 4: - case 2: - case 3: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; + /** + * Encodes the specified Workload message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.encode(message.resources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.billingAccount != null && Object.hasOwnProperty.call(message, "billingAccount")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.billingAccount); + if (message.il4Settings != null && Object.hasOwnProperty.call(message, "il4Settings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.encode(message.il4Settings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cjisSettings != null && Object.hasOwnProperty.call(message, "cjisSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.encode(message.cjisSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fedrampHighSettings != null && Object.hasOwnProperty.call(message, "fedrampHighSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.encode(message.fedrampHighSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.fedrampModerateSettings != null && Object.hasOwnProperty.call(message, "fedrampModerateSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.encode(message.fedrampModerateSettings, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.provisionedResourcesParent != null && Object.hasOwnProperty.call(message, "provisionedResourcesParent")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.provisionedResourcesParent); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.resourceSettings != null && message.resourceSettings.length) + for (var i = 0; i < message.resourceSettings.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.kajEnrollmentState != null && Object.hasOwnProperty.call(message, "kajEnrollmentState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.kajEnrollmentState); + if (message.enableSovereignControls != null && Object.hasOwnProperty.call(message, "enableSovereignControls")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); + if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; - /** - * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings - */ - ResourceSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); - if (object.resourceId != null) - message.resourceId = String(object.resourceId); - switch (object.resourceType) { - case "RESOURCE_TYPE_UNSPECIFIED": - case 0: - message.resourceType = 0; - break; - case "CONSUMER_PROJECT": + /** + * Encodes the specified Workload message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.IWorkload} message Workload message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workload.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Workload message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.resourceType = 1; - break; - case "CONSUMER_FOLDER": - case 4: - message.resourceType = 4; + message.name = reader.string(); break; - case "ENCRYPTION_KEYS_PROJECT": case 2: - message.resourceType = 2; + message.displayName = reader.string(); break; - case "KEYRING": case 3: - message.resourceType = 3; + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.decode(reader, reader.uint32())); break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings - * @static - * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} message ResourceSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resourceId = ""; - object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; - object.displayName = ""; - } - if (message.resourceId != null && message.hasOwnProperty("resourceId")) - object.resourceId = message.resourceId; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this ResourceSettings to JSON. + case 4: + message.complianceRegime = reader.int32(); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.billingAccount = reader.string(); + break; + case 7: + message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.decode(reader, reader.uint32()); + break; + case 8: + message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.decode(reader, reader.uint32()); + break; + case 11: + message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.decode(reader, reader.uint32()); + break; + case 12: + message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.decode(reader, reader.uint32()); + break; + case 9: + message.etag = reader.string(); + break; + case 10: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 13: + message.provisionedResourcesParent = reader.string(); + break; + case 14: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + case 15: + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + case 17: + message.kajEnrollmentState = reader.int32(); + break; + case 18: + message.enableSovereignControls = reader.bool(); + break; + case 20: + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Workload message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workload.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Workload message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Workload.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + if (!$util.isString(message.billingAccount)) + return "billingAccount: string expected"; + if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify(message.il4Settings); + if (error) + return "il4Settings." + error; + } + } + if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify(message.cjisSettings); + if (error) + return "cjisSettings." + error; + } + } + if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify(message.fedrampHighSettings); + if (error) + return "fedrampHighSettings." + error; + } + } + if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { + if (properties.complianceRegimeSettings === 1) + return "complianceRegimeSettings: multiple values"; + properties.complianceRegimeSettings = 1; + { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify(message.fedrampModerateSettings); + if (error) + return "fedrampModerateSettings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + if (!$util.isString(message.provisionedResourcesParent)) + return "provisionedResourcesParent: string expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { + if (!Array.isArray(message.resourceSettings)) + return "resourceSettings: array expected"; + for (var i = 0; i < message.resourceSettings.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); + if (error) + return "resourceSettings." + error; + } + } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + switch (message.kajEnrollmentState) { + default: + return "kajEnrollmentState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + if (typeof message.enableSovereignControls !== "boolean") + return "enableSovereignControls: boolean expected"; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.verify(message.saaEnrollmentResponse); + if (error) + return "saaEnrollmentResponse." + error; + } + return null; + }; + + /** + * Creates a Workload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload} Workload + */ + Workload.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resources: object expected"); + message.resources[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.fromObject(object.resources[i]); + } + } + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.billingAccount != null) + message.billingAccount = String(object.billingAccount); + if (object.il4Settings != null) { + if (typeof object.il4Settings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.il4Settings: object expected"); + message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.fromObject(object.il4Settings); + } + if (object.cjisSettings != null) { + if (typeof object.cjisSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.cjisSettings: object expected"); + message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.fromObject(object.cjisSettings); + } + if (object.fedrampHighSettings != null) { + if (typeof object.fedrampHighSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampHighSettings: object expected"); + message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.fromObject(object.fedrampHighSettings); + } + if (object.fedrampModerateSettings != null) { + if (typeof object.fedrampModerateSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.fedrampModerateSettings: object expected"); + message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.fromObject(object.fedrampModerateSettings); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.provisionedResourcesParent != null) + message.provisionedResourcesParent = String(object.provisionedResourcesParent); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + if (object.resourceSettings) { + if (!Array.isArray(object.resourceSettings)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: array expected"); + message.resourceSettings = []; + for (var i = 0; i < object.resourceSettings.length; ++i) { + if (typeof object.resourceSettings[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.resourceSettings: object expected"); + message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); + } + } + switch (object.kajEnrollmentState) { + case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": + case 0: + message.kajEnrollmentState = 0; + break; + case "KAJ_ENROLLMENT_STATE_PENDING": + case 1: + message.kajEnrollmentState = 1; + break; + case "KAJ_ENROLLMENT_STATE_COMPLETE": + case 2: + message.kajEnrollmentState = 2; + break; + } + if (object.enableSovereignControls != null) + message.enableSovereignControls = Boolean(object.enableSovereignControls); + if (object.saaEnrollmentResponse != null) { + if (typeof object.saaEnrollmentResponse !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.saaEnrollmentResponse: object expected"); + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); + } + return message; + }; + + /** + * Creates a plain object from a Workload message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload} message Workload + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Workload.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.resourceSettings = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + object.createTime = null; + object.billingAccount = ""; + object.etag = ""; + object.provisionedResourcesParent = ""; + object.kmsSettings = null; + object.kajEnrollmentState = options.enums === String ? "KAJ_ENROLLMENT_STATE_UNSPECIFIED" : 0; + object.enableSovereignControls = false; + object.saaEnrollmentResponse = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.toObject(message.resources[j], options); + } + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) + object.billingAccount = message.billingAccount; + if (message.il4Settings != null && message.hasOwnProperty("il4Settings")) { + object.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.toObject(message.il4Settings, options); + if (options.oneofs) + object.complianceRegimeSettings = "il4Settings"; + } + if (message.cjisSettings != null && message.hasOwnProperty("cjisSettings")) { + object.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.toObject(message.cjisSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "cjisSettings"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.fedrampHighSettings != null && message.hasOwnProperty("fedrampHighSettings")) { + object.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.toObject(message.fedrampHighSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "fedrampHighSettings"; + } + if (message.fedrampModerateSettings != null && message.hasOwnProperty("fedrampModerateSettings")) { + object.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.toObject(message.fedrampModerateSettings, options); + if (options.oneofs) + object.complianceRegimeSettings = "fedrampModerateSettings"; + } + if (message.provisionedResourcesParent != null && message.hasOwnProperty("provisionedResourcesParent")) + object.provisionedResourcesParent = message.provisionedResourcesParent; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + if (message.resourceSettings && message.resourceSettings.length) { + object.resourceSettings = []; + for (var j = 0; j < message.resourceSettings.length; ++j) + object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); + } + if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) + object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; + if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) + object.enableSovereignControls = message.enableSovereignControls; + if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) + object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); + return object; + }; + + /** + * Converts this Workload to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + * @returns {Object.} JSON object + */ + Workload.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Workload.ResourceInfo = (function() { + + /** + * Properties of a ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IResourceInfo + * @property {number|Long|null} [resourceId] ResourceInfo resourceId + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceInfo resourceType + */ + + /** + * Constructs a new ResourceInfo. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a ResourceInfo. + * @implements IResourceInfo + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set + */ + function ResourceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceInfo resourceId. + * @member {number|Long} resourceId + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ResourceInfo resourceType. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + */ + ResourceInfo.prototype.resourceType = 0; + + /** + * Creates a new ResourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo instance + */ + ResourceInfo.create = function create(properties) { + return new ResourceInfo(properties); + }; + + /** + * Encodes the specified ResourceInfo message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + return writer; + }; + + /** + * Encodes the specified ResourceInfo message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceInfo} message ResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int64(); + break; + case 2: + message.resourceType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceInfo message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isInteger(message.resourceId) && !(message.resourceId && $util.isInteger(message.resourceId.low) && $util.isInteger(message.resourceId.high))) + return "resourceId: integer|Long expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 4: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} ResourceInfo + */ + ResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo(); + if (object.resourceId != null) + if ($util.Long) + (message.resourceId = $util.Long.fromValue(object.resourceId)).unsigned = false; + else if (typeof object.resourceId === "string") + message.resourceId = parseInt(object.resourceId, 10); + else if (typeof object.resourceId === "number") + message.resourceId = object.resourceId; + else if (typeof object.resourceId === "object") + message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo} message ResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceId = options.longs === String ? "0" : 0; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (typeof message.resourceId === "number") + object.resourceId = options.longs === String ? String(message.resourceId) : message.resourceId; + else + object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + return object; + }; + + /** + * Converts this ResourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @instance + * @returns {Object.} JSON object + */ + ResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ResourceType enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value + * @property {number} CONSUMER_FOLDER=4 CONSUMER_FOLDER value + * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value + * @property {number} KEYRING=3 KEYRING value + */ + ResourceInfo.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONSUMER_PROJECT"] = 1; + values[valuesById[4] = "CONSUMER_FOLDER"] = 4; + values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; + values[valuesById[3] = "KEYRING"] = 3; + return values; + })(); + + return ResourceInfo; + })(); + + /** + * ComplianceRegime enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime + * @enum {number} + * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value + * @property {number} IL4=1 IL4 value + * @property {number} CJIS=2 CJIS value + * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value + * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value + * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value + * @property {number} HIPAA=6 HIPAA value + * @property {number} HITRUST=7 HITRUST value + * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value + * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value + * @property {number} ITAR=10 ITAR value + */ + Workload.ComplianceRegime = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; + values[valuesById[1] = "IL4"] = 1; + values[valuesById[2] = "CJIS"] = 2; + values[valuesById[3] = "FEDRAMP_HIGH"] = 3; + values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; + values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; + values[valuesById[6] = "HIPAA"] = 6; + values[valuesById[7] = "HITRUST"] = 7; + values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; + values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; + values[valuesById[10] = "ITAR"] = 10; + return values; + })(); + + Workload.KMSSettings = (function() { + + /** + * Properties of a KMSSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IKMSSettings + * @property {google.protobuf.ITimestamp|null} [nextRotationTime] KMSSettings nextRotationTime + * @property {google.protobuf.IDuration|null} [rotationPeriod] KMSSettings rotationPeriod + */ + + /** + * Constructs a new KMSSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a KMSSettings. + * @implements IKMSSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set + */ + function KMSSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KMSSettings nextRotationTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRotationTime + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.nextRotationTime = null; + + /** + * KMSSettings rotationPeriod. + * @member {google.protobuf.IDuration|null|undefined} rotationPeriod + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + */ + KMSSettings.prototype.rotationPeriod = null; + + /** + * Creates a new KMSSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings instance + */ + KMSSettings.create = function create(properties) { + return new KMSSettings(properties); + }; + + /** + * Encodes the specified KMSSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextRotationTime != null && Object.hasOwnProperty.call(message, "nextRotationTime")) + $root.google.protobuf.Timestamp.encode(message.nextRotationTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rotationPeriod != null && Object.hasOwnProperty.call(message, "rotationPeriod")) + $root.google.protobuf.Duration.encode(message.rotationPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KMSSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings} message KMSSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KMSSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KMSSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KMSSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KMSSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KMSSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRotationTime); + if (error) + return "nextRotationTime." + error; + } + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.rotationPeriod); + if (error) + return "rotationPeriod." + error; + } + return null; + }; + + /** + * Creates a KMSSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} KMSSettings + */ + KMSSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings(); + if (object.nextRotationTime != null) { + if (typeof object.nextRotationTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.nextRotationTime: object expected"); + message.nextRotationTime = $root.google.protobuf.Timestamp.fromObject(object.nextRotationTime); + } + if (object.rotationPeriod != null) { + if (typeof object.rotationPeriod !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.rotationPeriod: object expected"); + message.rotationPeriod = $root.google.protobuf.Duration.fromObject(object.rotationPeriod); + } + return message; + }; + + /** + * Creates a plain object from a KMSSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings} message KMSSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KMSSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nextRotationTime = null; + object.rotationPeriod = null; + } + if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) + object.nextRotationTime = $root.google.protobuf.Timestamp.toObject(message.nextRotationTime, options); + if (message.rotationPeriod != null && message.hasOwnProperty("rotationPeriod")) + object.rotationPeriod = $root.google.protobuf.Duration.toObject(message.rotationPeriod, options); + return object; + }; + + /** + * Converts this KMSSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @instance + * @returns {Object.} JSON object + */ + KMSSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KMSSettings; + })(); + + Workload.IL4Settings = (function() { + + /** + * Properties of a IL4Settings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IIL4Settings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] IL4Settings kmsSettings + */ + + /** + * Constructs a new IL4Settings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a IL4Settings. + * @implements IIL4Settings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set + */ + function IL4Settings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IL4Settings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @instance + */ + IL4Settings.prototype.kmsSettings = null; + + /** + * Creates a new IL4Settings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings instance + */ + IL4Settings.create = function create(properties) { + return new IL4Settings(properties); + }; + + /** + * Encodes the specified IL4Settings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IL4Settings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IL4Settings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IIL4Settings} message IL4Settings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IL4Settings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IL4Settings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IL4Settings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IL4Settings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IL4Settings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IL4Settings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IL4Settings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a IL4Settings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} IL4Settings + */ + IL4Settings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a IL4Settings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings} message IL4Settings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IL4Settings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this IL4Settings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @instance + * @returns {Object.} JSON object + */ + IL4Settings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IL4Settings; + })(); + + Workload.CJISSettings = (function() { + + /** + * Properties of a CJISSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface ICJISSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] CJISSettings kmsSettings + */ + + /** + * Constructs a new CJISSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a CJISSettings. + * @implements ICJISSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set + */ + function CJISSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CJISSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @instance + */ + CJISSettings.prototype.kmsSettings = null; + + /** + * Creates a new CJISSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings instance + */ + CJISSettings.create = function create(properties) { + return new CJISSettings(properties); + }; + + /** + * Encodes the specified CJISSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CJISSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CJISSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ICJISSettings} message CJISSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CJISSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CJISSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CJISSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CJISSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CJISSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CJISSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CJISSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a CJISSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} CJISSettings + */ + CJISSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a CJISSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings} message CJISSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CJISSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this CJISSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @instance + * @returns {Object.} JSON object + */ + CJISSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CJISSettings; + })(); + + Workload.FedrampHighSettings = (function() { + + /** + * Properties of a FedrampHighSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IFedrampHighSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampHighSettings kmsSettings + */ + + /** + * Constructs a new FedrampHighSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a FedrampHighSettings. + * @implements IFedrampHighSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set + */ + function FedrampHighSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FedrampHighSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @instance + */ + FedrampHighSettings.prototype.kmsSettings = null; + + /** + * Creates a new FedrampHighSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings instance + */ + FedrampHighSettings.create = function create(properties) { + return new FedrampHighSettings(properties); + }; + + /** + * Encodes the specified FedrampHighSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampHighSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FedrampHighSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampHighSettings} message FedrampHighSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampHighSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampHighSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FedrampHighSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampHighSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FedrampHighSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FedrampHighSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a FedrampHighSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} FedrampHighSettings + */ + FedrampHighSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a FedrampHighSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings} message FedrampHighSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FedrampHighSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this FedrampHighSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @instance + * @returns {Object.} JSON object + */ + FedrampHighSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FedrampHighSettings; + })(); + + Workload.FedrampModerateSettings = (function() { + + /** + * Properties of a FedrampModerateSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IFedrampModerateSettings + * @property {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null} [kmsSettings] FedrampModerateSettings kmsSettings + */ + + /** + * Constructs a new FedrampModerateSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a FedrampModerateSettings. + * @implements IFedrampModerateSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set + */ + function FedrampModerateSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FedrampModerateSettings kmsSettings. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.IKMSSettings|null|undefined} kmsSettings + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @instance + */ + FedrampModerateSettings.prototype.kmsSettings = null; + + /** + * Creates a new FedrampModerateSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings instance + */ + FedrampModerateSettings.create = function create(properties) { + return new FedrampModerateSettings(properties); + }; + + /** + * Encodes the specified FedrampModerateSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampModerateSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsSettings != null && Object.hasOwnProperty.call(message, "kmsSettings")) + $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.encode(message.kmsSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FedrampModerateSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IFedrampModerateSettings} message FedrampModerateSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FedrampModerateSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampModerateSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FedrampModerateSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FedrampModerateSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FedrampModerateSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FedrampModerateSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.verify(message.kmsSettings); + if (error) + return "kmsSettings." + error; + } + return null; + }; + + /** + * Creates a FedrampModerateSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} FedrampModerateSettings + */ + FedrampModerateSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings(); + if (object.kmsSettings != null) { + if (typeof object.kmsSettings !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.kmsSettings: object expected"); + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.fromObject(object.kmsSettings); + } + return message; + }; + + /** + * Creates a plain object from a FedrampModerateSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings} message FedrampModerateSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FedrampModerateSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsSettings = null; + if (message.kmsSettings != null && message.hasOwnProperty("kmsSettings")) + object.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.toObject(message.kmsSettings, options); + return object; + }; + + /** + * Converts this FedrampModerateSettings to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @instance + * @returns {Object.} JSON object + */ + FedrampModerateSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FedrampModerateSettings; + })(); + + Workload.ResourceSettings = (function() { + + /** + * Properties of a ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @interface IResourceSettings + * @property {string|null} [resourceId] ResourceSettings resourceId + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType|null} [resourceType] ResourceSettings resourceType + * @property {string|null} [displayName] ResourceSettings displayName + */ + + /** + * Constructs a new ResourceSettings. + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @classdesc Represents a ResourceSettings. + * @implements IResourceSettings + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set + */ + function ResourceSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceSettings resourceId. + * @member {string} resourceId + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceId = ""; + + /** + * ResourceSettings resourceType. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType} resourceType + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.resourceType = 0; + + /** + * ResourceSettings displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @instance + */ + ResourceSettings.prototype.displayName = ""; + + /** + * Creates a new ResourceSettings instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings instance + */ + ResourceSettings.create = function create(properties) { + return new ResourceSettings(properties); + }; + + /** + * Encodes the specified ResourceSettings message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceId); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.resourceType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified ResourceSettings message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.IResourceSettings} message ResourceSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.string(); + break; + case 2: + message.resourceType = reader.int32(); + break; + case 3: + message.displayName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSettings message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isString(message.resourceId)) + return "resourceId: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 4: + case 2: + case 3: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a ResourceSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} ResourceSettings + */ + ResourceSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings) + return object; + var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings(); + if (object.resourceId != null) + message.resourceId = String(object.resourceId); + switch (object.resourceType) { + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "CONSUMER_PROJECT": + case 1: + message.resourceType = 1; + break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; + case "ENCRYPTION_KEYS_PROJECT": + case 2: + message.resourceType = 2; + break; + case "KEYRING": + case 3: + message.resourceType = 3; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a ResourceSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings} message ResourceSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceId = ""; + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + object.resourceId = message.resourceId; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this ResourceSettings to JSON. * @function toJSON * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings * @instance @@ -7553,6 +8652,22 @@ return ResourceSettings; })(); + /** + * KajEnrollmentState enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState + * @enum {number} + * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value + * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value + * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + */ + Workload.KajEnrollmentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; + values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; + return values; + })(); + Workload.SaaEnrollmentResponse = (function() { /** @@ -7831,474 +8946,725 @@ if (options.oneofs) object._setupStatus = "setupStatus"; } - if (message.setupErrors && message.setupErrors.length) { - object.setupErrors = []; - for (var j = 0; j < message.setupErrors.length; ++j) - object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + if (message.setupErrors && message.setupErrors.length) { + object.setupErrors = []; + for (var j = 0; j < message.setupErrors.length; ++j) + object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + } + return object; + }; + + /** + * Converts this SaaEnrollmentResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @instance + * @returns {Object.} JSON object + */ + SaaEnrollmentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SetupState enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState + * @enum {number} + * @property {number} SETUP_STATE_UNSPECIFIED=0 SETUP_STATE_UNSPECIFIED value + * @property {number} STATUS_PENDING=1 STATUS_PENDING value + * @property {number} STATUS_COMPLETE=2 STATUS_COMPLETE value + */ + SaaEnrollmentResponse.SetupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATUS_PENDING"] = 1; + values[valuesById[2] = "STATUS_COMPLETE"] = 2; + return values; + })(); + + /** + * SetupError enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError + * @enum {number} + * @property {number} SETUP_ERROR_UNSPECIFIED=0 SETUP_ERROR_UNSPECIFIED value + * @property {number} ERROR_INVALID_BASE_SETUP=1 ERROR_INVALID_BASE_SETUP value + * @property {number} ERROR_MISSING_EXTERNAL_SIGNING_KEY=2 ERROR_MISSING_EXTERNAL_SIGNING_KEY value + * @property {number} ERROR_NOT_ALL_SERVICES_ENROLLED=3 ERROR_NOT_ALL_SERVICES_ENROLLED value + * @property {number} ERROR_SETUP_CHECK_FAILED=4 ERROR_SETUP_CHECK_FAILED value + */ + SaaEnrollmentResponse.SetupError = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SETUP_ERROR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ERROR_INVALID_BASE_SETUP"] = 1; + values[valuesById[2] = "ERROR_MISSING_EXTERNAL_SIGNING_KEY"] = 2; + values[valuesById[3] = "ERROR_NOT_ALL_SERVICES_ENROLLED"] = 3; + values[valuesById[4] = "ERROR_SETUP_CHECK_FAILED"] = 4; + return values; + })(); + + return SaaEnrollmentResponse; + })(); + + return Workload; + })(); + + v1beta1.CreateWorkloadOperationMetadata = (function() { + + /** + * Properties of a CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @interface ICreateWorkloadOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkloadOperationMetadata createTime + * @property {string|null} [displayName] CreateWorkloadOperationMetadata displayName + * @property {string|null} [parent] CreateWorkloadOperationMetadata parent + * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] CreateWorkloadOperationMetadata complianceRegime + * @property {Array.|null} [resourceSettings] CreateWorkloadOperationMetadata resourceSettings + */ + + /** + * Constructs a new CreateWorkloadOperationMetadata. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents a CreateWorkloadOperationMetadata. + * @implements ICreateWorkloadOperationMetadata + * @constructor + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + */ + function CreateWorkloadOperationMetadata(properties) { + this.resourceSettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkloadOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.createTime = null; + + /** + * CreateWorkloadOperationMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.displayName = ""; + + /** + * CreateWorkloadOperationMetadata parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.parent = ""; + + /** + * CreateWorkloadOperationMetadata complianceRegime. + * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.complianceRegime = 0; + + /** + * CreateWorkloadOperationMetadata resourceSettings. + * @member {Array.} resourceSettings + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + */ + CreateWorkloadOperationMetadata.prototype.resourceSettings = $util.emptyArray; + + /** + * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata instance + */ + CreateWorkloadOperationMetadata.create = function create(properties) { + return new CreateWorkloadOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); + if (message.resourceSettings != null && message.resourceSettings.length) + for (var i = 0; i < message.resourceSettings.length; ++i) + $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkloadOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.parent = reader.string(); + break; + case 4: + message.complianceRegime = reader.int32(); + break; + case 5: + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkloadOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkloadOperationMetadata message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkloadOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + switch (message.complianceRegime) { + default: + return "complianceRegime: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { + if (!Array.isArray(message.resourceSettings)) + return "resourceSettings: array expected"; + for (var i = 0; i < message.resourceSettings.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); + if (error) + return "resourceSettings." + error; } + } + return null; + }; + + /** + * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + */ + CreateWorkloadOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) return object; - }; + var message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.complianceRegime) { + case "COMPLIANCE_REGIME_UNSPECIFIED": + case 0: + message.complianceRegime = 0; + break; + case "IL4": + case 1: + message.complianceRegime = 1; + break; + case "CJIS": + case 2: + message.complianceRegime = 2; + break; + case "FEDRAMP_HIGH": + case 3: + message.complianceRegime = 3; + break; + case "FEDRAMP_MODERATE": + case 4: + message.complianceRegime = 4; + break; + case "US_REGIONAL_ACCESS": + case 5: + message.complianceRegime = 5; + break; + case "HIPAA": + case 6: + message.complianceRegime = 6; + break; + case "HITRUST": + case 7: + message.complianceRegime = 7; + break; + case "EU_REGIONS_AND_SUPPORT": + case 8: + message.complianceRegime = 8; + break; + case "CA_REGIONS_AND_SUPPORT": + case 9: + message.complianceRegime = 9; + break; + case "ITAR": + case 10: + message.complianceRegime = 10; + break; + } + if (object.resourceSettings) { + if (!Array.isArray(object.resourceSettings)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: array expected"); + message.resourceSettings = []; + for (var i = 0; i < object.resourceSettings.length; ++i) { + if (typeof object.resourceSettings[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: object expected"); + message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); + } + } + return message; + }; - /** - * Converts this SaaEnrollmentResponse to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse - * @instance - * @returns {Object.} JSON object - */ - SaaEnrollmentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkloadOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceSettings = []; + if (options.defaults) { + object.createTime = null; + object.displayName = ""; + object.parent = ""; + object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + if (message.resourceSettings && message.resourceSettings.length) { + object.resourceSettings = []; + for (var j = 0; j < message.resourceSettings.length; ++j) + object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); + } + return object; + }; - /** - * SetupState enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState - * @enum {number} - * @property {number} SETUP_STATE_UNSPECIFIED=0 SETUP_STATE_UNSPECIFIED value - * @property {number} STATUS_PENDING=1 STATUS_PENDING value - * @property {number} STATUS_COMPLETE=2 STATUS_COMPLETE value - */ - SaaEnrollmentResponse.SetupState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SETUP_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STATUS_PENDING"] = 1; - values[valuesById[2] = "STATUS_COMPLETE"] = 2; - return values; - })(); + /** + * Converts this CreateWorkloadOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateWorkloadOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * SetupError enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError - * @enum {number} - * @property {number} SETUP_ERROR_UNSPECIFIED=0 SETUP_ERROR_UNSPECIFIED value - * @property {number} ERROR_INVALID_BASE_SETUP=1 ERROR_INVALID_BASE_SETUP value - * @property {number} ERROR_MISSING_EXTERNAL_SIGNING_KEY=2 ERROR_MISSING_EXTERNAL_SIGNING_KEY value - * @property {number} ERROR_NOT_ALL_SERVICES_ENROLLED=3 ERROR_NOT_ALL_SERVICES_ENROLLED value - * @property {number} ERROR_SETUP_CHECK_FAILED=4 ERROR_SETUP_CHECK_FAILED value - */ - SaaEnrollmentResponse.SetupError = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SETUP_ERROR_UNSPECIFIED"] = 0; - values[valuesById[1] = "ERROR_INVALID_BASE_SETUP"] = 1; - values[valuesById[2] = "ERROR_MISSING_EXTERNAL_SIGNING_KEY"] = 2; - values[valuesById[3] = "ERROR_NOT_ALL_SERVICES_ENROLLED"] = 3; - values[valuesById[4] = "ERROR_SETUP_CHECK_FAILED"] = 4; - return values; - })(); + return CreateWorkloadOperationMetadata; + })(); + + v1beta1.AssuredWorkloadsService = (function() { + + /** + * Constructs a new AssuredWorkloadsService service. + * @memberof google.cloud.assuredworkloads.v1beta1 + * @classdesc Represents an AssuredWorkloadsService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AssuredWorkloadsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssuredWorkloadsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssuredWorkloadsService; + + /** + * Creates new AssuredWorkloadsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssuredWorkloadsService} RPC service. Useful where requests and/or responses are streamed. + */ + AssuredWorkloadsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - return SaaEnrollmentResponse; - })(); + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef CreateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ /** - * ComplianceRegime enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime - * @enum {number} - * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value - * @property {number} IL4=1 IL4 value - * @property {number} CJIS=2 CJIS value - * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value - * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value - * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value - * @property {number} HIPAA=6 HIPAA value - * @property {number} HITRUST=7 HITRUST value - * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value - * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value - * @property {number} ITAR=10 ITAR value + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.CreateWorkloadCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - Workload.ComplianceRegime = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; - values[valuesById[1] = "IL4"] = 1; - values[valuesById[2] = "CJIS"] = 2; - values[valuesById[3] = "FEDRAMP_HIGH"] = 3; - values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; - values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; - values[valuesById[6] = "HIPAA"] = 6; - values[valuesById[7] = "HITRUST"] = 7; - values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; - values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; - values[valuesById[10] = "ITAR"] = 10; - return values; - })(); + Object.defineProperty(AssuredWorkloadsService.prototype.createWorkload = function createWorkload(request, callback) { + return this.rpcCall(createWorkload, $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkload" }); /** - * KajEnrollmentState enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState - * @enum {number} - * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value - * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value - * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + * Calls CreateWorkload. + * @function createWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadRequest} request CreateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Workload.KajEnrollmentState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; - values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; - return values; - })(); - return Workload; - })(); + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef UpdateWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload + */ - v1beta1.CreateWorkloadOperationMetadata = (function() { + /** + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.UpdateWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.updateWorkload = function updateWorkload(request, callback) { + return this.rpcCall(updateWorkload, $root.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); + }, "name", { value: "UpdateWorkload" }); /** - * Properties of a CreateWorkloadOperationMetadata. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface ICreateWorkloadOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkloadOperationMetadata createTime - * @property {string|null} [displayName] CreateWorkloadOperationMetadata displayName - * @property {string|null} [parent] CreateWorkloadOperationMetadata parent - * @property {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime|null} [complianceRegime] CreateWorkloadOperationMetadata complianceRegime - * @property {Array.|null} [resourceSettings] CreateWorkloadOperationMetadata resourceSettings + * Calls UpdateWorkload. + * @function updateWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest} request UpdateWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new CreateWorkloadOperationMetadata. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a CreateWorkloadOperationMetadata. - * @implements ICreateWorkloadOperationMetadata - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedServices}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef RestrictAllowedServicesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} [response] RestrictAllowedServicesResponse */ - function CreateWorkloadOperationMetadata(properties) { - this.resourceSettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * CreateWorkloadOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Calls RestrictAllowedServices. + * @function restrictAllowedServices + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} request RestrictAllowedServicesRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServicesCallback} callback Node-style callback called with the error, if any, and RestrictAllowedServicesResponse + * @returns {undefined} + * @variation 1 */ - CreateWorkloadOperationMetadata.prototype.createTime = null; + Object.defineProperty(AssuredWorkloadsService.prototype.restrictAllowedServices = function restrictAllowedServices(request, callback) { + return this.rpcCall(restrictAllowedServices, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse, request, callback); + }, "name", { value: "RestrictAllowedServices" }); /** - * CreateWorkloadOperationMetadata displayName. - * @member {string} displayName - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Calls RestrictAllowedServices. + * @function restrictAllowedServices + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} request RestrictAllowedServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.prototype.displayName = ""; /** - * CreateWorkloadOperationMetadata parent. - * @member {string} parent - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedResources}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef RestrictAllowedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse} [response] RestrictAllowedResourcesResponse + */ + + /** + * Calls RestrictAllowedResources. + * @function restrictAllowedResources + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest} request RestrictAllowedResourcesRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedResourcesCallback} callback Node-style callback called with the error, if any, and RestrictAllowedResourcesResponse + * @returns {undefined} + * @variation 1 */ - CreateWorkloadOperationMetadata.prototype.parent = ""; + Object.defineProperty(AssuredWorkloadsService.prototype.restrictAllowedResources = function restrictAllowedResources(request, callback) { + return this.rpcCall(restrictAllowedResources, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse, request, callback); + }, "name", { value: "RestrictAllowedResources" }); /** - * CreateWorkloadOperationMetadata complianceRegime. - * @member {google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime} complianceRegime - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Calls RestrictAllowedResources. + * @function restrictAllowedResources + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest} request RestrictAllowedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.prototype.complianceRegime = 0; /** - * CreateWorkloadOperationMetadata resourceSettings. - * @member {Array.} resourceSettings - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef DeleteWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.DeleteWorkloadCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - CreateWorkloadOperationMetadata.prototype.resourceSettings = $util.emptyArray; + Object.defineProperty(AssuredWorkloadsService.prototype.deleteWorkload = function deleteWorkload(request, callback) { + return this.rpcCall(deleteWorkload, $root.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWorkload" }); /** - * Creates a new CreateWorkloadOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata instance + * Calls DeleteWorkload. + * @function deleteWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest} request DeleteWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.create = function create(properties) { - return new CreateWorkloadOperationMetadata(properties); - }; /** - * Encodes the specified CreateWorkloadOperationMetadata message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef GetWorkloadCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.Workload} [response] Workload */ - CreateWorkloadOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); - if (message.complianceRegime != null && Object.hasOwnProperty.call(message, "complianceRegime")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.complianceRegime); - if (message.resourceSettings != null && message.resourceSettings.length) - for (var i = 0; i < message.resourceSettings.length; ++i) - $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.encode(message.resourceSettings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified CreateWorkloadOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.GetWorkloadCallback} callback Node-style callback called with the error, if any, and Workload + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.getWorkload = function getWorkload(request, callback) { + return this.rpcCall(getWorkload, $root.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest, $root.google.cloud.assuredworkloads.v1beta1.Workload, request, callback); + }, "name", { value: "GetWorkload" }); + + /** + * Calls GetWorkload. + * @function getWorkload + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest} request GetWorkloadRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#analyzeWorkloadMove}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef AnalyzeWorkloadMoveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse} [response] AnalyzeWorkloadMoveResponse */ - CreateWorkloadOperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.parent = reader.string(); - break; - case 4: - message.complianceRegime = reader.int32(); - break; - case 5: - if (!(message.resourceSettings && message.resourceSettings.length)) - message.resourceSettings = []; - message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a CreateWorkloadOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls AnalyzeWorkloadMove. + * @function analyzeWorkloadMove + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest} request AnalyzeWorkloadMoveRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.AnalyzeWorkloadMoveCallback} callback Node-style callback called with the error, if any, and AnalyzeWorkloadMoveResponse + * @returns {undefined} + * @variation 1 */ - CreateWorkloadOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(AssuredWorkloadsService.prototype.analyzeWorkloadMove = function analyzeWorkloadMove(request, callback) { + return this.rpcCall(analyzeWorkloadMove, $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest, $root.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse, request, callback); + }, "name", { value: "AnalyzeWorkloadMove" }); /** - * Verifies a CreateWorkloadOperationMetadata message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls AnalyzeWorkloadMove. + * @function analyzeWorkloadMove + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest} request AnalyzeWorkloadMoveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - switch (message.complianceRegime) { - default: - return "complianceRegime: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - break; - } - if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { - if (!Array.isArray(message.resourceSettings)) - return "resourceSettings: array expected"; - for (var i = 0; i < message.resourceSettings.length; ++i) { - var error = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.verify(message.resourceSettings[i]); - if (error) - return "resourceSettings." + error; - } - } - return null; - }; /** - * Creates a CreateWorkloadOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} CreateWorkloadOperationMetadata + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @typedef ListWorkloadsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse} [response] ListWorkloadsResponse */ - CreateWorkloadOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.complianceRegime) { - case "COMPLIANCE_REGIME_UNSPECIFIED": - case 0: - message.complianceRegime = 0; - break; - case "IL4": - case 1: - message.complianceRegime = 1; - break; - case "CJIS": - case 2: - message.complianceRegime = 2; - break; - case "FEDRAMP_HIGH": - case 3: - message.complianceRegime = 3; - break; - case "FEDRAMP_MODERATE": - case 4: - message.complianceRegime = 4; - break; - case "US_REGIONAL_ACCESS": - case 5: - message.complianceRegime = 5; - break; - case "HIPAA": - case 6: - message.complianceRegime = 6; - break; - case "HITRUST": - case 7: - message.complianceRegime = 7; - break; - case "EU_REGIONS_AND_SUPPORT": - case 8: - message.complianceRegime = 8; - break; - case "CA_REGIONS_AND_SUPPORT": - case 9: - message.complianceRegime = 9; - break; - case "ITAR": - case 10: - message.complianceRegime = 10; - break; - } - if (object.resourceSettings) { - if (!Array.isArray(object.resourceSettings)) - throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: array expected"); - message.resourceSettings = []; - for (var i = 0; i < object.resourceSettings.length; ++i) { - if (typeof object.resourceSettings[i] !== "object") - throw TypeError(".google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata.resourceSettings: object expected"); - message.resourceSettings[i] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.fromObject(object.resourceSettings[i]); - } - } - return message; - }; /** - * Creates a plain object from a CreateWorkloadOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata - * @static - * @param {google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata} message CreateWorkloadOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.ListWorkloadsCallback} callback Node-style callback called with the error, if any, and ListWorkloadsResponse + * @returns {undefined} + * @variation 1 */ - CreateWorkloadOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceSettings = []; - if (options.defaults) { - object.createTime = null; - object.displayName = ""; - object.parent = ""; - object.complianceRegime = options.enums === String ? "COMPLIANCE_REGIME_UNSPECIFIED" : 0; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; - if (message.resourceSettings && message.resourceSettings.length) { - object.resourceSettings = []; - for (var j = 0; j < message.resourceSettings.length; ++j) - object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); - } - return object; - }; + Object.defineProperty(AssuredWorkloadsService.prototype.listWorkloads = function listWorkloads(request, callback) { + return this.rpcCall(listWorkloads, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest, $root.google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse, request, callback); + }, "name", { value: "ListWorkloads" }); /** - * Converts this CreateWorkloadOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * Calls ListWorkloads. + * @function listWorkloads + * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest} request ListWorkloadsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - CreateWorkloadOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return CreateWorkloadOperationMetadata; + return AssuredWorkloadsService; })(); return v1beta1; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index c9911fac613..d3aafc91d01 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -510,7 +510,7 @@ "csharp_namespace": "Google.Cloud.AssuredWorkloads.V1Beta1", "go_package": "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1beta1;assuredworkloads", "java_multiple_files": true, - "java_outer_classname": "AssuredworkloadsProto", + "java_outer_classname": "AssuredworkloadsServiceProto", "java_package": "com.google.cloud.assuredworkloads.v1beta1", "php_namespace": "Google\\Cloud\\AssuredWorkloads\\V1beta1", "ruby_package": "Google::Cloud::AssuredWorkloads::V1beta1", @@ -518,116 +518,6 @@ "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" }, "nested": { - "AssuredWorkloadsService": { - "options": { - "(google.api.default_host)": "assuredworkloads.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateWorkload": { - "requestType": "CreateWorkloadRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", - "(google.api.http).body": "workload", - "(google.api.method_signature)": "parent,workload", - "(google.longrunning.operation_info).response_type": "Workload", - "(google.longrunning.operation_info).metadata_type": "CreateWorkloadOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", - "body": "workload" - } - }, - { - "(google.api.method_signature)": "parent,workload" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Workload", - "metadata_type": "CreateWorkloadOperationMetadata" - } - } - ] - }, - "UpdateWorkload": { - "requestType": "UpdateWorkloadRequest", - "responseType": "Workload", - "options": { - "(google.api.http).patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", - "(google.api.http).body": "workload", - "(google.api.method_signature)": "workload,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", - "body": "workload" - } - }, - { - "(google.api.method_signature)": "workload,update_mask" - } - ] - }, - "DeleteWorkload": { - "requestType": "DeleteWorkloadRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetWorkload": { - "requestType": "GetWorkloadRequest", - "responseType": "Workload", - "options": { - "(google.api.http).get": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{name=organizations/*/locations/*/workloads/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListWorkloads": { - "requestType": "ListWorkloadsRequest", - "responseType": "ListWorkloadsResponse", - "options": { - "(google.api.http).get": "/v1beta1/{parent=organizations/*/locations/*}/workloads", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1beta1/{parent=organizations/*/locations/*}/workloads" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, "CreateWorkloadRequest": { "fields": { "parent": { @@ -672,6 +562,66 @@ } } }, + "RestrictAllowedServicesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restrictionType": { + "type": "RestrictionType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RestrictionType": { + "values": { + "RESTRICTION_TYPE_UNSPECIFIED": 0, + "ALLOW_ALL_GCP_SERVICES": 1, + "ALLOW_COMPLIANT_SERVICES": 2 + } + } + } + }, + "RestrictAllowedServicesResponse": { + "fields": {} + }, + "RestrictAllowedResourcesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restrictionType": { + "type": "RestrictionType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RestrictionType": { + "values": { + "RESTRICTION_TYPE_UNSPECIFIED": 0, + "ALLOW_ALL_GCP_RESOURCES": 1, + "ALLOW_COMPLIANT_RESOURCES": 2 + } + } + } + }, + "RestrictAllowedResourcesResponse": { + "fields": {} + }, "DeleteWorkloadRequest": { "fields": { "name": { @@ -703,6 +653,42 @@ } } }, + "AnalyzeWorkloadMoveRequest": { + "oneofs": { + "projectOrWorkloadResource": { + "oneof": [ + "source", + "project" + ] + } + }, + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 3 + }, + "target": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnalyzeWorkloadMoveResponse": { + "fields": { + "blockers": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, "ListWorkloadsRequest": { "fields": { "parent": { @@ -857,6 +843,7 @@ "type": "KMSSettings", "id": 14, "options": { + "deprecated": true, "(google.api.field_behavior)": "INPUT_ONLY" } }, @@ -914,7 +901,25 @@ } } }, + "ComplianceRegime": { + "values": { + "COMPLIANCE_REGIME_UNSPECIFIED": 0, + "IL4": 1, + "CJIS": 2, + "FEDRAMP_HIGH": 3, + "FEDRAMP_MODERATE": 4, + "US_REGIONAL_ACCESS": 5, + "HIPAA": 6, + "HITRUST": 7, + "EU_REGIONS_AND_SUPPORT": 8, + "CA_REGIONS_AND_SUPPORT": 9, + "ITAR": 10 + } + }, "KMSSettings": { + "options": { + "deprecated": true + }, "fields": { "nextRotationTime": { "type": "google.protobuf.Timestamp", @@ -1004,6 +1009,13 @@ } } }, + "KajEnrollmentState": { + "values": { + "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, + "KAJ_ENROLLMENT_STATE_PENDING": 1, + "KAJ_ENROLLMENT_STATE_COMPLETE": 2 + } + }, "SaaEnrollmentResponse": { "oneofs": { "_setupStatus": { @@ -1044,28 +1056,6 @@ } } } - }, - "ComplianceRegime": { - "values": { - "COMPLIANCE_REGIME_UNSPECIFIED": 0, - "IL4": 1, - "CJIS": 2, - "FEDRAMP_HIGH": 3, - "FEDRAMP_MODERATE": 4, - "US_REGIONAL_ACCESS": 5, - "HIPAA": 6, - "HITRUST": 7, - "EU_REGIONS_AND_SUPPORT": 8, - "CA_REGIONS_AND_SUPPORT": 9, - "ITAR": 10 - } - }, - "KajEnrollmentState": { - "values": { - "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, - "KAJ_ENROLLMENT_STATE_PENDING": 1, - "KAJ_ENROLLMENT_STATE_COMPLETE": 2 - } } } }, @@ -1108,6 +1098,136 @@ } } } + }, + "AssuredWorkloadsService": { + "options": { + "(google.api.default_host)": "assuredworkloads.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWorkload": { + "requestType": "CreateWorkloadRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "parent,workload", + "(google.longrunning.operation_info).response_type": "Workload", + "(google.longrunning.operation_info).metadata_type": "CreateWorkloadOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=organizations/*/locations/*}/workloads", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "parent,workload" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workload", + "metadata_type": "CreateWorkloadOperationMetadata" + } + } + ] + }, + "UpdateWorkload": { + "requestType": "UpdateWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.http).patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", + "(google.api.http).body": "workload", + "(google.api.method_signature)": "workload,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", + "body": "workload" + } + }, + { + "(google.api.method_signature)": "workload,update_mask" + } + ] + }, + "RestrictAllowedServices": { + "requestType": "RestrictAllowedServicesRequest", + "responseType": "RestrictAllowedServicesResponse" + }, + "RestrictAllowedResources": { + "requestType": "RestrictAllowedResourcesRequest", + "responseType": "RestrictAllowedResourcesResponse", + "options": { + "(google.api.http).post": "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources", + "body": "*" + } + } + ] + }, + "DeleteWorkload": { + "requestType": "DeleteWorkloadRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=organizations/*/locations/*/workloads/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetWorkload": { + "requestType": "GetWorkloadRequest", + "responseType": "Workload", + "options": { + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "name" + } + ] + }, + "AnalyzeWorkloadMove": { + "requestType": "AnalyzeWorkloadMoveRequest", + "responseType": "AnalyzeWorkloadMoveResponse", + "options": { + "(google.api.method_signature)": "project,target" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "project,target" + } + ] + }, + "ListWorkloads": { + "requestType": "ListWorkloadsRequest", + "responseType": "ListWorkloadsResponse", + "options": { + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "parent" + } + ] + } + } } } } diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js new file mode 100644 index 00000000000..4e394bea272 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(target) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Source is project based Workload to be moved. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const source = 'abc123' + /** + * The Source is a project based to be moved. + * This is the project's relative path in the API, formatted as + * "cloudresourcemanager.googleapis.com/projects/{project_number}" + * "projects/{project_number}" + * "cloudresourcemanager.googleapis.com/projects/{project_id}" + * "projects/{project_id}" + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const project = 'my-project' + /** + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-2". + */ + // const target = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callAnalyzeWorkloadMove() { + // Construct request + const request = { + target, + }; + + // Run request + const response = await assuredworkloadsClient.analyzeWorkloadMove(request); + console.log(response); + } + + callAnalyzeWorkloadMove(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index d6dd9f58917..a91f568b617 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -35,8 +35,8 @@ function main(parent, workload) { */ // const workload = {} /** - * Optional. A identifier associated with the workload and underlying projects - * which allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index 49b922b434d..79499396776 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -26,8 +26,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Workload to fetch. This is the - * workloads's relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js new file mode 100644 index 00000000000..cca48b2c0e6 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, restrictionType) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const name = 'abc123' + /** + * Required. The type of restriction for using gcp products in the Workload environment. + */ + // const restrictionType = {} + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callRestrictAllowedResources() { + // Construct request + const request = { + name, + restrictionType, + }; + + // Run request + const response = await assuredworkloadsClient.restrictAllowedResources(request); + console.log(response); + } + + callRestrictAllowedResources(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js new file mode 100644 index 00000000000..29e220ed7f7 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, restrictionType) { + // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const name = 'abc123' + /** + * Required. The type of restriction for using gcp services in the Workload environment. + */ + // const restrictionType = {} + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1beta1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callRestrictAllowedServices() { + // Construct request + const request = { + name, + restrictionType, + }; + + // Run request + const response = await assuredworkloadsClient.restrictAllowedServices(request); + console.log(response); + } + + callRestrictAllowedServices(); + // [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index 9cf962f5394..f12a30e948a 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -27,7 +27,7 @@ function main(workload, updateMask) { */ /** * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. + * The workload's `name` field is used to identify the workload to be updated. * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 112f6430428..1e2fe7a7d63 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -103,11 +103,99 @@ } } }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async", + "title": "AssuredWorkloadsService restrictAllowedServices Sample", + "origin": "API_DEFINITION", + "description": " Restrict the list of services allowed in the Workload environment. The current list of allowed services can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.", + "canonical": true, + "file": "assured_workloads_service.restrict_allowed_services.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestrictAllowedServices", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServices", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "restriction_type", + "type": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "RestrictAllowedServices", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServices", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_async", + "title": "AssuredWorkloadsService restrictAllowedResources Sample", + "origin": "API_DEFINITION", + "description": " Restrict the list of resources allowed in the Workload environment. The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.", + "canonical": true, + "file": "assured_workloads_service.restrict_allowed_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestrictAllowedResources", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedResources", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "restriction_type", + "type": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "RestrictAllowedResources", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedResources", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, { "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_async", "title": "AssuredWorkloadsService deleteWorkload Sample", "origin": "API_DEFINITION", - "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", + "description": " Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error. In addition to assuredworkloads.workload.delete permission, the user should also have orgpolicy.policy.set permission on the deleted folder to remove Assured Workloads OrgPolicies.", "canonical": true, "file": "assured_workloads_service.delete_workload.js", "language": "JAVASCRIPT", @@ -187,6 +275,54 @@ } } }, + { + "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async", + "title": "AssuredWorkloadsService analyzeWorkloadMove Sample", + "origin": "API_DEFINITION", + "description": " Analyze if the source Assured Workloads can be moved to the target Assured Workload", + "canonical": true, + "file": "assured_workloads_service.analyze_workload_move.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeWorkloadMove", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.AnalyzeWorkloadMove", + "async": true, + "parameters": [ + { + "name": "source", + "type": "TYPE_STRING" + }, + { + "name": "project", + "type": "TYPE_STRING" + }, + { + "name": "target", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "AnalyzeWorkloadMove", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.AnalyzeWorkloadMove", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" + } + } + } + }, { "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_async", "title": "AssuredWorkloadsService listWorkloads Sample", diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 114058c0807..8775f17bc5d 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -167,12 +167,6 @@ export class AssuredWorkloadsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - locationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}/locations/{location}' - ), - organizationPathTemplate: new this._gaxModule.PathTemplate( - 'organizations/{organization}' - ), workloadPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/workloads/{workload}' ), @@ -281,8 +275,11 @@ export class AssuredWorkloadsServiceClient { const assuredWorkloadsServiceStubMethods = [ 'createWorkload', 'updateWorkload', + 'restrictAllowedServices', + 'restrictAllowedResources', 'deleteWorkload', 'getWorkload', + 'analyzeWorkloadMove', 'listWorkloads', ]; for (const methodName of assuredWorkloadsServiceStubMethods) { @@ -379,7 +376,7 @@ export class AssuredWorkloadsServiceClient { * The request object that will be sent. * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. + * The workload's `name` field is used to identify the workload to be updated. * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} * @param {google.protobuf.FieldMask} request.updateMask @@ -474,10 +471,233 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } + /** + * Restrict the list of services allowed in the Workload environment. + * The current list of allowed services can be found at + * https://cloud.google.com/assured-workloads/docs/supported-products + * In addition to assuredworkloads.workload.update permission, the user should + * also have orgpolicy.policy.set permission on the folder resource + * to use this functionality. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType} request.restrictionType + * Required. The type of restriction for using gcp services in the Workload environment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RestrictAllowedServicesResponse]{@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async + */ + restrictAllowedServices( + request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | undefined + ), + {} | undefined + ] + >; + restrictAllowedServices( + request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedServices( + request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedServices( + request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.restrictAllowedServices( + request, + options, + callback + ); + } + /** + * Restrict the list of resources allowed in the Workload environment. + * The current list of allowed products can be found at + * https://cloud.google.com/assured-workloads/docs/supported-products + * In addition to assuredworkloads.workload.update permission, the user should + * also have orgpolicy.policy.set permission on the folder resource + * to use this functionality. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType} request.restrictionType + * Required. The type of restriction for using gcp products in the Workload environment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RestrictAllowedResourcesResponse]{@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_async + */ + restrictAllowedResources( + request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined + ] + >; + restrictAllowedResources( + request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedResources( + request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedResources( + request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restrictAllowedResources( + request, + options, + callback + ); + } /** * Deletes the workload. Make sure that workload's direct children are already * in a deleted state, otherwise the request will fail with a * FAILED_PRECONDITION error. + * In addition to assuredworkloads.workload.delete permission, the user should + * also have orgpolicy.policy.set permission on the deleted folder to remove + * Assured Workloads OrgPolicies. * * @param {Object} request * The request object that will be sent. @@ -584,8 +804,8 @@ export class AssuredWorkloadsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the - * workloads's relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -672,13 +892,122 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - name: request.name || '', - }); this.initialize(); return this.innerApiCalls.getWorkload(request, options, callback); } + /** + * Analyze if the source Assured Workloads can be moved to the target Assured + * Workload + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.source + * The Source is project based Workload to be moved. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {string} request.project + * The Source is a project based to be moved. + * This is the project's relative path in the API, formatted as + * "cloudresourcemanager.googleapis.com/projects/{project_number}" + * "projects/{project_number}" + * "cloudresourcemanager.googleapis.com/projects/{project_id}" + * "projects/{project_id}" + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {string} request.target + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-2". + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnalyzeWorkloadMoveResponse]{@link google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js + * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async + */ + analyzeWorkloadMove( + request?: protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | undefined + ), + {} | undefined + ] + >; + analyzeWorkloadMove( + request: protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeWorkloadMove( + request: protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeWorkloadMove( + request?: protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.analyzeWorkloadMove(request, options, callback); + } /** * Creates Assured Workload. @@ -691,8 +1020,8 @@ export class AssuredWorkloadsServiceClient { * @param {google.cloud.assuredworkloads.v1beta1.Workload} request.workload * Required. Assured Workload to create * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects - * which allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. * @param {object} [options] @@ -922,10 +1251,6 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - parent: request.parent || '', - }); this.initialize(); return this.innerApiCalls.listWorkloads(request, options, callback); } @@ -966,10 +1291,6 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - parent: request.parent || '', - }); const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1019,10 +1340,6 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - parent: request.parent || '', - }); const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1032,71 +1349,187 @@ export class AssuredWorkloadsServiceClient { callSettings ) as AsyncIterable; } - // -------------------- - // -- Path templates -- - // -------------------- - /** - * Return a fully-qualified location resource name string. + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. * - * @param {string} organization - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(organization: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - organization: organization, - location: location, - }); - } - - /** - * Parse the organization from Location resource. + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the organization. + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` */ - matchOrganizationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName) - .organization; + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); } - /** - * Parse the location from Location resource. + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); } - /** - * Return a fully-qualified organization resource name string. + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. * - * @param {string} organization - * @returns {string} Resource name string. + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` */ - organizationPath(organization: string) { - return this.pathTemplates.organizationPathTemplate.render({ - organization: organization, - }); + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); } /** - * Parse the organization from Organization resource. + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. * - * @param {string} organizationName - * A fully-qualified path representing Organization resource. - * @returns {string} A string representing the organization. + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` */ - matchOrganizationFromOrganizationName(organizationName: string) { - return this.pathTemplates.organizationPathTemplate.match(organizationName) - .organization; + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); } + // -------------------- + // -- Path templates -- + // -------------------- + /** * Return a fully-qualified workload resource name string. * diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json index 3cdf6b6c4b7..32424b61e27 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json @@ -42,6 +42,14 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RestrictAllowedServices": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestrictAllowedResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteWorkload": { "timeout_millis": 60000, "retry_codes_name": "unavailable", @@ -52,6 +60,11 @@ "retry_codes_name": "unavailable", "retry_params_name": "f412bc287ceb81ac34bc795a23656235608595af" }, + "AnalyzeWorkloadMove": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "f412bc287ceb81ac34bc795a23656235608595af" + }, "ListWorkloads": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json index d2953e3b11d..cc74d94f55e 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_proto_list.json @@ -1,3 +1,4 @@ [ - "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto" + "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto", + "../../protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto" ] diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json index 129b0260237..243f26113a7 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json @@ -15,6 +15,16 @@ "updateWorkload" ] }, + "RestrictAllowedServices": { + "methods": [ + "restrictAllowedServices" + ] + }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, "DeleteWorkload": { "methods": [ "deleteWorkload" @@ -25,6 +35,11 @@ "getWorkload" ] }, + "AnalyzeWorkloadMove": { + "methods": [ + "analyzeWorkloadMove" + ] + }, "CreateWorkload": { "methods": [ "createWorkload" @@ -47,6 +62,16 @@ "updateWorkload" ] }, + "RestrictAllowedServices": { + "methods": [ + "restrictAllowedServices" + ] + }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, "DeleteWorkload": { "methods": [ "deleteWorkload" @@ -57,6 +82,11 @@ "getWorkload" ] }, + "AnalyzeWorkloadMove": { + "methods": [ + "analyzeWorkloadMove" + ] + }, "CreateWorkload": { "methods": [ "createWorkload" diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 058a0e19ade..702723fa95b 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -394,8 +394,8 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); }); - describe('deleteWorkload', () => { - it('invokes deleteWorkload without error', async () => { + describe('restrictAllowedServices', () => { + it('invokes restrictAllowedServices without error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -405,31 +405,24 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse() ); - client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkload(request); + client.innerApiCalls.restrictAllowedServices = + stubSimpleCall(expectedResponse); + const [response] = await client.restrictAllowedServices(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedServices as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes deleteWorkload without error using callback', async () => { + it('invokes restrictAllowedServices without error using callback', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -439,28 +432,20 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse() ); - client.innerApiCalls.deleteWorkload = + client.innerApiCalls.restrictAllowedServices = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteWorkload( + client.restrictAllowedServices( request, ( err?: Error | null, - result?: protos.google.protobuf.IEmpty | null + result?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse | null ) => { if (err) { reject(err); @@ -473,13 +458,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.deleteWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedServices as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes deleteWorkload with error', async () => { + it('invokes restrictAllowedServices with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -489,31 +474,26 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkload = stubSimpleCall( + client.innerApiCalls.restrictAllowedServices = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.deleteWorkload(request), expectedError); + await assert.rejects( + client.restrictAllowedServices(request), + expectedError + ); assert( - (client.innerApiCalls.deleteWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedServices as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes deleteWorkload with closed client', async () => { + it('invokes restrictAllowedServices with closed client', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -523,17 +503,19 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() ); - request.name = ''; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.deleteWorkload(request), expectedError); + await assert.rejects( + client.restrictAllowedServices(request), + expectedError + ); }); }); - describe('getWorkload', () => { - it('invokes getWorkload without error', async () => { + describe('restrictAllowedResources', () => { + it('invokes restrictAllowedResources without error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -543,7 +525,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -555,19 +537,20 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); - client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkload(request); + client.innerApiCalls.restrictAllowedResources = + stubSimpleCall(expectedResponse); + const [response] = await client.restrictAllowedResources(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedResources as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getWorkload without error using callback', async () => { + it('invokes restrictAllowedResources without error using callback', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -577,7 +560,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -589,16 +572,16 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); - client.innerApiCalls.getWorkload = + client.innerApiCalls.restrictAllowedResources = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getWorkload( + client.restrictAllowedResources( request, ( err?: Error | null, - result?: protos.google.cloud.assuredworkloads.v1beta1.IWorkload | null + result?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse | null ) => { if (err) { reject(err); @@ -611,13 +594,13 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedResources as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getWorkload with error', async () => { + it('invokes restrictAllowedResources with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -627,7 +610,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); request.name = ''; const expectedHeaderRequestParams = 'name='; @@ -639,19 +622,22 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.getWorkload = stubSimpleCall( + client.innerApiCalls.restrictAllowedResources = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.getWorkload(request), expectedError); + await assert.rejects( + client.restrictAllowedResources(request), + expectedError + ); assert( - (client.innerApiCalls.getWorkload as SinonStub) + (client.innerApiCalls.restrictAllowedResources as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getWorkload with closed client', async () => { + it('invokes restrictAllowedResources with closed client', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -661,17 +647,20 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); request.name = ''; const expectedError = new Error('The client has already been closed.'); client.close(); - await assert.rejects(client.getWorkload(request), expectedError); + await assert.rejects( + client.restrictAllowedResources(request), + expectedError + ); }); }); - describe('createWorkload', () => { - it('invokes createWorkload without error', async () => { + describe('deleteWorkload', () => { + it('invokes deleteWorkload without error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -681,10 +670,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -693,21 +682,19 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.createWorkload = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createWorkload(request); - const [response] = await operation.promise(); + client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkload(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createWorkload as SinonStub) + (client.innerApiCalls.deleteWorkload as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createWorkload without error using callback', async () => { + it('invokes deleteWorkload without error using callback', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -717,10 +704,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -729,19 +716,16 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.protobuf.Empty() ); - client.innerApiCalls.createWorkload = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.deleteWorkload = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createWorkload( + client.deleteWorkload( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.assuredworkloads.v1beta1.IWorkload, - protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata - > | null + result?: protos.google.protobuf.IEmpty | null ) => { if (err) { reject(err); @@ -751,20 +735,16 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.assuredworkloads.v1beta1.IWorkload, - protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createWorkload as SinonStub) + (client.innerApiCalls.deleteWorkload as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes createWorkload with call error', async () => { + it('invokes deleteWorkload with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -774,10 +754,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -786,19 +766,19 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.createWorkload = stubLongRunningCall( + client.innerApiCalls.deleteWorkload = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createWorkload(request), expectedError); + await assert.rejects(client.deleteWorkload(request), expectedError); assert( - (client.innerApiCalls.createWorkload as SinonStub) + (client.innerApiCalls.deleteWorkload as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createWorkload with LRO error', async () => { + it('invokes deleteWorkload with closed client', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -808,33 +788,43 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkload = stubLongRunningCall( - undefined, - undefined, - expectedError + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkload(request), expectedError); + }); + }); + + describe('getWorkload', () => { + it('invokes getWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() ); - const [operation] = await client.createWorkload(request); - await assert.rejects(operation.promise(), expectedError); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ); + client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkload(request); + assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createWorkload as SinonStub) + (client.innerApiCalls.getWorkload as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkCreateWorkloadProgress without error', async () => { + it('invokes getWorkload without error using callback', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -843,23 +833,40 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { } ); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateWorkloadProgress( - expectedResponse.name + client.innerApiCalls.getWorkload = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkload( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1beta1.IWorkload | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateWorkloadProgress with error', async () => { + it('invokes getWorkload with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -868,22 +875,24 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { } ); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.getWorkload = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.checkCreateWorkloadProgress(''), - expectedError + await assert.rejects(client.getWorkload(request), expectedError); + assert( + (client.innerApiCalls.getWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - }); - describe('listWorkloads', () => { - it('invokes listWorkloads without error', async () => { + it('invokes getWorkload with closed client', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -893,17 +902,465 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkload(request), expectedError); + }); + }); + + describe('analyzeWorkloadMove', () => { + it('invokes analyzeWorkloadMove without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse() + ); + client.innerApiCalls.analyzeWorkloadMove = + stubSimpleCall(expectedResponse); + const [response] = await client.analyzeWorkloadMove(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeWorkloadMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeWorkloadMove without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse() + ); + client.innerApiCalls.analyzeWorkloadMove = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeWorkloadMove( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeWorkloadMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeWorkloadMove with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeWorkloadMove = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeWorkloadMove(request), expectedError); + assert( + (client.innerApiCalls.analyzeWorkloadMove as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeWorkloadMove with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeWorkloadMove(request), expectedError); + }); + }); + + describe('createWorkload', () => { + it('invokes createWorkload without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkload(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkload = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkload( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createWorkload with call error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkload(request), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createWorkload with LRO error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkload = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkload(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createWorkload as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateWorkloadProgress without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateWorkloadProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkloadProgress with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateWorkloadProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listWorkloads', () => { + it('invokes listWorkloads without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkloads(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloads without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.innerApiCalls.listWorkloads = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkloads( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listWorkloads with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + const expectedOptions = {otherArgs: {headers: {}}}; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkloads = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkloads(request), expectedError); + assert( + (client.innerApiCalls.listWorkloads as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listWorkloadsStream without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() @@ -915,17 +1372,115 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.Workload() ), ]; - client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkloads(request); - assert.deepStrictEqual(response, expectedResponse); + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); assert( - (client.innerApiCalls.listWorkloads as SinonStub) + (client.descriptors.page.listWorkloads.createStream as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(client.innerApiCalls.listWorkloads, request) ); }); - it('invokes listWorkloads without error using callback', async () => { + it('invokes listWorkloadsStream with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkloadsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkloads, request) + ); + }); + + it('uses async iteration with listWorkloads without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1beta1.Workload() + ), + ]; + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + []; + const iterable = client.listWorkloadsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listWorkloads with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -937,36 +1492,163 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - ]; - client.innerApiCalls.listWorkloads = - stubSimpleCallWithCallback(expectedResponse); + const expectedError = new Error('expected'); + client.descriptors.page.listWorkloads.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkloadsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkloads.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.listWorkloads( + client.operationsClient.cancelOperation( request, + undefined, ( err?: Error | null, - result?: - | protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] - | null + result?: protos.google.protobuf.Empty | null ) => { if (err) { reject(err); @@ -978,14 +1660,9 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); }); - - it('invokes listWorkloads with error', async () => { + it('invokes cancelOperation with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -993,33 +1670,26 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { projectId: 'bogus', } ); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.innerApiCalls.listWorkloads = stubSimpleCall( + client.operationsClient.cancelOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listWorkloads(request), expectedError); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); assert( - (client.innerApiCalls.listWorkloads as SinonStub) + (client.operationsClient.cancelOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); - - it('invokes listWorkloadsStream without error', async () => { + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -1029,56 +1699,22 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() - ), - ]; - client.descriptors.page.listWorkloads.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listWorkloadsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.descriptors.page.listWorkloads.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listWorkloads, request) - ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + .calledWith(request) ); }); - - it('invokes listWorkloadsStream with error', async () => { + it('invokes deleteOperation without error using callback', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -1086,47 +1722,63 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { projectId: 'bogus', } ); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkloads.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkloadsStream(request); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.Workload[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.assuredworkloads.v1beta1.Workload) => { - responses.push(response); + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - await assert.rejects(promise, expectedError); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); assert( - (client.descriptors.page.listWorkloads.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listWorkloads, request) - ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + .calledWith(request) ); }); - - it('uses async iteration with listWorkloads without error', async () => { + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -1134,47 +1786,38 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { projectId: 'bogus', } ); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.Workload() + new operationsProtos.google.longrunning.ListOperationsResponse() ), ]; - client.descriptors.page.listWorkloads.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.listWorkloadsAsync(request); + const iterable = client.operationsClient.listOperationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); }); - - it('uses async iteration with listWorkloads with error', async () => { + it('uses async iteration with listOperations with error', async () => { const client = new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( { @@ -1184,16 +1827,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listWorkloads.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkloadsAsync(request); + const iterable = client.operationsClient.listOperationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.assuredworkloads.v1beta1.IWorkload[] = + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1201,116 +1842,15 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); }); }); describe('Path templates', () => { - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - organization: 'organizationValue', - location: 'locationValue', - }; - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath( - 'organizationValue', - 'locationValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchOrganizationFromLocationName', () => { - const result = client.matchOrganizationFromLocationName(fakePath); - assert.strictEqual(result, 'organizationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('organization', () => { - const fakePath = '/rendered/path/organization'; - const expectedParameters = { - organization: 'organizationValue', - }; - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - client.pathTemplates.organizationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.organizationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('organizationPath', () => { - const result = client.organizationPath('organizationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.organizationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchOrganizationFromOrganizationName', () => { - const result = client.matchOrganizationFromOrganizationName(fakePath); - assert.strictEqual(result, 'organizationValue'); - assert( - (client.pathTemplates.organizationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - describe('workload', () => { const fakePath = '/rendered/path/workload'; const expectedParameters = { From daa5452ed4ef5a13c84e1dc65fee3f831f32731d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 2 Aug 2022 13:28:02 -0700 Subject: [PATCH 100/116] chore(main): release 3.4.0 (#180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.4.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 7 +++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- .../snippet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...pet_metadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index effdc402b13..57abccaa390 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [3.4.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.3.0...v3.4.0) (2022-07-29) + + +### Features + +* Updated the method signature of analyzeWorkloadMove for v1beta API to accept project as source. AnalyzeWorkloadMove now also returns information about org policy differences between the project and target folder ([#179](https://github.com/googleapis/nodejs-assured-workloads/issues/179)) ([b912379](https://github.com/googleapis/nodejs-assured-workloads/commit/b912379bd886bb48c66e92f445fe886e9beed22c)) + ## [3.3.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.2.0...v3.3.0) (2022-07-04) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index ebeec967f2d..a164f054d24 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.3.0", + "version": "3.4.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index a1afd67f585..54128f582c1 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 1e2fe7a7d63..90852e6539b 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.3.0", + "version": "3.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 966c9947be7..eab9db588c9 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.3.0" + "@google-cloud/assured-workloads": "^3.4.0" }, "devDependencies": { "c8": "^7.3.0", From d24842b525556ba04ad9db3f932568e47c8de830 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:10:19 +0000 Subject: [PATCH 101/116] fix: better support for fallback mode (#181) - [ ] 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 --- ...sured_workloads_service.create_workload.js | 3 + ...sured_workloads_service.delete_workload.js | 3 + .../assured_workloads_service.get_workload.js | 3 + ...ssured_workloads_service.list_workloads.js | 3 + ...sured_workloads_service.update_workload.js | 3 + ...data.google.cloud.assuredworkloads.v1.json | 10 +- ...workloads_service.analyze_workload_move.js | 3 + ...sured_workloads_service.create_workload.js | 3 + ...sured_workloads_service.delete_workload.js | 3 + .../assured_workloads_service.get_workload.js | 3 + ...ssured_workloads_service.list_workloads.js | 3 + ...oads_service.restrict_allowed_resources.js | 3 + ...loads_service.restrict_allowed_services.js | 3 + ...sured_workloads_service.update_workload.js | 3 + ...google.cloud.assuredworkloads.v1beta1.json | 16 +- .../v1/assured_workloads_service_client.ts | 10 +- .../assured_workloads_service_client.ts | 10 +- .../gapic_assured_workloads_service_v1.ts | 182 ++++++++-------- ...gapic_assured_workloads_service_v1beta1.ts | 195 ++++++++++-------- 19 files changed, 259 insertions(+), 203 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index fb5e168efb3..b90e3f669a8 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -23,6 +23,9 @@ function main(parent, workload) { // [START assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js index 4aae26694ea..a956af3b345 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -23,6 +23,9 @@ function main(name) { // [START assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index 9f7c7adac0f..8b1be84be6f 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -23,6 +23,9 @@ function main(name) { // [START assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js index 0a3312d172c..caa08e58be1 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -23,6 +23,9 @@ function main(parent) { // [START assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_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/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index d0d3aaa3d98..02bf9444d64 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -23,6 +23,9 @@ function main(workload, updateMask) { // [START assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index 54128f582c1..ed292494744 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -198,7 +198,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js index 4e394bea272..a32f8c95193 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js @@ -23,6 +23,9 @@ function main(target) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index a91f568b617..9d12ef6baed 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -23,6 +23,9 @@ function main(parent, workload) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js index 37dde8c268c..a446da8f564 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -23,6 +23,9 @@ function main(name) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index 79499396776..48e68f1fdaf 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -23,6 +23,9 @@ function main(name) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js index feb34a42c2a..995413392d7 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -23,6 +23,9 @@ function main(parent) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js index cca48b2c0e6..7a3ab42c38f 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js @@ -23,6 +23,9 @@ function main(name, restrictionType) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js index 29e220ed7f7..910e589b0c5 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js @@ -23,6 +23,9 @@ function main(name, restrictionType) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index f12a30e948a..f57e5c20764 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -23,6 +23,9 @@ function main(workload, updateMask) { // [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_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/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 90852e6539b..c73e0c9d64b 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -70,7 +70,7 @@ "segments": [ { "start": 25, - "end": 58, + "end": 61, "type": "FULL" } ], @@ -114,7 +114,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -158,7 +158,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -202,7 +202,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], @@ -246,7 +246,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -286,7 +286,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -334,7 +334,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 9a64b5b2123..d2d63c7aee0 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -30,7 +30,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'); /** @@ -307,7 +306,8 @@ export class AssuredWorkloadsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -812,7 +812,7 @@ export class AssuredWorkloadsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createWorkload, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.assuredworkloads.v1.Workload, @@ -968,7 +968,7 @@ export class AssuredWorkloadsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.createStream( - this.innerApiCalls.listWorkloads as gax.GaxCall, + this.innerApiCalls.listWorkloads as GaxCall, request, callSettings ); @@ -1022,7 +1022,7 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 8775f17bc5d..4dbb2464b1f 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -30,7 +30,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'); /** @@ -304,7 +303,8 @@ export class AssuredWorkloadsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1147,7 +1147,7 @@ export class AssuredWorkloadsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createWorkload, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.assuredworkloads.v1beta1.Workload, @@ -1295,7 +1295,7 @@ export class AssuredWorkloadsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkloads.createStream( - this.innerApiCalls.listWorkloads as gax.GaxCall, + this.innerApiCalls.listWorkloads as GaxCall, request, callSettings ); @@ -1345,7 +1345,7 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 169f2fe6284..9500e86dff4 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -145,111 +145,113 @@ function stubAsyncIterationCall( } describe('v1.AssuredWorkloadsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); - await client.initialize(); - assert(client.assuredWorkloadsServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + await client.initialize(); + assert(client.assuredWorkloadsServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assuredWorkloadsServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.assuredWorkloadsServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - 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 assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + 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 assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ - 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 assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + 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('updateWorkload', () => { diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 702723fa95b..bf8e6eace26 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -145,111 +145,126 @@ function stubAsyncIterationCall( } describe('v1beta1.AssuredWorkloadsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); - await client.initialize(); - assert(client.assuredWorkloadsServiceStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + await client.initialize(); + assert(client.assuredWorkloadsServiceStub); + }); - it('has close method for the initialized client', done => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.assuredWorkloadsServiceStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.assuredWorkloadsServiceStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.assuredWorkloadsServiceStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - 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 assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + 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 assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient({ - 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 assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( + { + 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('updateWorkload', () => { From 0e1984005a884d73ff316562b38712c8ac398dd7 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 01:32:27 +0000 Subject: [PATCH 102/116] fix: change import long to require (#182) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 626 ++- .../protos/protos.js | 3713 ++++++++++++----- .../protos/protos.json | 24 + 3 files changed, 3281 insertions(+), 1082 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index b9921c913dd..647c7a785a2 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/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 { @@ -120,35 +120,35 @@ export namespace google { namespace AssuredWorkloadsService { /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#createWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|createWorkload}. * @param error Error, if any * @param [response] Operation */ type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#updateWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|updateWorkload}. * @param error Error, if any * @param [response] Workload */ type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Workload) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#deleteWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|deleteWorkload}. * @param error Error, if any * @param [response] Empty */ type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#getWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|getWorkload}. * @param error Error, if any * @param [response] Workload */ type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Workload) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#listWorkloads}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|listWorkloads}. * @param error Error, if any * @param [response] ListWorkloadsResponse */ @@ -255,6 +255,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateWorkloadRequest. */ @@ -351,6 +358,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteWorkloadRequest. */ @@ -447,6 +461,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetWorkloadRequest. */ @@ -537,6 +558,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListWorkloadsRequest. */ @@ -645,6 +673,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkloadsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListWorkloadsResponse. */ @@ -741,6 +776,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkloadsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Workload. */ @@ -909,6 +951,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Workload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Workload { @@ -1007,6 +1056,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ResourceInfo { @@ -1114,6 +1170,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ResourceSettings. */ @@ -1216,6 +1279,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a SaaEnrollmentResponse. */ @@ -1315,6 +1385,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SaaEnrollmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SaaEnrollmentResponse { @@ -1465,6 +1542,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkloadOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -1571,6 +1655,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateWorkloadRequest. */ @@ -1667,6 +1758,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RestrictAllowedServicesRequest. */ @@ -1763,6 +1861,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedServicesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RestrictAllowedServicesRequest { @@ -1857,6 +1962,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedServicesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RestrictAllowedResourcesRequest. */ @@ -1953,6 +2065,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace RestrictAllowedResourcesRequest { @@ -2047,6 +2166,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteWorkloadRequest. */ @@ -2143,6 +2269,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetWorkloadRequest. */ @@ -2233,6 +2366,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkloadRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnalyzeWorkloadMoveRequest. */ @@ -2338,6 +2478,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeWorkloadMoveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AnalyzeWorkloadMoveResponse. */ @@ -2428,6 +2575,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeWorkloadMoveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListWorkloadsRequest. */ @@ -2536,6 +2690,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkloadsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListWorkloadsResponse. */ @@ -2632,6 +2793,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkloadsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Workload. */ @@ -2827,6 +2995,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Workload + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Workload { @@ -2925,6 +3100,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace ResourceInfo { @@ -3048,6 +3230,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KMSSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a IL4Settings. */ @@ -3138,6 +3327,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IL4Settings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CJISSettings. */ @@ -3228,6 +3424,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CJISSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FedrampHighSettings. */ @@ -3318,6 +3521,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FedrampHighSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FedrampModerateSettings. */ @@ -3408,6 +3618,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FedrampModerateSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ResourceSettings. */ @@ -3510,6 +3727,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** KajEnrollmentState enum. */ @@ -3616,6 +3840,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SaaEnrollmentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace SaaEnrollmentResponse { @@ -3750,6 +3981,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkloadOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Represents an AssuredWorkloadsService */ @@ -3888,56 +4126,56 @@ export namespace google { namespace AssuredWorkloadsService { /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|createWorkload}. * @param error Error, if any * @param [response] Operation */ type CreateWorkloadCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|updateWorkload}. * @param error Error, if any * @param [response] Workload */ type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedServices}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedServices}. * @param error Error, if any * @param [response] RestrictAllowedServicesResponse */ type RestrictAllowedServicesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedResources}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedResources}. * @param error Error, if any * @param [response] RestrictAllowedResourcesResponse */ type RestrictAllowedResourcesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|deleteWorkload}. * @param error Error, if any * @param [response] Empty */ type DeleteWorkloadCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|getWorkload}. * @param error Error, if any * @param [response] Workload */ type GetWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#analyzeWorkloadMove}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|analyzeWorkloadMove}. * @param error Error, if any * @param [response] AnalyzeWorkloadMoveResponse */ type AnalyzeWorkloadMoveCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse) => void; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|listWorkloads}. * @param error Error, if any * @param [response] ListWorkloadsResponse */ @@ -4044,6 +4282,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. */ @@ -4191,6 +4436,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. */ @@ -4287,6 +4539,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; } /** FieldBehavior enum. */ @@ -4425,6 +4684,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 { @@ -4537,6 +4803,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; } } @@ -4631,6 +4904,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. */ @@ -4671,6 +4951,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -4718,6 +5001,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 @@ -4787,6 +5073,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. */ @@ -4931,6 +5224,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 { @@ -5035,6 +5335,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. */ @@ -5131,6 +5438,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; } } @@ -5222,6 +5536,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. */ @@ -5372,6 +5693,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 { @@ -5500,6 +5828,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. */ @@ -5614,6 +5949,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 { @@ -5712,6 +6054,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; } } @@ -5815,6 +6164,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. */ @@ -5917,6 +6273,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. */ @@ -6037,6 +6400,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. */ @@ -6250,6 +6620,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 { @@ -6377,6 +6754,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. */ @@ -6394,6 +6778,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -6431,6 +6818,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -6509,6 +6899,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 { @@ -6616,6 +7013,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. */ @@ -6718,6 +7122,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. */ @@ -6814,6 +7225,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. */ @@ -6916,6 +7334,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. */ @@ -7027,6 +7452,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 { @@ -7163,6 +7595,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 { @@ -7261,6 +7700,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; } } @@ -7352,6 +7798,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 { @@ -7468,6 +7921,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; } } @@ -7559,6 +8019,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 { @@ -7577,6 +8044,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. */ @@ -7600,6 +8070,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 @@ -7669,6 +8142,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 + } } } @@ -7766,6 +8256,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Duration. */ @@ -7862,6 +8359,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Empty. */ @@ -7946,6 +8450,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; } /** Properties of a FieldMask. */ @@ -8036,6 +8547,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Timestamp. */ @@ -8132,6 +8650,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; } } @@ -8232,35 +8757,35 @@ export namespace google { namespace Operations { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @param error Error, if any * @param [response] ListOperationsResponse */ type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @param error Error, if any * @param [response] Operation */ type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @param error Error, if any * @param [response] Empty */ type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @param error Error, if any * @param [response] Empty */ type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @param error Error, if any * @param [response] Operation */ @@ -8382,6 +8907,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetOperationRequest. */ @@ -8472,6 +9004,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsRequest. */ @@ -8580,6 +9119,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListOperationsResponse. */ @@ -8676,6 +9222,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CancelOperationRequest. */ @@ -8766,6 +9319,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteOperationRequest. */ @@ -8856,6 +9416,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a WaitOperationRequest. */ @@ -8952,6 +9519,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationInfo. */ @@ -9048,6 +9622,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -9154,6 +9735,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 6f5ddd3a425..4af4984725d 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#createWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|createWorkload}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService * @typedef CreateWorkloadCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#updateWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|updateWorkload}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService * @typedef UpdateWorkloadCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#deleteWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|deleteWorkload}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService * @typedef DeleteWorkloadCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#getWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|getWorkload}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService * @typedef GetWorkloadCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService#listWorkloads}. + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|listWorkloads}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService * @typedef ListWorkloadsCallback * @type {function} @@ -380,15 +380,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); - break; - case 3: - message.externalId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); + break; + } + case 3: { + message.externalId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -500,6 +503,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.CreateWorkloadRequest"; + }; + return CreateWorkloadRequest; })(); @@ -606,12 +624,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.workload = $root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -720,6 +740,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.UpdateWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.UpdateWorkloadRequest"; + }; + return UpdateWorkloadRequest; })(); @@ -826,12 +861,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.etag = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -930,6 +967,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.DeleteWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.DeleteWorkloadRequest"; + }; + return DeleteWorkloadRequest; })(); @@ -1025,9 +1077,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; @@ -1117,6 +1170,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.GetWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.GetWorkloadRequest"; + }; + return GetWorkloadRequest; })(); @@ -1245,18 +1313,22 @@ 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 4: - message.filter = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1371,6 +1443,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListWorkloadsRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkloadsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.ListWorkloadsRequest"; + }; + return ListWorkloadsRequest; })(); @@ -1479,14 +1566,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.workloads && message.workloads.length)) - message.workloads = []; - message.workloads.push($root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.workloads && message.workloads.length)) + message.workloads = []; + message.workloads.push($root.google.cloud.assuredworkloads.v1.Workload.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1602,6 +1691,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListWorkloadsResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.ListWorkloadsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkloadsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.ListWorkloadsResponse"; + }; + return ListWorkloadsResponse; })(); @@ -1846,71 +1950,85 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.decode(reader, reader.uint32())); - break; - case 4: - message.complianceRegime = reader.int32(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.billingAccount = reader.string(); - break; - case 9: - message.etag = reader.string(); - break; - case 10: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.decode(reader, reader.uint32())); + break; + } + case 4: { + message.complianceRegime = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.billingAccount = reader.string(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + } + case 13: { + message.provisionedResourcesParent = reader.string(); + break; + } + case 14: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } + case 15: { + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + } + case 17: { + message.kajEnrollmentState = reader.int32(); + break; + } + case 18: { + message.enableSovereignControls = reader.bool(); + break; + } + case 20: { + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 13: - message.provisionedResourcesParent = reader.string(); - break; - case 14: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - case 15: - if (!(message.resourceSettings && message.resourceSettings.length)) - message.resourceSettings = []; - message.resourceSettings.push($root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.decode(reader, reader.uint32())); - break; - case 17: - message.kajEnrollmentState = reader.int32(); - break; - case 18: - message.enableSovereignControls = reader.bool(); - break; - case 20: - message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -2247,6 +2365,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Workload + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Workload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Workload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Workload"; + }; + Workload.ResourceInfo = (function() { /** @@ -2350,12 +2483,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceId = reader.int64(); - break; - case 2: - message.resourceType = reader.int32(); - break; + case 1: { + message.resourceId = reader.int64(); + break; + } + case 2: { + message.resourceType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2491,6 +2626,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceInfo + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Workload.ResourceInfo"; + }; + /** * ResourceType enum. * @name google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType @@ -2615,12 +2765,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2729,6 +2881,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for KMSSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Workload.KMSSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Workload.KMSSettings"; + }; + return KMSSettings; })(); @@ -2846,15 +3013,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceId = reader.string(); - break; - case 2: - message.resourceType = reader.int32(); - break; - case 3: - message.displayName = reader.string(); - break; + case 1: { + message.resourceId = reader.string(); + break; + } + case 2: { + message.resourceType = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -2984,6 +3154,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Workload.ResourceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Workload.ResourceSettings"; + }; + return ResourceSettings; })(); @@ -3109,19 +3294,21 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.setupStatus = reader.int32(); - break; - case 2: - if (!(message.setupErrors && message.setupErrors.length)) - message.setupErrors = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.setupStatus = reader.int32(); + break; + } + case 2: { + if (!(message.setupErrors && message.setupErrors.length)) + message.setupErrors = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.setupErrors.push(reader.int32()); + } else message.setupErrors.push(reader.int32()); - } else - message.setupErrors.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -3284,6 +3471,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SaaEnrollmentResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SaaEnrollmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse"; + }; + /** * SetupState enum. * @name google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState @@ -3499,18 +3701,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.parent = reader.string(); - break; - case 4: - message.complianceRegime = reader.int32(); - break; + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + case 4: { + message.complianceRegime = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -3688,6 +3894,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateWorkloadOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkloadOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata"; + }; + return CreateWorkloadOperationMetadata; })(); @@ -3817,15 +4038,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); - break; - case 3: - message.externalId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); + break; + } + case 3: { + message.externalId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3937,6 +4161,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest"; + }; + return CreateWorkloadRequest; })(); @@ -4043,12 +4282,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.workload = $root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4157,6 +4398,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest"; + }; + return UpdateWorkloadRequest; })(); @@ -4263,12 +4519,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.restrictionType = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.restrictionType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4385,6 +4643,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestrictAllowedServicesRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest"; + }; + /** * RestrictionType enum. * @name google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType @@ -4561,6 +4834,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestrictAllowedServicesResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse"; + }; + return RestrictAllowedServicesResponse; })(); @@ -4667,12 +4955,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.restrictionType = reader.int32(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.restrictionType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4789,6 +5079,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestrictAllowedResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest"; + }; + /** * RestrictionType enum. * @name google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType @@ -4965,6 +5270,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestrictAllowedResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse"; + }; + return RestrictAllowedResourcesResponse; })(); @@ -5071,12 +5391,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.etag = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5175,6 +5497,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest"; + }; + return DeleteWorkloadRequest; })(); @@ -5270,9 +5607,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; @@ -5362,6 +5700,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetWorkloadRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkloadRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest"; + }; + return GetWorkloadRequest; })(); @@ -5493,15 +5846,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.source = reader.string(); - break; - case 3: - message.project = reader.string(); - break; - case 2: - message.target = reader.string(); - break; + case 1: { + message.source = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 2: { + message.target = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5618,6 +5974,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeWorkloadMoveRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeWorkloadMoveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest"; + }; + return AnalyzeWorkloadMoveRequest; })(); @@ -5715,11 +6086,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.blockers && message.blockers.length)) - message.blockers = []; - message.blockers.push(reader.string()); - break; + case 1: { + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -5821,6 +6193,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AnalyzeWorkloadMoveResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeWorkloadMoveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse"; + }; + return AnalyzeWorkloadMoveResponse; })(); @@ -5949,18 +6336,22 @@ 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 4: - message.filter = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6075,6 +6466,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListWorkloadsRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkloadsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest"; + }; + return ListWorkloadsRequest; })(); @@ -6183,14 +6589,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.workloads && message.workloads.length)) - message.workloads = []; - message.workloads.push($root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.workloads && message.workloads.length)) + message.workloads = []; + message.workloads.push($root.google.cloud.assuredworkloads.v1beta1.Workload.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6306,6 +6714,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListWorkloadsResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkloadsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.ListWorkloadsResponse"; + }; + return ListWorkloadsResponse; })(); @@ -6608,83 +7031,101 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - if (!(message.resources && message.resources.length)) - message.resources = []; - message.resources.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.decode(reader, reader.uint32())); - break; - case 4: - message.complianceRegime = reader.int32(); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.billingAccount = reader.string(); - break; - case 7: - message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.decode(reader, reader.uint32()); - break; - case 8: - message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.decode(reader, reader.uint32()); - break; - case 11: - message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.decode(reader, reader.uint32()); - break; - case 12: - message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.decode(reader, reader.uint32()); - break; - case 9: - message.etag = reader.string(); - break; - case 10: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.decode(reader, reader.uint32())); + break; + } + case 4: { + message.complianceRegime = reader.int32(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.billingAccount = reader.string(); + break; + } + case 7: { + message.il4Settings = $root.google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cjisSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings.decode(reader, reader.uint32()); + break; + } + case 11: { + message.fedrampHighSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings.decode(reader, reader.uint32()); + break; + } + case 12: { + message.fedrampModerateSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings.decode(reader, reader.uint32()); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + } + case 13: { + message.provisionedResourcesParent = reader.string(); + break; + } + case 14: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } + case 15: { + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + } + case 17: { + message.kajEnrollmentState = reader.int32(); + break; + } + case 18: { + message.enableSovereignControls = reader.bool(); + break; + } + case 20: { + message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 13: - message.provisionedResourcesParent = reader.string(); - break; - case 14: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; - case 15: - if (!(message.resourceSettings && message.resourceSettings.length)) - message.resourceSettings = []; - message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); - break; - case 17: - message.kajEnrollmentState = reader.int32(); - break; - case 18: - message.enableSovereignControls = reader.bool(); - break; - case 20: - message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -7100,6 +7541,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Workload + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Workload.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload"; + }; + Workload.ResourceInfo = (function() { /** @@ -7203,12 +7659,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceId = reader.int64(); - break; - case 2: - message.resourceType = reader.int32(); - break; + case 1: { + message.resourceId = reader.int64(); + break; + } + case 2: { + message.resourceType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7350,8 +7808,23 @@ }; /** - * ResourceType enum. - * @name google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType + * Gets the default type url for ResourceInfo + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo"; + }; + + /** + * ResourceType enum. + * @name google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType * @enum {number} * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value @@ -7507,12 +7980,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.nextRotationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rotationPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7621,6 +8096,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for KMSSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KMSSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings"; + }; + return KMSSettings; })(); @@ -7716,9 +8206,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; + case 1: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -7813,6 +8304,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IL4Settings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IL4Settings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.IL4Settings"; + }; + return IL4Settings; })(); @@ -7908,9 +8414,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; + case 1: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8005,6 +8512,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CJISSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CJISSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.CJISSettings"; + }; + return CJISSettings; })(); @@ -8100,9 +8622,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; + case 1: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8197,6 +8720,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FedrampHighSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FedrampHighSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.FedrampHighSettings"; + }; + return FedrampHighSettings; })(); @@ -8292,9 +8830,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); - break; + case 1: { + message.kmsSettings = $root.google.cloud.assuredworkloads.v1beta1.Workload.KMSSettings.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8389,6 +8928,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FedrampModerateSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FedrampModerateSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.FedrampModerateSettings"; + }; + return FedrampModerateSettings; })(); @@ -8506,15 +9060,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resourceId = reader.string(); - break; - case 2: - message.resourceType = reader.int32(); - break; - case 3: - message.displayName = reader.string(); - break; + case 1: { + message.resourceId = reader.string(); + break; + } + case 2: { + message.resourceType = reader.int32(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8649,6 +9206,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ResourceSettings + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings"; + }; + return ResourceSettings; })(); @@ -8790,19 +9362,21 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.setupStatus = reader.int32(); - break; - case 2: - if (!(message.setupErrors && message.setupErrors.length)) - message.setupErrors = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.setupStatus = reader.int32(); + break; + } + case 2: { + if (!(message.setupErrors && message.setupErrors.length)) + message.setupErrors = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.setupErrors.push(reader.int32()); + } else message.setupErrors.push(reader.int32()); - } else - message.setupErrors.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -8965,6 +9539,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for SaaEnrollmentResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SaaEnrollmentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse"; + }; + /** * SetupState enum. * @name google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState @@ -9145,23 +9734,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.parent = reader.string(); - break; - case 4: - message.complianceRegime = reader.int32(); - break; - case 5: - if (!(message.resourceSettings && message.resourceSettings.length)) - message.resourceSettings = []; - message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); - break; + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.parent = reader.string(); + break; + } + case 4: { + message.complianceRegime = reader.int32(); + break; + } + case 5: { + if (!(message.resourceSettings && message.resourceSettings.length)) + message.resourceSettings = []; + message.resourceSettings.push($root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -9365,6 +9959,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateWorkloadOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkloadOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata"; + }; + return CreateWorkloadOperationMetadata; })(); @@ -9401,7 +10010,7 @@ }; /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#createWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|createWorkload}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef CreateWorkloadCallback * @type {function} @@ -9434,7 +10043,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#updateWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|updateWorkload}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef UpdateWorkloadCallback * @type {function} @@ -9467,7 +10076,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedServices}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedServices}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef RestrictAllowedServicesCallback * @type {function} @@ -9500,7 +10109,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#restrictAllowedResources}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedResources}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef RestrictAllowedResourcesCallback * @type {function} @@ -9533,7 +10142,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#deleteWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|deleteWorkload}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef DeleteWorkloadCallback * @type {function} @@ -9566,7 +10175,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#getWorkload}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|getWorkload}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef GetWorkloadCallback * @type {function} @@ -9599,7 +10208,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#analyzeWorkloadMove}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|analyzeWorkloadMove}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef AnalyzeWorkloadMoveCallback * @type {function} @@ -9632,7 +10241,7 @@ */ /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService#listWorkloads}. + * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|listWorkloads}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService * @typedef ListWorkloadsCallback * @type {function} @@ -9790,14 +10399,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; @@ -9913,6 +10524,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; })(); @@ -10123,38 +10749,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; @@ -10376,6 +11012,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; })(); @@ -10482,12 +11133,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; @@ -10586,6 +11239,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; })(); @@ -10780,36 +11448,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; @@ -11007,6 +11682,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 @@ -11143,13 +11833,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; } @@ -11247,6 +11939,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; })(); @@ -11356,11 +12063,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; @@ -11467,6 +12175,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; })(); @@ -11488,6 +12211,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 */ /** @@ -11608,6 +12332,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 @@ -11663,6 +12395,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; }; @@ -11697,66 +12431,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; @@ -11868,6 +12618,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; }; @@ -11960,6 +12713,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -11991,6 +12746,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12037,6 +12793,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; }; @@ -12051,6 +12809,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; })(); @@ -12261,52 +13034,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; @@ -12607,6 +13390,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() { /** @@ -12721,15 +13519,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; @@ -12841,6 +13642,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; })(); @@ -12947,12 +13763,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; @@ -13051,6 +13869,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; })(); @@ -13151,11 +13984,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; @@ -13262,6 +14096,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; })(); @@ -13467,39 +14316,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; @@ -13786,6 +14646,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 @@ -13954,12 +14829,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; @@ -14063,6 +14940,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; })(); @@ -14208,27 +15100,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; @@ -14404,6 +15301,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() { /** @@ -14507,12 +15419,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; @@ -14611,6 +15525,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; })(); @@ -14731,15 +15660,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; @@ -14851,6 +15783,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; })(); @@ -14970,17 +15917,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; @@ -15110,6 +16060,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; })(); @@ -15260,24 +16225,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; @@ -15413,6 +16384,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; })(); @@ -15743,76 +16729,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; @@ -16125,6 +17133,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 @@ -16293,26 +17316,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; @@ -16466,6 +17495,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; })(); @@ -16479,6 +17523,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 @@ -16528,12 +17573,20 @@ FieldOptions.prototype.jstype = 0; /** - * FieldOptions lazy. - * @member {boolean} lazy + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype.lazy = false; + FieldOptions.prototype.unverifiedLazy = false; /** * FieldOptions deprecated. @@ -16611,6 +17664,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(); @@ -16656,42 +17711,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; @@ -16751,6 +17819,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"; @@ -16836,6 +17907,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) @@ -16923,6 +17996,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")) @@ -16937,6 +18011,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) @@ -16963,6 +18039,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 @@ -17092,11 +18183,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; @@ -17203,6 +18295,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; })(); @@ -17322,17 +18429,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; @@ -17457,6 +18567,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; })(); @@ -17565,14 +18690,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; @@ -17688,6 +18815,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; })(); @@ -17818,20 +18960,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; @@ -17964,6 +19110,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; })(); @@ -18118,28 +19279,34 @@ 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 1049: - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - 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; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -18329,6 +19496,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 @@ -18508,29 +19690,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; @@ -18643,7 +19832,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); @@ -18724,6 +19913,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() { /** @@ -18825,12 +20029,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; @@ -18931,6 +20137,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; })(); @@ -19031,11 +20252,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; @@ -19142,6 +20364,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() { /** @@ -19290,37 +20527,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; @@ -19481,6 +20723,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; })(); @@ -19581,11 +20838,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; @@ -19692,6 +20950,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() { /** @@ -19702,6 +20975,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 */ /** @@ -19752,6 +21026,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 @@ -19788,6 +21070,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; }; @@ -19819,28 +21103,36 @@ if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - 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) + 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) + 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; @@ -19892,6 +21184,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; }; @@ -19920,6 +21221,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; }; @@ -19942,6 +21257,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -19954,6 +21270,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; }; @@ -19968,6 +21286,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; })(); @@ -20077,12 +21426,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -20144,7 +21495,7 @@ if (object.value != null) if (typeof object.value === "string") $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -20190,6 +21541,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + return Any; })(); @@ -20296,12 +21662,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; @@ -20414,6 +21782,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + return Duration; })(); @@ -20574,6 +21957,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; })(); @@ -20671,11 +22069,12 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -20777,6 +22176,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + return FieldMask; })(); @@ -20883,12 +22297,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; @@ -21001,6 +22417,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; })(); @@ -21049,7 +22480,7 @@ }; /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} @@ -21082,7 +22513,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} @@ -21115,7 +22546,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} @@ -21148,7 +22579,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} @@ -21181,7 +22612,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} @@ -21366,21 +22797,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; - case 3: - message.done = reader.bool(); - break; - case 4: - message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 5: - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -21531,6 +22967,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + return Operation; })(); @@ -21626,9 +23077,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; @@ -21718,6 +23170,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + return GetOperationRequest; })(); @@ -21846,18 +23313,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.name = reader.string(); - break; - case 1: - message.filter = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21972,6 +23443,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + return ListOperationsRequest; })(); @@ -22080,14 +23566,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22203,6 +23691,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + return ListOperationsResponse; })(); @@ -22298,9 +23801,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; @@ -22390,6 +23894,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + return CancelOperationRequest; })(); @@ -22485,9 +24004,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; @@ -22577,6 +24097,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + return DeleteOperationRequest; })(); @@ -22683,12 +24218,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -22792,6 +24329,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + return WaitOperationRequest; })(); @@ -22898,12 +24450,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.responseType = reader.string(); - break; - case 2: - message.metadataType = reader.string(); - break; + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -23002,6 +24556,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + return OperationInfo; })(); @@ -23133,17 +24702,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.code = reader.int32(); - break; - case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -23268,6 +24840,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + return Status; })(); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index d3aafc91d01..c41e03bd033 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -1527,6 +1527,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2055,6 +2059,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2347,6 +2358,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From 6cf15d77631946fb336791c2d3da347554eb75cd Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:42:46 -0700 Subject: [PATCH 103/116] chore(main): release 3.4.1 (#183) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.4.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-assuredworkloads/CHANGELOG.md | 9 +++++++++ packages/google-cloud-assuredworkloads/package.json | 2 +- ...nippet_metadata.google.cloud.assuredworkloads.v1.json | 2 +- ...t_metadata.google.cloud.assuredworkloads.v1beta1.json | 2 +- .../google-cloud-assuredworkloads/samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index 57abccaa390..d586dd5fd2b 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [3.4.1](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.4.0...v3.4.1) (2022-08-23) + + +### Bug Fixes + +* better support for fallback mode ([#181](https://github.com/googleapis/nodejs-assured-workloads/issues/181)) ([98e8596](https://github.com/googleapis/nodejs-assured-workloads/commit/98e8596c9bda01cf384c07f157e823ee41f28acd)) +* change import long to require ([#182](https://github.com/googleapis/nodejs-assured-workloads/issues/182)) ([8a77a07](https://github.com/googleapis/nodejs-assured-workloads/commit/8a77a076dc8585ad1b98cb3058fde15b225ed22f)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-assured-workloads/issues/1546)) ([#184](https://github.com/googleapis/nodejs-assured-workloads/issues/184)) ([796b8c2](https://github.com/googleapis/nodejs-assured-workloads/commit/796b8c2fb5a8010a2db974eaef5b2d34f2e402bc)) + ## [3.4.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.3.0...v3.4.0) (2022-07-29) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index a164f054d24..ae74fa4d76f 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.4.0", + "version": "3.4.1", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index ed292494744..e8c2e83063b 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index c73e0c9d64b..588a0c0b6bf 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index eab9db588c9..cb7788bf813 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.4.0" + "@google-cloud/assured-workloads": "^3.4.1" }, "devDependencies": { "c8": "^7.3.0", From 858f8b87299491fe7f9d7e05f446c385a5f94439 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:27 +0000 Subject: [PATCH 104/116] fix: do not import the whole google-gax from proto JS (#1553) (#186) 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 --- packages/google-cloud-assuredworkloads/package.json | 2 +- packages/google-cloud-assuredworkloads/protos/protos.d.ts | 2 +- packages/google-cloud-assuredworkloads/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index ae74fa4d76f..cdbdce7f6a4 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 647c7a785a2..7a9475541dc 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/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/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 4af4984725d..c6160bdbbd9 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/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 0f475be8260446208c5187933e0eb73caf3b2433 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:48:17 +0000 Subject: [PATCH 105/116] fix: allow passing gax instance to client constructor (#185) - [ ] 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 feat: Updated v1beta1 analyzeWorkloadMove documentation Committer: @ketanbshah PiperOrigin-RevId: 469606602 Source-Link: https://github.com/googleapis/googleapis/commit/32d2f9baba398950771969e8cef4d96560a0600c Source-Link: https://github.com/googleapis/googleapis-gen/commit/f87e8520136640f768cc2e42d9c56ca4def229f4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjg3ZTg1MjAxMzY2NDBmNzY4Y2MyZTQyZDljNTZjYTRkZWYyMjlmNCJ9 --- .../v1beta1/assuredworkloads.proto | 88 ++-- .../v1beta1/assuredworkloads_service.proto | 29 +- .../protos/protos.d.ts | 228 +-------- .../protos/protos.js | 481 +----------------- .../protos/protos.json | 47 +- ...workloads_service.analyze_workload_move.js | 35 +- ...google.cloud.assuredworkloads.v1beta1.json | 48 +- .../v1/assured_workloads_service_client.ts | 50 +- .../assured_workloads_service_client.ts | 194 ++----- ...sured_workloads_service_client_config.json | 4 - .../src/v1beta1/gapic_metadata.json | 10 - ...gapic_assured_workloads_service_v1beta1.ts | 155 +----- 12 files changed, 153 insertions(+), 1216 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto index 5967dd884fd..589010c9ac1 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -67,39 +67,6 @@ message UpdateWorkloadRequest { google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } -// Request for restricting list of available services in Workload environment. -message RestrictAllowedServicesRequest { - // The type of restriction. - enum RestrictionType { - // Unknown restriction type. - RESTRICTION_TYPE_UNSPECIFIED = 0; - - // Allow the use all services. This effectively remove all restrictions - // placed on the Folder. - ALLOW_ALL_GCP_SERVICES = 1; - - // Based on Workload's compliance regime, allowed list changes. - // See - https://cloud.google.com/assured-workloads/docs/supported-products - // for the list of allowed services. - ALLOW_COMPLIANT_SERVICES = 2; - } - - // Required. The resource name of the Workload. This is the workloads's - // relative path in the API, formatted as - // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - // For example, - // "organizations/123/locations/us-east1/workloads/assured-workload-1". - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The type of restriction for using gcp services in the Workload environment. - RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response for restricting the list of allowed services. -message RestrictAllowedServicesResponse { - -} - // Request for restricting list of available resources in Workload environment. message RestrictAllowedResourcesRequest { // The type of restriction. @@ -166,41 +133,41 @@ message GetWorkloadRequest { ]; } -// Request to check if source workload can be moved to target workload. +// A request to analyze a hypothetical move of a source project or project-based +// workload to a target (destination) folder-based workload. message AnalyzeWorkloadMoveRequest { - // Kind of resource to be moved to the destination workload + // The resource type to be moved to the destination workload. It can be either + // an existing project or a project-based workload. oneof projectOrWorkloadResource { - // The Source is project based Workload to be moved. This is the workloads's - // relative path in the API, formatted as - // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - // For example, - // "organizations/123/locations/us-east1/workloads/assured-workload-1". + // The source type is a project-based workload. Specify the workloads's + // relative resource name, formatted as: + // "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + // For example: + // "organizations/123/locations/us-east1/workloads/assured-workload-1" string source = 1; - // The Source is a project based to be moved. - // This is the project's relative path in the API, formatted as - // "cloudresourcemanager.googleapis.com/projects/{project_number}" - // "projects/{project_number}" - // "cloudresourcemanager.googleapis.com/projects/{project_id}" - // "projects/{project_id}" - // For example, - // "organizations/123/locations/us-east1/workloads/assured-workload-1". + // The source type is a project. Specify the project's relative resource + // name, formatted as either a project number or a project ID: + // "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + // For example: + // "projects/951040570662" when specifying a project number, or + // "projects/my-project-123" when specifying a project ID. string project = 3; } - // Required. The resource name of the Workload to fetch. This is the workloads's - // relative path in the API, formatted as - // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - // For example, - // "organizations/123/locations/us-east1/workloads/assured-workload-2". + // Required. The resource ID of the folder-based destination workload. This workload is + // where the source project will hypothetically be moved to. Specify the + // workload's relative resource name, formatted as: + // "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + // For example: + // "organizations/123/locations/us-east1/workloads/assured-workload-2" string target = 2 [(google.api.field_behavior) = REQUIRED]; } -// Response with the analysis if the source workload can be moved to the target -// workload +// A response that includes the analysis of the hypothetical resource move. message AnalyzeWorkloadMoveResponse { - // List of blockers that prevent moving the source workload to the target - // workload + // A list of blockers that should be addressed before moving the source + // project or project-based workload to the destination folder-based workload. repeated string blockers = 1; } @@ -308,6 +275,9 @@ message Workload { // International Traffic in Arms Regulations ITAR = 10; + + // Assured Workloads for Australia Regions and Support controls + AU_REGIONS_AND_US_SUPPORT = 11; } // Settings specific to the Key Management Service. @@ -483,7 +453,7 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Input only. The billing account used for the resources which are + // Output only. The billing account used for the resources which are // direct children of workload. This billing account is initially associated // with the resources created as part of Workload creation. // After the initial creation of these resources, the customer can change @@ -491,7 +461,7 @@ message Workload { // The resource name has the form // `billingAccounts/{billing_account_id}`. For example, // `billingAccounts/012345-567890-ABCDEF`. - string billing_account = 6 [(google.api.field_behavior) = INPUT_ONLY]; + string billing_account = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Settings specific to the selected [compliance_regime] oneof compliance_regime_settings { diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto index fff7655f664..9fbedf47b10 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto @@ -33,12 +33,10 @@ option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1"; // Service to manage AssuredWorkloads. service AssuredWorkloadsService { option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) - returns (google.longrunning.Operation) { + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=organizations/*/locations/*}/workloads" body: "workload" @@ -55,30 +53,16 @@ service AssuredWorkloadsService { // For force updates don't set etag field in the Workload. // Only one update operation per workload can be in progress. rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) { - option (google.api.http) = { - patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}" - body: "workload" - }; option (google.api.method_signature) = "workload,update_mask"; } - // Restrict the list of services allowed in the Workload environment. - // The current list of allowed services can be found at - // https://cloud.google.com/assured-workloads/docs/supported-products - // In addition to assuredworkloads.workload.update permission, the user should - // also have orgpolicy.policy.set permission on the folder resource - // to use this functionality. - rpc RestrictAllowedServices(RestrictAllowedServicesRequest) - returns (RestrictAllowedServicesResponse) {} - // Restrict the list of resources allowed in the Workload environment. // The current list of allowed products can be found at // https://cloud.google.com/assured-workloads/docs/supported-products // In addition to assuredworkloads.workload.update permission, the user should // also have orgpolicy.policy.set permission on the folder resource // to use this functionality. - rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) - returns (RestrictAllowedResourcesResponse) { + rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) { option (google.api.http) = { post: "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources" body: "*" @@ -103,10 +87,9 @@ service AssuredWorkloadsService { option (google.api.method_signature) = "name"; } - // Analyze if the source Assured Workloads can be moved to the target Assured - // Workload - rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) - returns (AnalyzeWorkloadMoveResponse) { + // A request to analyze a hypothetical move of a source project or + // project-based workload to a target (destination) folder-based workload. + rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) returns (AnalyzeWorkloadMoveResponse) { option (google.api.method_signature) = "project,target"; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 7a9475541dc..4c3da76f6da 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1767,210 +1767,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RestrictAllowedServicesRequest. */ - interface IRestrictAllowedServicesRequest { - - /** RestrictAllowedServicesRequest name */ - name?: (string|null); - - /** RestrictAllowedServicesRequest restrictionType */ - restrictionType?: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|null); - } - - /** Represents a RestrictAllowedServicesRequest. */ - class RestrictAllowedServicesRequest implements IRestrictAllowedServicesRequest { - - /** - * Constructs a new RestrictAllowedServicesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest); - - /** RestrictAllowedServicesRequest name. */ - public name: string; - - /** RestrictAllowedServicesRequest restrictionType. */ - public restrictionType: (google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType); - - /** - * Creates a new RestrictAllowedServicesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestrictAllowedServicesRequest instance - */ - public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; - - /** - * Encodes the specified RestrictAllowedServicesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. - * @param message RestrictAllowedServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestrictAllowedServicesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. - * @param message RestrictAllowedServicesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestrictAllowedServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; - - /** - * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestrictAllowedServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; - - /** - * Verifies a RestrictAllowedServicesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestrictAllowedServicesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestrictAllowedServicesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest; - - /** - * Creates a plain object from a RestrictAllowedServicesRequest message. Also converts values to other types if specified. - * @param message RestrictAllowedServicesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestrictAllowedServicesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestrictAllowedServicesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RestrictAllowedServicesRequest { - - /** RestrictionType enum. */ - enum RestrictionType { - RESTRICTION_TYPE_UNSPECIFIED = 0, - ALLOW_ALL_GCP_SERVICES = 1, - ALLOW_COMPLIANT_SERVICES = 2 - } - } - - /** Properties of a RestrictAllowedServicesResponse. */ - interface IRestrictAllowedServicesResponse { - } - - /** Represents a RestrictAllowedServicesResponse. */ - class RestrictAllowedServicesResponse implements IRestrictAllowedServicesResponse { - - /** - * Constructs a new RestrictAllowedServicesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse); - - /** - * Creates a new RestrictAllowedServicesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RestrictAllowedServicesResponse instance - */ - public static create(properties?: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; - - /** - * Encodes the specified RestrictAllowedServicesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. - * @param message RestrictAllowedServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestrictAllowedServicesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. - * @param message RestrictAllowedServicesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestrictAllowedServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; - - /** - * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestrictAllowedServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; - - /** - * Verifies a RestrictAllowedServicesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestrictAllowedServicesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestrictAllowedServicesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse; - - /** - * Creates a plain object from a RestrictAllowedServicesResponse message. Also converts values to other types if specified. - * @param message RestrictAllowedServicesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestrictAllowedServicesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestrictAllowedServicesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - /** Properties of a RestrictAllowedResourcesRequest. */ interface IRestrictAllowedResourcesRequest { @@ -3133,7 +2929,8 @@ export namespace google { HITRUST = 7, EU_REGIONS_AND_SUPPORT = 8, CA_REGIONS_AND_SUPPORT = 9, - ITAR = 10 + ITAR = 10, + AU_REGIONS_AND_US_SUPPORT = 11 } /** Properties of a KMSSettings. */ @@ -4038,20 +3835,6 @@ export namespace google { */ public updateWorkload(request: google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest): Promise; - /** - * Calls RestrictAllowedServices. - * @param request RestrictAllowedServicesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RestrictAllowedServicesResponse - */ - public restrictAllowedServices(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, callback: google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServicesCallback): void; - - /** - * Calls RestrictAllowedServices. - * @param request RestrictAllowedServicesRequest message or plain object - * @returns Promise - */ - public restrictAllowedServices(request: google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest): Promise; - /** * Calls RestrictAllowedResources. * @param request RestrictAllowedResourcesRequest message or plain object @@ -4139,13 +3922,6 @@ export namespace google { */ type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.Workload) => void; - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedServices}. - * @param error Error, if any - * @param [response] RestrictAllowedServicesResponse - */ - type RestrictAllowedServicesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse) => void; - /** * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedResources}. * @param error Error, if any diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index c6160bdbbd9..cdbddb6c6e4 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -4416,442 +4416,6 @@ return UpdateWorkloadRequest; })(); - v1beta1.RestrictAllowedServicesRequest = (function() { - - /** - * Properties of a RestrictAllowedServicesRequest. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IRestrictAllowedServicesRequest - * @property {string|null} [name] RestrictAllowedServicesRequest name - * @property {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType|null} [restrictionType] RestrictAllowedServicesRequest restrictionType - */ - - /** - * Constructs a new RestrictAllowedServicesRequest. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a RestrictAllowedServicesRequest. - * @implements IRestrictAllowedServicesRequest - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest=} [properties] Properties to set - */ - function RestrictAllowedServicesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestrictAllowedServicesRequest name. - * @member {string} name - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @instance - */ - RestrictAllowedServicesRequest.prototype.name = ""; - - /** - * RestrictAllowedServicesRequest restrictionType. - * @member {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType} restrictionType - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @instance - */ - RestrictAllowedServicesRequest.prototype.restrictionType = 0; - - /** - * Creates a new RestrictAllowedServicesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest instance - */ - RestrictAllowedServicesRequest.create = function create(properties) { - return new RestrictAllowedServicesRequest(properties); - }; - - /** - * Encodes the specified RestrictAllowedServicesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} message RestrictAllowedServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestrictAllowedServicesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.restrictionType != null && Object.hasOwnProperty.call(message, "restrictionType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.restrictionType); - return writer; - }; - - /** - * Encodes the specified RestrictAllowedServicesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} message RestrictAllowedServicesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestrictAllowedServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestrictAllowedServicesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.restrictionType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestrictAllowedServicesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestrictAllowedServicesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestrictAllowedServicesRequest message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestrictAllowedServicesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) - switch (message.restrictionType) { - default: - return "restrictionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a RestrictAllowedServicesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} RestrictAllowedServicesRequest - */ - RestrictAllowedServicesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest) - return object; - var message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.restrictionType) { - case "RESTRICTION_TYPE_UNSPECIFIED": - case 0: - message.restrictionType = 0; - break; - case "ALLOW_ALL_GCP_SERVICES": - case 1: - message.restrictionType = 1; - break; - case "ALLOW_COMPLIANT_SERVICES": - case 2: - message.restrictionType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a RestrictAllowedServicesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest} message RestrictAllowedServicesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestrictAllowedServicesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.restrictionType = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) - object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType[message.restrictionType] : message.restrictionType; - return object; - }; - - /** - * Converts this RestrictAllowedServicesRequest to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @instance - * @returns {Object.} JSON object - */ - RestrictAllowedServicesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestrictAllowedServicesRequest - * @function getTypeUrl - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestrictAllowedServicesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest"; - }; - - /** - * RestrictionType enum. - * @name google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType - * @enum {number} - * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value - * @property {number} ALLOW_ALL_GCP_SERVICES=1 ALLOW_ALL_GCP_SERVICES value - * @property {number} ALLOW_COMPLIANT_SERVICES=2 ALLOW_COMPLIANT_SERVICES value - */ - RestrictAllowedServicesRequest.RestrictionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALLOW_ALL_GCP_SERVICES"] = 1; - values[valuesById[2] = "ALLOW_COMPLIANT_SERVICES"] = 2; - return values; - })(); - - return RestrictAllowedServicesRequest; - })(); - - v1beta1.RestrictAllowedServicesResponse = (function() { - - /** - * Properties of a RestrictAllowedServicesResponse. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @interface IRestrictAllowedServicesResponse - */ - - /** - * Constructs a new RestrictAllowedServicesResponse. - * @memberof google.cloud.assuredworkloads.v1beta1 - * @classdesc Represents a RestrictAllowedServicesResponse. - * @implements IRestrictAllowedServicesResponse - * @constructor - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse=} [properties] Properties to set - */ - function RestrictAllowedServicesResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new RestrictAllowedServicesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse=} [properties] Properties to set - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse instance - */ - RestrictAllowedServicesResponse.create = function create(properties) { - return new RestrictAllowedServicesResponse(properties); - }; - - /** - * Encodes the specified RestrictAllowedServicesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse} message RestrictAllowedServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestrictAllowedServicesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RestrictAllowedServicesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse} message RestrictAllowedServicesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestrictAllowedServicesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestrictAllowedServicesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestrictAllowedServicesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestrictAllowedServicesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestrictAllowedServicesResponse message. - * @function verify - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestrictAllowedServicesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RestrictAllowedServicesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} RestrictAllowedServicesResponse - */ - RestrictAllowedServicesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse) - return object; - return new $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse(); - }; - - /** - * Creates a plain object from a RestrictAllowedServicesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} message RestrictAllowedServicesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestrictAllowedServicesResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RestrictAllowedServicesResponse to JSON. - * @function toJSON - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @instance - * @returns {Object.} JSON object - */ - RestrictAllowedServicesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestrictAllowedServicesResponse - * @function getTypeUrl - * @memberof google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestrictAllowedServicesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse"; - }; - - return RestrictAllowedServicesResponse; - })(); - v1beta1.RestrictAllowedResourcesRequest = (function() { /** @@ -7192,6 +6756,7 @@ case 8: case 9: case 10: + case 11: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -7359,6 +6924,10 @@ case 10: message.complianceRegime = 10; break; + case "AU_REGIONS_AND_US_SUPPORT": + case 11: + message.complianceRegime = 11; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -7860,6 +7429,7 @@ * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value * @property {number} ITAR=10 ITAR value + * @property {number} AU_REGIONS_AND_US_SUPPORT=11 AU_REGIONS_AND_US_SUPPORT value */ Workload.ComplianceRegime = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7874,6 +7444,7 @@ values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; values[valuesById[10] = "ITAR"] = 10; + values[valuesById[11] = "AU_REGIONS_AND_US_SUPPORT"] = 11; return values; })(); @@ -9817,6 +9388,7 @@ case 8: case 9: case 10: + case 11: break; } if (message.resourceSettings != null && message.hasOwnProperty("resourceSettings")) { @@ -9897,6 +9469,10 @@ case 10: message.complianceRegime = 10; break; + case "AU_REGIONS_AND_US_SUPPORT": + case 11: + message.complianceRegime = 11; + break; } if (object.resourceSettings) { if (!Array.isArray(object.resourceSettings)) @@ -10075,39 +9651,6 @@ * @variation 2 */ - /** - * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedServices}. - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @typedef RestrictAllowedServicesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse} [response] RestrictAllowedServicesResponse - */ - - /** - * Calls RestrictAllowedServices. - * @function restrictAllowedServices - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} request RestrictAllowedServicesRequest message or plain object - * @param {google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServicesCallback} callback Node-style callback called with the error, if any, and RestrictAllowedServicesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AssuredWorkloadsService.prototype.restrictAllowedServices = function restrictAllowedServices(request, callback) { - return this.rpcCall(restrictAllowedServices, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest, $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse, request, callback); - }, "name", { value: "RestrictAllowedServices" }); - - /** - * Calls RestrictAllowedServices. - * @function restrictAllowedServices - * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService - * @instance - * @param {google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest} request RestrictAllowedServicesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - /** * Callback as used by {@link google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService|restrictAllowedResources}. * @memberof google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index c41e03bd033..140825e24e4 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -562,36 +562,6 @@ } } }, - "RestrictAllowedServicesRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "restrictionType": { - "type": "RestrictionType", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "RestrictionType": { - "values": { - "RESTRICTION_TYPE_UNSPECIFIED": 0, - "ALLOW_ALL_GCP_SERVICES": 1, - "ALLOW_COMPLIANT_SERVICES": 2 - } - } - } - }, - "RestrictAllowedServicesResponse": { - "fields": {} - }, "RestrictAllowedResourcesRequest": { "fields": { "name": { @@ -782,7 +752,7 @@ "type": "string", "id": 6, "options": { - "(google.api.field_behavior)": "INPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, "il4Settings": { @@ -913,7 +883,8 @@ "HITRUST": 7, "EU_REGIONS_AND_SUPPORT": 8, "CA_REGIONS_AND_SUPPORT": 9, - "ITAR": 10 + "ITAR": 10, + "AU_REGIONS_AND_US_SUPPORT": 11 } }, "KMSSettings": { @@ -1137,26 +1108,14 @@ "requestType": "UpdateWorkloadRequest", "responseType": "Workload", "options": { - "(google.api.http).patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", - "(google.api.http).body": "workload", "(google.api.method_signature)": "workload,update_mask" }, "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}", - "body": "workload" - } - }, { "(google.api.method_signature)": "workload,update_mask" } ] }, - "RestrictAllowedServices": { - "requestType": "RestrictAllowedServicesRequest", - "responseType": "RestrictAllowedServicesResponse" - }, "RestrictAllowedResources": { "requestType": "RestrictAllowedResourcesRequest", "responseType": "RestrictAllowedResourcesResponse", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js index a32f8c95193..1bf6ae1194e 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js @@ -29,30 +29,29 @@ function main(target) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * The Source is project based Workload to be moved. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * The source type is a project-based workload. Specify the workloads's + * relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-1" */ // const source = 'abc123' /** - * The Source is a project based to be moved. - * This is the project's relative path in the API, formatted as - * "cloudresourcemanager.googleapis.com/projects/{project_number}" - * "projects/{project_number}" - * "cloudresourcemanager.googleapis.com/projects/{project_id}" - * "projects/{project_id}" - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. */ // const project = 'my-project' /** - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-2". + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" */ // const target = 'abc123' diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 588a0c0b6bf..4046e739390 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -103,50 +103,6 @@ } } }, - { - "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async", - "title": "AssuredWorkloadsService restrictAllowedServices Sample", - "origin": "API_DEFINITION", - "description": " Restrict the list of services allowed in the Workload environment. The current list of allowed services can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.", - "canonical": true, - "file": "assured_workloads_service.restrict_allowed_services.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestrictAllowedServices", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServices", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "restriction_type", - "type": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType" - } - ], - "resultType": ".google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse", - "client": { - "shortName": "AssuredWorkloadsServiceClient", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsServiceClient" - }, - "method": { - "shortName": "RestrictAllowedServices", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService.RestrictAllowedServices", - "service": { - "shortName": "AssuredWorkloadsService", - "fullName": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService" - } - } - } - }, { "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_async", "title": "AssuredWorkloadsService restrictAllowedResources Sample", @@ -279,14 +235,14 @@ "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async", "title": "AssuredWorkloadsService analyzeWorkloadMove Sample", "origin": "API_DEFINITION", - "description": " Analyze if the source Assured Workloads can be moved to the target Assured Workload", + "description": " A request to analyze a hypothetical move of a source project or project-based workload to a target (destination) folder-based workload.", "canonical": true, "file": "assured_workloads_service.analyze_workload_move.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 76, + "end": 75, "type": "FULL" } ], diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index d2d63c7aee0..7174612853e 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_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, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,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 './assured_workloads_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class AssuredWorkloadsServiceClient { * 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 AssuredWorkloadsServiceClient({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 AssuredWorkloadsServiceClient; @@ -121,8 +129,13 @@ export class AssuredWorkloadsServiceClient { 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); @@ -241,7 +254,7 @@ export class AssuredWorkloadsServiceClient { 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; } /** @@ -468,7 +481,7 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'workload.name': request.workload!.name || '', }); this.initialize(); @@ -572,7 +585,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -667,7 +680,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -779,7 +792,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -805,11 +818,12 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createWorkload, this._gaxModule.createDefaultBackoffSettings() @@ -917,7 +931,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -961,7 +975,7 @@ export class AssuredWorkloadsServiceClient { 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['listWorkloads']; @@ -1014,7 +1028,7 @@ export class AssuredWorkloadsServiceClient { 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['listWorkloads']; diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 4dbb2464b1f..b4cdc843ccd 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_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, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,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 './assured_workloads_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class AssuredWorkloadsServiceClient { * 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 AssuredWorkloadsServiceClient({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 AssuredWorkloadsServiceClient; @@ -121,8 +129,13 @@ export class AssuredWorkloadsServiceClient { 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); @@ -235,7 +248,7 @@ export class AssuredWorkloadsServiceClient { 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; } /** @@ -274,7 +287,6 @@ export class AssuredWorkloadsServiceClient { const assuredWorkloadsServiceStubMethods = [ 'createWorkload', 'updateWorkload', - 'restrictAllowedServices', 'restrictAllowedResources', 'deleteWorkload', 'getWorkload', @@ -464,121 +476,9 @@ export class AssuredWorkloadsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - 'workload.name': request.workload!.name || '', - }); this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } - /** - * Restrict the list of services allowed in the Workload environment. - * The current list of allowed services can be found at - * https://cloud.google.com/assured-workloads/docs/supported-products - * In addition to assuredworkloads.workload.update permission, the user should - * also have orgpolicy.policy.set permission on the folder resource - * to use this functionality. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Workload. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". - * @param {google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest.RestrictionType} request.restrictionType - * Required. The type of restriction for using gcp services in the Workload environment. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [RestrictAllowedServicesResponse]{@link google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js - * region_tag:assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedServices_async - */ - restrictAllowedServices( - request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - ( - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | undefined - ), - {} | undefined - ] - >; - restrictAllowedServices( - request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - restrictAllowedServices( - request: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, - callback: Callback< - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | null - | undefined, - {} | null | undefined - > - ): void; - restrictAllowedServices( - request?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse, - ( - | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesRequest - | undefined - ), - {} | undefined - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - this.initialize(); - return this.innerApiCalls.restrictAllowedServices( - request, - options, - callback - ); - } /** * Restrict the list of resources allowed in the Workload environment. * The current list of allowed products can be found at @@ -681,7 +581,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -792,7 +692,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -896,32 +796,31 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.getWorkload(request, options, callback); } /** - * Analyze if the source Assured Workloads can be moved to the target Assured - * Workload + * A request to analyze a hypothetical move of a source project or + * project-based workload to a target (destination) folder-based workload. * * @param {Object} request * The request object that will be sent. * @param {string} request.source - * The Source is project based Workload to be moved. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * The source type is a project-based workload. Specify the workloads's + * relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-1" * @param {string} request.project - * The Source is a project based to be moved. - * This is the project's relative path in the API, formatted as - * "cloudresourcemanager.googleapis.com/projects/{project_number}" - * "projects/{project_number}" - * "cloudresourcemanager.googleapis.com/projects/{project_id}" - * "projects/{project_id}" - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * The source type is a project. Specify the project's relative resource + * name, formatted as either a project number or a project ID: + * "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}" + * For example: + * "projects/951040570662" when specifying a project number, or + * "projects/my-project-123" when specifying a project ID. * @param {string} request.target - * Required. The resource name of the Workload to fetch. This is the workloads's - * relative path in the API, formatted as - * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". - * For example, - * "organizations/123/locations/us-east1/workloads/assured-workload-2". + * Required. The resource ID of the folder-based destination workload. This workload is + * where the source project will hypothetically be moved to. Specify the + * workload's relative resource name, formatted as: + * "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}" + * For example: + * "organizations/123/locations/us-east1/workloads/assured-workload-2" * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1114,7 +1013,7 @@ export class AssuredWorkloadsServiceClient { 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(); @@ -1140,11 +1039,12 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createWorkload, this._gaxModule.createDefaultBackoffSettings() diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json index 32424b61e27..58d9845ea38 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client_config.json @@ -42,10 +42,6 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, - "RestrictAllowedServices": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, "RestrictAllowedResources": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json index 243f26113a7..306bca1ff1f 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/gapic_metadata.json @@ -15,11 +15,6 @@ "updateWorkload" ] }, - "RestrictAllowedServices": { - "methods": [ - "restrictAllowedServices" - ] - }, "RestrictAllowedResources": { "methods": [ "restrictAllowedResources" @@ -62,11 +57,6 @@ "updateWorkload" ] }, - "RestrictAllowedServices": { - "methods": [ - "restrictAllowedServices" - ] - }, "RestrictAllowedResources": { "methods": [ "restrictAllowedResources" diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index bf8e6eace26..7f15be9c3ca 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -280,16 +280,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); @@ -315,16 +306,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); @@ -366,16 +348,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubSimpleCall( undefined, @@ -401,134 +374,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateWorkload(request), expectedError); }); }); - describe('restrictAllowedServices', () => { - it('invokes restrictAllowedServices without error', async () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() - ); - const expectedOptions = {otherArgs: {headers: {}}}; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse() - ); - client.innerApiCalls.restrictAllowedServices = - stubSimpleCall(expectedResponse); - const [response] = await client.restrictAllowedServices(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restrictAllowedServices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes restrictAllowedServices without error using callback', async () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() - ); - const expectedOptions = {otherArgs: {headers: {}}}; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesResponse() - ); - client.innerApiCalls.restrictAllowedServices = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restrictAllowedServices( - request, - ( - err?: Error | null, - result?: protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedServicesResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restrictAllowedServices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - it('invokes restrictAllowedServices with error', async () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() - ); - const expectedOptions = {otherArgs: {headers: {}}}; - const expectedError = new Error('expected'); - client.innerApiCalls.restrictAllowedServices = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects( - client.restrictAllowedServices(request), - expectedError - ); - assert( - (client.innerApiCalls.restrictAllowedServices as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - it('invokes restrictAllowedServices with closed client', async () => { - const client = - new assuredworkloadsserviceModule.v1beta1.AssuredWorkloadsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedServicesRequest() - ); - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects( - client.restrictAllowedServices(request), - expectedError - ); - }); - }); - describe('restrictAllowedResources', () => { it('invokes restrictAllowedResources without error', async () => { const client = From bd2145bb9847e799b84b5eaffa630a931b8239dd 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:34:40 +0000 Subject: [PATCH 106/116] fix: preserve default values in x-goog-request-params header (#188) - [ ] 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 feat: Add compliant_but_disallowed_services field to the v1beta1 Workload proto Committer: @samhutton PiperOrigin-RevId: 471822190 Source-Link: https://github.com/googleapis/googleapis/commit/61f75b4f6093d7ad7d41ccaf86c224a6ced20c71 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9abf7bc271570f7073c89c0d4beb3b86a66678cb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWFiZjdiYzI3MTU3MGY3MDczYzg5YzBkNGJlYjNiODZhNjY2NzhjYiJ9 --- .../v1beta1/assuredworkloads.proto | 6 + .../v1beta1/assuredworkloads_service.proto | 4 +- .../protos/protos.d.ts | 6 + .../protos/protos.js | 39 ++ .../protos/protos.json | 8 + ...google.cloud.assuredworkloads.v1beta1.json | 2 +- .../v1/assured_workloads_service_client.ts | 14 +- .../assured_workloads_service_client.ts | 10 +- .../gapic_assured_workloads_service_v1.ts | 538 +++++++++--------- ...gapic_assured_workloads_service_v1beta1.ts | 371 +++++------- 10 files changed, 510 insertions(+), 488 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto index 589010c9ac1..e6a83fae4ee 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -535,6 +535,12 @@ message Workload { // SAA enrollment response is queried during GetWorkload call. // In failure cases, user friendly error message is shown in SAA details page. SaaEnrollmentResponse saa_enrollment_response = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Urls for services which are compliant for this Assured Workload, but which + // are currently disallowed by the ResourceUsageRestriction org policy. + // Invoke RestrictAllowedResources endpoint to allow your project developers + // to use these services in their environment." + repeated string compliant_but_disallowed_services = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Operation metadata to give request details of CreateWorkload. diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto index 9fbedf47b10..1af45f12a03 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto @@ -87,8 +87,8 @@ service AssuredWorkloadsService { option (google.api.method_signature) = "name"; } - // A request to analyze a hypothetical move of a source project or - // project-based workload to a target (destination) folder-based workload. + // Analyze if the source Assured Workloads can be moved to the target Assured + // Workload rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) returns (AnalyzeWorkloadMoveResponse) { option (google.api.method_signature) = "project,target"; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 4c3da76f6da..e5d7882e672 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -2654,6 +2654,9 @@ export namespace google { /** Workload saaEnrollmentResponse */ saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null); + + /** Workload compliantButDisallowedServices */ + compliantButDisallowedServices?: (string[]|null); } /** Represents a Workload. */ @@ -2719,6 +2722,9 @@ export namespace google { /** Workload saaEnrollmentResponse. */ public saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null); + /** Workload compliantButDisallowedServices. */ + public compliantButDisallowedServices: string[]; + /** Workload complianceRegimeSettings. */ public complianceRegimeSettings?: ("il4Settings"|"cjisSettings"|"fedrampHighSettings"|"fedrampModerateSettings"); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index cdbddb6c6e4..919e49e0ddc 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -6320,6 +6320,7 @@ * @property {google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls * @property {google.cloud.assuredworkloads.v1beta1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse + * @property {Array.|null} [compliantButDisallowedServices] Workload compliantButDisallowedServices */ /** @@ -6334,6 +6335,7 @@ this.resources = []; this.labels = {}; this.resourceSettings = []; + this.compliantButDisallowedServices = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6484,6 +6486,14 @@ */ Workload.prototype.saaEnrollmentResponse = null; + /** + * Workload compliantButDisallowedServices. + * @member {Array.} compliantButDisallowedServices + * @memberof google.cloud.assuredworkloads.v1beta1.Workload + * @instance + */ + Workload.prototype.compliantButDisallowedServices = $util.emptyArray; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6561,6 +6571,9 @@ writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.compliantButDisallowedServices != null && message.compliantButDisallowedServices.length) + for (var i = 0; i < message.compliantButDisallowedServices.length; ++i) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.compliantButDisallowedServices[i]); return writer; }; @@ -6690,6 +6703,12 @@ message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); break; } + case 24: { + if (!(message.compliantButDisallowedServices && message.compliantButDisallowedServices.length)) + message.compliantButDisallowedServices = []; + message.compliantButDisallowedServices.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6850,6 +6869,13 @@ if (error) return "saaEnrollmentResponse." + error; } + if (message.compliantButDisallowedServices != null && message.hasOwnProperty("compliantButDisallowedServices")) { + if (!Array.isArray(message.compliantButDisallowedServices)) + return "compliantButDisallowedServices: array expected"; + for (var i = 0; i < message.compliantButDisallowedServices.length; ++i) + if (!$util.isString(message.compliantButDisallowedServices[i])) + return "compliantButDisallowedServices: string[] expected"; + } return null; }; @@ -7003,6 +7029,13 @@ throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.saaEnrollmentResponse: object expected"); message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); } + if (object.compliantButDisallowedServices) { + if (!Array.isArray(object.compliantButDisallowedServices)) + throw TypeError(".google.cloud.assuredworkloads.v1beta1.Workload.compliantButDisallowedServices: array expected"); + message.compliantButDisallowedServices = []; + for (var i = 0; i < object.compliantButDisallowedServices.length; ++i) + message.compliantButDisallowedServices[i] = String(object.compliantButDisallowedServices[i]); + } return message; }; @@ -7022,6 +7055,7 @@ if (options.arrays || options.defaults) { object.resources = []; object.resourceSettings = []; + object.compliantButDisallowedServices = []; } if (options.objects || options.defaults) object.labels = {}; @@ -7096,6 +7130,11 @@ object.enableSovereignControls = message.enableSovereignControls; if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); + if (message.compliantButDisallowedServices && message.compliantButDisallowedServices.length) { + object.compliantButDisallowedServices = []; + for (var j = 0; j < message.compliantButDisallowedServices.length; ++j) + object.compliantButDisallowedServices[j] = message.compliantButDisallowedServices[j]; + } return object; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 140825e24e4..ca76c2e6e61 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -845,6 +845,14 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "compliantButDisallowedServices": { + "rule": "repeated", + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 4046e739390..66a415fb145 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -235,7 +235,7 @@ "regionTag": "assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_async", "title": "AssuredWorkloadsService analyzeWorkloadMove Sample", "origin": "API_DEFINITION", - "description": " A request to analyze a hypothetical move of a source project or project-based workload to a target (destination) folder-based workload.", + "description": " Analyze if the source Assured Workloads can be moved to the target Assured Workload", "canonical": true, "file": "assured_workloads_service.analyze_workload_move.js", "language": "JAVASCRIPT", diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 7174612853e..55c884014a9 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -482,7 +482,7 @@ export class AssuredWorkloadsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'workload.name': request.workload!.name || '', + 'workload.name': request.workload!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); @@ -586,7 +586,7 @@ export class AssuredWorkloadsServiceClient { 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.deleteWorkload(request, options, callback); @@ -681,7 +681,7 @@ export class AssuredWorkloadsServiceClient { 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.getWorkload(request, options, callback); @@ -793,7 +793,7 @@ export class AssuredWorkloadsServiceClient { 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.createWorkload(request, options, callback); @@ -932,7 +932,7 @@ export class AssuredWorkloadsServiceClient { 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.listWorkloads(request, options, callback); @@ -976,7 +976,7 @@ export class AssuredWorkloadsServiceClient { 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['listWorkloads']; const callSettings = defaultCallSettings.merge(options); @@ -1029,7 +1029,7 @@ export class AssuredWorkloadsServiceClient { 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['listWorkloads']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index b4cdc843ccd..6e493fb72ec 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -582,7 +582,7 @@ export class AssuredWorkloadsServiceClient { 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.restrictAllowedResources( @@ -693,7 +693,7 @@ export class AssuredWorkloadsServiceClient { 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.deleteWorkload(request, options, callback); @@ -796,8 +796,8 @@ export class AssuredWorkloadsServiceClient { return this.innerApiCalls.getWorkload(request, options, callback); } /** - * A request to analyze a hypothetical move of a source project or - * project-based workload to a target (destination) folder-based workload. + * Analyze if the source Assured Workloads can be moved to the target Assured + * Workload * * @param {Object} request * The request object that will be sent. @@ -1014,7 +1014,7 @@ export class AssuredWorkloadsServiceClient { 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.createWorkload(request, options, callback); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 9500e86dff4..2a116d8b189 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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 @@ -265,27 +280,27 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.workload ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ + 'workload', + 'name', + ]); + request.workload.name = defaultValue1; + const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); client.innerApiCalls.updateWorkload = stubSimpleCall(expectedResponse); const [response] = await client.updateWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateWorkload without error using callback', async () => { @@ -298,16 +313,13 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.workload ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ + 'workload', + 'name', + ]); + request.workload.name = defaultValue1; + const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -330,11 +342,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateWorkload with error', async () => { @@ -347,27 +362,27 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; - const expectedHeaderRequestParams = 'workload.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.workload ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ + 'workload', + 'name', + ]); + request.workload.name = defaultValue1; + const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateWorkload(request), expectedError); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateWorkload with closed client', async () => { @@ -380,8 +395,12 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); - request.workload = {}; - request.workload.name = ''; + request.workload ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ + 'workload', + 'name', + ]); + request.workload.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.updateWorkload(request), expectedError); @@ -399,26 +418,25 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); const [response] = await client.deleteWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload without error using callback', async () => { @@ -431,15 +449,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -462,11 +476,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload with error', async () => { @@ -479,26 +496,25 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteWorkload(request), expectedError); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload with closed client', async () => { @@ -511,7 +527,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteWorkload(request), expectedError); @@ -529,26 +548,23 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); const [response] = await client.getWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWorkload without error using callback', async () => { @@ -561,15 +577,9 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -592,11 +602,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWorkload with error', async () => { @@ -609,26 +622,23 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getWorkload(request), expectedError); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getWorkload with closed client', async () => { @@ -641,7 +651,8 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getWorkload(request), expectedError); @@ -659,15 +670,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -676,11 +683,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const [operation] = await client.createWorkload(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload without error using callback', async () => { @@ -693,15 +703,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -731,11 +737,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload with call error', async () => { @@ -748,26 +757,25 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createWorkload(request), expectedError); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload with LRO error', async () => { @@ -780,15 +788,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -797,11 +801,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ); const [operation] = await client.createWorkload(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateWorkloadProgress without error', async () => { @@ -859,15 +866,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -882,11 +885,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); const [response] = await client.listWorkloads(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listWorkloads without error using callback', async () => { @@ -899,15 +905,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -938,11 +940,14 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listWorkloads with error', async () => { @@ -955,26 +960,25 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listWorkloads(request), expectedError); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkloads as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listWorkloadsStream without error', async () => { @@ -987,8 +991,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1026,11 +1033,12 @@ describe('v1.AssuredWorkloadsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listWorkloads, request) ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1044,8 +1052,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1072,11 +1083,12 @@ describe('v1.AssuredWorkloadsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listWorkloads, request) ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listWorkloads.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1090,8 +1102,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1117,11 +1132,12 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listWorkloads.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1135,8 +1151,11 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1154,11 +1173,12 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listWorkloads.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listWorkloads.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 7f15be9c3ca..80ab99e4acf 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} 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 @@ -280,18 +295,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); client.innerApiCalls.updateWorkload = stubSimpleCall(expectedResponse); const [response] = await client.updateWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes updateWorkload without error using callback', async () => { @@ -306,7 +315,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); @@ -329,11 +337,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); }); it('invokes updateWorkload with error', async () => { @@ -348,18 +351,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.UpdateWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.updateWorkload(request), expectedError); - assert( - (client.innerApiCalls.updateWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes updateWorkload with closed client', async () => { @@ -393,15 +390,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); @@ -409,11 +403,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.restrictAllowedResources(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restrictAllowedResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restrictAllowedResources without error using callback', async () => { @@ -428,15 +425,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); @@ -459,11 +453,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restrictAllowedResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restrictAllowedResources with error', async () => { @@ -478,15 +475,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restrictAllowedResources = stubSimpleCall( undefined, @@ -496,11 +490,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { client.restrictAllowedResources(request), expectedError ); - assert( - (client.innerApiCalls.restrictAllowedResources as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restrictAllowedResources with closed client', async () => { @@ -515,7 +512,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -538,26 +539,25 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); client.innerApiCalls.deleteWorkload = stubSimpleCall(expectedResponse); const [response] = await client.deleteWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload without error using callback', async () => { @@ -572,15 +572,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -603,11 +599,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload with error', async () => { @@ -622,26 +621,25 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.deleteWorkload(request), expectedError); - assert( - (client.innerApiCalls.deleteWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteWorkload with closed client', async () => { @@ -656,7 +654,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.deleteWorkload(request), expectedError); @@ -676,18 +677,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); client.innerApiCalls.getWorkload = stubSimpleCall(expectedResponse); const [response] = await client.getWorkload(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes getWorkload without error using callback', async () => { @@ -702,7 +697,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() ); @@ -725,11 +719,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); }); it('invokes getWorkload with error', async () => { @@ -744,18 +733,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.GetWorkloadRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getWorkload(request), expectedError); - assert( - (client.innerApiCalls.getWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes getWorkload with closed client', async () => { @@ -789,7 +772,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse() ); @@ -797,11 +779,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.analyzeWorkloadMove(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeWorkloadMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes analyzeWorkloadMove without error using callback', async () => { @@ -816,7 +793,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveResponse() ); @@ -839,11 +815,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.analyzeWorkloadMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); }); it('invokes analyzeWorkloadMove with error', async () => { @@ -858,18 +829,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.AnalyzeWorkloadMoveRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); client.innerApiCalls.analyzeWorkloadMove = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.analyzeWorkloadMove(request), expectedError); - assert( - (client.innerApiCalls.analyzeWorkloadMove as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes analyzeWorkloadMove with closed client', async () => { @@ -903,15 +868,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -920,11 +881,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const [operation] = await client.createWorkload(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload without error using callback', async () => { @@ -939,15 +903,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -977,11 +937,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload with call error', async () => { @@ -996,26 +959,25 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createWorkload(request), expectedError); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createWorkload with LRO error', async () => { @@ -1030,15 +992,11 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -1047,11 +1005,14 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ); const [operation] = await client.createWorkload(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createWorkload as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkload as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateWorkloadProgress without error', async () => { @@ -1115,7 +1076,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() @@ -1130,11 +1090,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { client.innerApiCalls.listWorkloads = stubSimpleCall(expectedResponse); const [response] = await client.listWorkloads(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes listWorkloads without error using callback', async () => { @@ -1149,7 +1104,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.Workload() @@ -1182,11 +1136,6 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); }); it('invokes listWorkloads with error', async () => { @@ -1201,18 +1150,12 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.ListWorkloadsRequest() ); - const expectedOptions = {otherArgs: {headers: {}}}; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listWorkloads(request), expectedError); - assert( - (client.innerApiCalls.listWorkloads as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); }); it('invokes listWorkloadsStream without error', async () => { From d073994f0c24da263db3aa1f39878b142e4bb11c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 15:17:43 -0700 Subject: [PATCH 107/116] build: use fully qualified request type name in tests (#190) 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 --- .../gapic_assured_workloads_service_v1.ts | 157 ++++++++++-------- ...gapic_assured_workloads_service_v1beta1.ts | 64 +++---- 2 files changed, 128 insertions(+), 93 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 2a116d8b189..214ea07d3af 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -281,10 +281,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); request.workload ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ - 'workload', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest', + ['workload', 'name'] + ); request.workload.name = defaultValue1; const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -314,10 +314,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); request.workload ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ - 'workload', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest', + ['workload', 'name'] + ); request.workload.name = defaultValue1; const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -363,10 +363,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); request.workload ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ - 'workload', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest', + ['workload', 'name'] + ); request.workload.name = defaultValue1; const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -396,10 +396,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest() ); request.workload ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateWorkloadRequest', [ - 'workload', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.UpdateWorkloadRequest', + ['workload', 'name'] + ); request.workload.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -418,9 +418,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -449,9 +450,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -496,9 +498,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -527,9 +530,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -548,7 +552,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.GetWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -577,7 +584,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.GetWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -622,7 +632,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.GetWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -651,7 +664,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.GetWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('GetWorkloadRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.GetWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -670,9 +686,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -703,9 +720,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -757,9 +775,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -788,9 +807,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -866,9 +886,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -905,9 +926,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -960,9 +982,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -991,9 +1014,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1052,9 +1076,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1102,9 +1127,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1151,9 +1177,10 @@ describe('v1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.ListWorkloadsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListWorkloadsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.ListWorkloadsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 80ab99e4acf..0130b1fe719 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -391,7 +391,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'RestrictAllowedResourcesRequest', + '.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest', ['name'] ); request.name = defaultValue1; @@ -426,7 +426,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'RestrictAllowedResourcesRequest', + '.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest', ['name'] ); request.name = defaultValue1; @@ -476,7 +476,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'RestrictAllowedResourcesRequest', + '.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest', ['name'] ); request.name = defaultValue1; @@ -513,7 +513,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest() ); const defaultValue1 = getTypeDefaultValue( - 'RestrictAllowedResourcesRequest', + '.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest', ['name'] ); request.name = defaultValue1; @@ -539,9 +539,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -572,9 +573,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -621,9 +623,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -654,9 +657,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteWorkloadRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.DeleteWorkloadRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -868,9 +872,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -903,9 +908,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -959,9 +965,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -992,9 +999,10 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateWorkloadRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1beta1.CreateWorkloadRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From fc6b73eecfc4cd6daf1f8b99765455ac9e1d9c93 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:22:52 -0700 Subject: [PATCH 108/116] feat: add apis for AssuredWorkload monitoring feature and to restrict allowed resources (#192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add apis for AssuredWorkload monitoring feature and to restrict allowed resources AssuredWorkload monitoring is a new feature which provides apis to fetch compliance violation for AssuredWorkloads. It also provides an api to acknowledge an unresolved violation. RestrictAllowedResources api allows restricting list of available resources in Workload environment. Committer: @viswask PiperOrigin-RevId: 477959383 Source-Link: https://github.com/googleapis/googleapis/commit/0cad78c955be529d8a0e95d4fc70077ec2772602 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3052e0d7ac989bc571fb305894ada8525d1f248e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzA1MmUwZDdhYzk4OWJjNTcxZmIzMDU4OTRhZGE4NTI1ZDFmMjQ4ZSJ9 * 🦉 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 --- .../v1/assuredworkloads.proto | 520 ++- .../protos/protos.d.ts | 1600 ++++++- .../protos/protos.js | 3896 ++++++++++++++++- .../protos/protos.json | 449 +- ...workloads_service.acknowledge_violation.js | 77 + ...sured_workloads_service.create_workload.js | 4 +- ...assured_workloads_service.get_violation.js | 63 + .../assured_workloads_service.get_workload.js | 4 +- ...sured_workloads_service.list_violations.js | 82 + ...oads_service.restrict_allowed_resources.js | 70 + ...sured_workloads_service.update_workload.js | 2 +- ...data.google.cloud.assuredworkloads.v1.json | 188 + .../v1/assured_workloads_service_client.ts | 780 +++- ...sured_workloads_service_client_config.json | 20 + .../src/v1/gapic_metadata.json | 44 + .../gapic_assured_workloads_service_v1.ts | 969 +++- 16 files changed, 8574 insertions(+), 194 deletions(-) create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js create mode 100644 packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 9d4045e46d2..7068506f612 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,12 +41,10 @@ option (google.api.resource_definition) = { // Service to manage AssuredWorkloads. service AssuredWorkloadsService { option (google.api.default_host) = "assuredworkloads.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Creates Assured Workload. - rpc CreateWorkload(CreateWorkloadRequest) - returns (google.longrunning.Operation) { + rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*/locations/*}/workloads" body: "workload" @@ -70,6 +68,19 @@ service AssuredWorkloadsService { option (google.api.method_signature) = "workload,update_mask"; } + // Restrict the list of resources allowed in the Workload environment. + // The current list of allowed products can be found at + // https://cloud.google.com/assured-workloads/docs/supported-products + // In addition to assuredworkloads.workload.update permission, the user should + // also have orgpolicy.policy.set permission on the folder resource + // to use this functionality. + rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) { + option (google.api.http) = { + post: "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources" + body: "*" + }; + } + // Deletes the workload. Make sure that workload's direct children are already // in a deleted state, otherwise the request will fail with a // FAILED_PRECONDITION error. @@ -95,6 +106,27 @@ service AssuredWorkloadsService { }; option (google.api.method_signature) = "parent"; } + + // Lists the Violations in the AssuredWorkload Environment. + // Callers may also choose to read across multiple Workloads as per + // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + // character) as a wildcard character instead of workload-id in the parent. + // Format `organizations/{org_id}/locations/{location}/workloads/-` + rpc ListViolations(ListViolationsRequest) returns (ListViolationsResponse) { + option (google.api.method_signature) = "parent"; + } + + // Retrieves Assured Workload Violation based on ID. + rpc GetViolation(GetViolationRequest) returns (Violation) { + option (google.api.method_signature) = "name"; + } + + // Acknowledges an existing violation. By acknowledging a violation, users + // acknowledge the existence of a compliance violation in their workload and + // decide to ignore it due to a valid business justification. Acknowledgement + // is a permanent operation and it cannot be reverted. + rpc AcknowledgeViolation(AcknowledgeViolationRequest) returns (AcknowledgeViolationResponse) { + } } // Request for creating a workload. @@ -111,8 +143,8 @@ message CreateWorkloadRequest { // Required. Assured Workload to create Workload workload = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A identifier associated with the workload and underlying projects - // which allows for the break down of billing costs for a workload. The value + // Optional. A identifier associated with the workload and underlying projects which + // allows for the break down of billing costs for a workload. The value // provided for the identifier will add a label to the workload and contained // projects with the identifier as the value. string external_id = 3 [(google.api.field_behavior) = OPTIONAL]; @@ -121,14 +153,13 @@ message CreateWorkloadRequest { // Request for Updating a workload. message UpdateWorkloadRequest { // Required. The workload to update. - // The workload’s `name` field is used to identify the workload to be updated. + // The workload's `name` field is used to identify the workload to be updated. // Format: // organizations/{org_id}/locations/{location_id}/workloads/{workload_id} Workload workload = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } // Request for deleting a Workload. @@ -150,8 +181,8 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the - // workloads's relative path in the API, formatted as + // Required. The resource name of the Workload to fetch. This is the workloads's + // relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, // "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -212,7 +243,14 @@ message Workload { RESOURCE_TYPE_UNSPECIFIED = 0; // Consumer project. - CONSUMER_PROJECT = 1; + // AssuredWorkloads Projects are no longer supported. This field will be + // ignored only in CreateWorkload requests. ListWorkloads and GetWorkload + // will continue to provide projects information. + // Use CONSUMER_FOLDER instead. + CONSUMER_PROJECT = 1 [deprecated = true]; + + // Consumer Folder. + CONSUMER_FOLDER = 4; // Consumer project containing encryption keys. ENCRYPTION_KEYS_PROJECT = 2; @@ -229,20 +267,60 @@ message Workload { ResourceType resource_type = 2; } + // Supported Compliance Regimes. + enum ComplianceRegime { + // Unknown compliance regime. + COMPLIANCE_REGIME_UNSPECIFIED = 0; + + // Information protection as per DoD IL4 requirements. + IL4 = 1; + + // Criminal Justice Information Services (CJIS) Security policies. + CJIS = 2; + + // FedRAMP High data protection controls + FEDRAMP_HIGH = 3; + + // FedRAMP Moderate data protection controls + FEDRAMP_MODERATE = 4; + + // Assured Workloads For US Regions data protection controls + US_REGIONAL_ACCESS = 5; + + // Health Insurance Portability and Accountability Act controls + HIPAA = 6; + + // Health Information Trust Alliance controls + HITRUST = 7; + + // Assured Workloads For EU Regions and Support controls + EU_REGIONS_AND_SUPPORT = 8; + + // Assured Workloads For Canada Regions and Support controls + CA_REGIONS_AND_SUPPORT = 9; + + // International Traffic in Arms Regulations + ITAR = 10; + + // Assured Workloads for Partners; + ASSURED_WORKLOADS_FOR_PARTNERS = 12; + } + // Settings specific to the Key Management Service. message KMSSettings { - // Required. Input only. Immutable. The time at which the Key Management - // Service will automatically create a new version of the crypto key and - // mark it as the primary. + option deprecated = true; + + // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a + // new version of the crypto key and mark it as the primary. google.protobuf.Timestamp next_rotation_time = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. Immutable. [next_rotation_time] will be advanced by - // this period when the Key Management Service automatically rotates a key. - // Must be at least 24 hours and at most 876,000 hours. + // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key + // Management Service automatically rotates a key. Must be at least 24 hours + // and at most 876,000 hours. google.protobuf.Duration rotation_period = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = INPUT_ONLY, @@ -255,6 +333,8 @@ message Workload { // Resource identifier. // For a project this represents project_id. If the project is already // taken, the workload creation will fail. + // For KeyRing, this represents the keyring_id. + // For a folder, don't set this value as folder_id is assigned by Google. string resource_id = 1; // Indicates the type of resource. This field should be specified to @@ -268,6 +348,18 @@ message Workload { string display_name = 3; } + // Key Access Justifications(KAJ) Enrollment State. + enum KajEnrollmentState { + // Default State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; + + // Pending State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_PENDING = 1; + + // Complete State for KAJ Enrollment. + KAJ_ENROLLMENT_STATE_COMPLETE = 2; + } + // Signed Access Approvals (SAA) enrollment response. message SaaEnrollmentResponse { // Setup state of SAA enrollment. @@ -310,52 +402,13 @@ message Workload { repeated SetupError setup_errors = 2; } - // Supported Compliance Regimes. - enum ComplianceRegime { + // Supported Assured Workloads Partners. + enum Partner { // Unknown compliance regime. - COMPLIANCE_REGIME_UNSPECIFIED = 0; - - // Information protection as per DoD IL4 requirements. - IL4 = 1; - - // Criminal Justice Information Services (CJIS) Security policies. - CJIS = 2; - - // FedRAMP High data protection controls - FEDRAMP_HIGH = 3; - - // FedRAMP Moderate data protection controls - FEDRAMP_MODERATE = 4; - - // Assured Workloads For US Regions data protection controls - US_REGIONAL_ACCESS = 5; + PARTNER_UNSPECIFIED = 0; - // Health Insurance Portability and Accountability Act controls - HIPAA = 6; - - // Health Information Trust Alliance controls - HITRUST = 7; - - // Assured Workloads For EU Regions and Support controls - EU_REGIONS_AND_SUPPORT = 8; - - // Assured Workloads For Canada Regions and Support controls - CA_REGIONS_AND_SUPPORT = 9; - - // International Traffic in Arms Regulations - ITAR = 10; - } - - // Key Access Justifications(KAJ) Enrollment State. - enum KajEnrollmentState { - // Default State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0; - - // Pending State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_PENDING = 1; - - // Complete State for KAJ Enrollment. - KAJ_ENROLLMENT_STATE_COMPLETE = 2; + // S3NS regime + LOCAL_CONTROLS_BY_S3NS = 1; } // Optional. The resource name of the workload. @@ -377,8 +430,7 @@ message Workload { // These resources will be created when creating the workload. // If any of the projects already exist, the workload creation will fail. // Always read only. - repeated ResourceInfo resources = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Required. Immutable. Compliance Regime associated with this workload. ComplianceRegime compliance_regime = 4 [ @@ -392,7 +444,7 @@ message Workload { (google.api.field_behavior) = IMMUTABLE ]; - // Required. Input only. The billing account used for the resources which are + // Optional. The billing account used for the resources which are // direct children of workload. This billing account is initially associated // with the resources created as part of Workload creation. // After the initial creation of these resources, the customer can change @@ -400,10 +452,7 @@ message Workload { // The resource name has the form // `billingAccounts/{billing_account_id}`. For example, // `billingAccounts/012345-567890-ABCDEF`. - string billing_account = 6 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = INPUT_ONLY - ]; + string billing_account = 6 [(google.api.field_behavior) = OPTIONAL]; // Optional. ETag of the workload, it is calculated on the basis // of the Workload contents. It will be used in Update & Delete operations. @@ -412,29 +461,31 @@ message Workload { // Optional. Labels applied to the workload. map labels = 10 [(google.api.field_behavior) = OPTIONAL]; - // Input only. The parent resource for the resources managed by this Assured - // Workload. May be either empty or a folder resource which is a child of the + // Input only. The parent resource for the resources managed by this Assured Workload. May + // be either empty or a folder resource which is a child of the // Workload parent. If not specified all resources are created under the // parent organization. // Format: // folders/{folder_id} - string provisioned_resources_parent = 13 - [(google.api.field_behavior) = INPUT_ONLY]; - - // Input only. Settings used to create a CMEK crypto key. When set a project - // with a KMS CMEK key is provisioned. This field is mandatory for a subset of - // Compliance Regimes. - KMSSettings kms_settings = 14 [(google.api.field_behavior) = INPUT_ONLY]; + string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY]; + + // Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS + // CMEK key is provisioned. + // This field is deprecated as of Feb 28, 2022. + // In order to create a Keyring, callers should specify, + // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. + KMSSettings kms_settings = 14 [ + deprecated = true, + (google.api.field_behavior) = INPUT_ONLY + ]; - // Input only. Resource properties that are used to customize workload - // resources. These properties (such as custom project id) will be used to - // create workload resources if possible. This field is optional. - repeated ResourceSettings resource_settings = 15 - [(google.api.field_behavior) = INPUT_ONLY]; + // Input only. Resource properties that are used to customize workload resources. + // These properties (such as custom project id) will be used to create + // workload resources if possible. This field is optional. + repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY]; // Output only. Represents the KAJ enrollment state of the given workload. - KajEnrollmentState kaj_enrollment_state = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; + KajEnrollmentState kaj_enrollment_state = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Indicates the sovereignty status of the given workload. // Currently meant to be used by Europe/Canada customers. @@ -443,15 +494,22 @@ message Workload { // Output only. Represents the SAA enrollment response of the given workload. // SAA enrollment response is queried during GetWorkload call. // In failure cases, user friendly error message is shown in SAA details page. - SaaEnrollmentResponse saa_enrollment_response = 20 - [(google.api.field_behavior) = OUTPUT_ONLY]; + SaaEnrollmentResponse saa_enrollment_response = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Urls for services which are compliant for this Assured Workload, but which + // are currently disallowed by the ResourceUsageRestriction org policy. + // Invoke RestrictAllowedResources endpoint to allow your project developers + // to use these services in their environment." + repeated string compliant_but_disallowed_services = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Compliance Regime associated with this workload. + Partner partner = 25 [(google.api.field_behavior) = OPTIONAL]; } // Operation metadata to give request details of CreateWorkload. message CreateWorkloadOperationMetadata { // Optional. Time when the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. The display name of the workload. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -459,8 +517,282 @@ message CreateWorkloadOperationMetadata { // Optional. The parent of the workload. string parent = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Compliance controls that should be applied to the resources - // managed by the workload. - Workload.ComplianceRegime compliance_regime = 4 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Compliance controls that should be applied to the resources managed by + // the workload. + Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for restricting list of available resources in Workload environment. +message RestrictAllowedResourcesRequest { + // The type of restriction. + enum RestrictionType { + // Unknown restriction type. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Allow the use all of all gcp products, irrespective of the compliance + // posture. This effectively removes gcp.restrictServiceUsage OrgPolicy + // on the AssuredWorkloads Folder. + ALLOW_ALL_GCP_RESOURCES = 1; + + // Based on Workload's compliance regime, allowed list changes. + // See - https://cloud.google.com/assured-workloads/docs/supported-products + // for the list of supported resources. + ALLOW_COMPLIANT_RESOURCES = 2; + } + + // Required. The resource name of the Workload. This is the workloads's + // relative path in the API, formatted as + // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + // For example, + // "organizations/123/locations/us-east1/workloads/assured-workload-1". + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of restriction for using gcp products in the Workload environment. + RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response for restricting the list of allowed resources. +message RestrictAllowedResourcesResponse { + +} + +// Request for acknowledging the violation +// Next Id: 4 +message AcknowledgeViolationRequest { + // Required. The resource name of the Violation to acknowledge. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Business justification explaining the need for violation acknowledgement + string comment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Name of the OrgPolicy which was modified with non-compliant change and + // resulted in this violation. + // Format: + // projects/{project_number}/policies/{constraint_name} + // folders/{folder_id}/policies/{constraint_name} + // organizations/{organization_id}/policies/{constraint_name} + string non_compliant_org_policy = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for violation acknowledgement +message AcknowledgeViolationResponse { + +} + +// Interval defining a time window. +message TimeWindow { + // The start of the time window. + google.protobuf.Timestamp start_time = 1; + + // The end of the time window. + google.protobuf.Timestamp end_time = 2; +} + +// Request for fetching violations in an organization. +message ListViolationsRequest { + // Required. The Workload name. + // Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "assuredworkloads.googleapis.com/Violation" + } + ]; + + // Optional. Specifies the time window for retrieving active Violations. + // When specified, retrieves Violations that were active between start_time + // and end_time. + TimeWindow interval = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token returned from previous request. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A custom filter for filtering by the Violations properties. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of ListViolations endpoint. +message ListViolationsResponse { + // List of Violations under a Workload. + repeated Violation violations = 1; + + // The next page token. Returns empty if reached the last page. + string next_page_token = 2; +} + +// Request for fetching a Workload Violation. +message GetViolationRequest { + // Required. The resource name of the Violation to fetch (ie. Violation.name). + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "assuredworkloads.googleapis.com/Violation" + } + ]; +} + +// Workload monitoring Violation. +message Violation { + option (google.api.resource) = { + type: "assuredworkloads.googleapis.com/Violation" + pattern: "organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}" + }; + + // Violation State Values + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // Violation is resolved. + RESOLVED = 2; + + // Violation is Unresolved + UNRESOLVED = 3; + + // Violation is Exception + EXCEPTION = 4; + } + + // Represents remediation guidance to resolve compliance violation for + // AssuredWorkload + message Remediation { + // Classifying remediation into various types based on the kind of + // violation. For example, violations caused due to changes in boolean org + // policy requires different remediation instructions compared to violation + // caused due to changes in allowed values of list org policy. + enum RemediationType { + // Unspecified remediation type + REMEDIATION_TYPE_UNSPECIFIED = 0; + + // Remediation type for boolean org policy + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1; + + // Remediation type for list org policy which have allowed values in the + // monitoring rule + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2; + + // Remediation type for list org policy which have denied values in the + // monitoring rule + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3; + + // Remediation type for gcp.restrictCmekCryptoKeyProjects + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4; + } + + // Instructions to remediate violation + message Instructions { + // Remediation instructions to resolve violation via gcloud cli + message Gcloud { + // Gcloud command to resolve violation + repeated string gcloud_commands = 1; + + // Steps to resolve violation via gcloud cli + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via cloud console + message Console { + // Link to console page where violations can be resolved + repeated string console_uris = 1; + + // Steps to resolve violation via cloud console + repeated string steps = 2; + + // Additional urls for more information about steps + repeated string additional_links = 3; + } + + // Remediation instructions to resolve violation via gcloud cli + Gcloud gcloud_instructions = 1; + + // Remediation instructions to resolve violation via cloud console + Console console_instructions = 2; + } + + // Required. Remediation instructions to resolve violations + Instructions instructions = 1 [(google.api.field_behavior) = REQUIRED]; + + // Values that can resolve the violation + // For example: for list org policy violations, this will either be the list + // of allowed or denied values + repeated string compliant_values = 2; + + // Output only. Reemediation type based on the type of org policy values violated + RemediationType remediation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Immutable. Name of the Violation. + // Format: + // organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Description for the Violation. + // e.g. OrgPolicy gcp.resourceLocations has non compliant value. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which triggered the Violation. + google.protobuf.Timestamp begin_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time when the Violation record was updated. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time of the event which fixed the Violation. + // If the violation is ACTIVE this will be empty. + google.protobuf.Timestamp resolve_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Category under which this violation is mapped. + // e.g. Location, Service Usage, Access, Encryption, etc. + string category = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the violation + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in + // this violation. + string org_policy_constraint = 8 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Audit Log Link for violated resource + // Format: + // https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder} + string audit_log_link = 11 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and + // resulted this violation. + // Format: + // projects/{project_number}/policies/{constraint_name} + // folders/{folder_id}/policies/{constraint_name} + // organizations/{organization_id}/policies/{constraint_name} + string non_compliant_org_policy = 12 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Compliance violation remediation + Remediation remediation = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A boolean that indicates if the violation is acknowledged + bool acknowledged = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Timestamp when this violation was acknowledged last. + // This will be absent when acknowledged field is marked as false. + optional google.protobuf.Timestamp acknowledgement_time = 15 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index e5d7882e672..216d22a3be3 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -74,6 +74,20 @@ export namespace google { */ public updateWorkload(request: google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest): Promise; + /** + * Calls RestrictAllowedResources. + * @param request RestrictAllowedResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RestrictAllowedResourcesResponse + */ + public restrictAllowedResources(request: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.RestrictAllowedResourcesCallback): void; + + /** + * Calls RestrictAllowedResources. + * @param request RestrictAllowedResourcesRequest message or plain object + * @returns Promise + */ + public restrictAllowedResources(request: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest): Promise; + /** * Calls DeleteWorkload. * @param request DeleteWorkloadRequest message or plain object @@ -115,6 +129,48 @@ export namespace google { * @returns Promise */ public listWorkloads(request: google.cloud.assuredworkloads.v1.IListWorkloadsRequest): Promise; + + /** + * Calls ListViolations. + * @param request ListViolationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListViolationsResponse + */ + public listViolations(request: google.cloud.assuredworkloads.v1.IListViolationsRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListViolationsCallback): void; + + /** + * Calls ListViolations. + * @param request ListViolationsRequest message or plain object + * @returns Promise + */ + public listViolations(request: google.cloud.assuredworkloads.v1.IListViolationsRequest): Promise; + + /** + * Calls GetViolation. + * @param request GetViolationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Violation + */ + public getViolation(request: google.cloud.assuredworkloads.v1.IGetViolationRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetViolationCallback): void; + + /** + * Calls GetViolation. + * @param request GetViolationRequest message or plain object + * @returns Promise + */ + public getViolation(request: google.cloud.assuredworkloads.v1.IGetViolationRequest): Promise; + + /** + * Calls AcknowledgeViolation. + * @param request AcknowledgeViolationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AcknowledgeViolationResponse + */ + public acknowledgeViolation(request: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, callback: google.cloud.assuredworkloads.v1.AssuredWorkloadsService.AcknowledgeViolationCallback): void; + + /** + * Calls AcknowledgeViolation. + * @param request AcknowledgeViolationRequest message or plain object + * @returns Promise + */ + public acknowledgeViolation(request: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest): Promise; } namespace AssuredWorkloadsService { @@ -133,6 +189,13 @@ export namespace google { */ type UpdateWorkloadCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Workload) => void; + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|restrictAllowedResources}. + * @param error Error, if any + * @param [response] RestrictAllowedResourcesResponse + */ + type RestrictAllowedResourcesCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) => void; + /** * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|deleteWorkload}. * @param error Error, if any @@ -153,6 +216,27 @@ export namespace google { * @param [response] ListWorkloadsResponse */ type ListWorkloadsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.ListWorkloadsResponse) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|listViolations}. + * @param error Error, if any + * @param [response] ListViolationsResponse + */ + type ListViolationsCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.ListViolationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|getViolation}. + * @param error Error, if any + * @param [response] Violation + */ + type GetViolationCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.Violation) => void; + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|acknowledgeViolation}. + * @param error Error, if any + * @param [response] AcknowledgeViolationResponse + */ + type AcknowledgeViolationCallback = (error: (Error|null), response?: google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) => void; } /** Properties of a CreateWorkloadRequest. */ @@ -829,6 +913,12 @@ export namespace google { /** Workload saaEnrollmentResponse */ saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null); + + /** Workload compliantButDisallowedServices */ + compliantButDisallowedServices?: (string[]|null); + + /** Workload partner */ + partner?: (google.cloud.assuredworkloads.v1.Workload.Partner|keyof typeof google.cloud.assuredworkloads.v1.Workload.Partner|null); } /** Represents a Workload. */ @@ -882,6 +972,12 @@ export namespace google { /** Workload saaEnrollmentResponse. */ public saaEnrollmentResponse?: (google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null); + /** Workload compliantButDisallowedServices. */ + public compliantButDisallowedServices: string[]; + + /** Workload partner. */ + public partner: (google.cloud.assuredworkloads.v1.Workload.Partner|keyof typeof google.cloud.assuredworkloads.v1.Workload.Partner); + /** * Creates a new Workload instance using the specified properties. * @param [properties] Properties to set @@ -1071,11 +1167,28 @@ export namespace google { enum ResourceType { RESOURCE_TYPE_UNSPECIFIED = 0, CONSUMER_PROJECT = 1, + CONSUMER_FOLDER = 4, ENCRYPTION_KEYS_PROJECT = 2, KEYRING = 3 } } + /** ComplianceRegime enum. */ + enum ComplianceRegime { + COMPLIANCE_REGIME_UNSPECIFIED = 0, + IL4 = 1, + CJIS = 2, + FEDRAMP_HIGH = 3, + FEDRAMP_MODERATE = 4, + US_REGIONAL_ACCESS = 5, + HIPAA = 6, + HITRUST = 7, + EU_REGIONS_AND_SUPPORT = 8, + CA_REGIONS_AND_SUPPORT = 9, + ITAR = 10, + ASSURED_WORKLOADS_FOR_PARTNERS = 12 + } + /** Properties of a KMSSettings. */ interface IKMSSettings { @@ -1288,6 +1401,13 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** KajEnrollmentState enum. */ + enum KajEnrollmentState { + KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, + KAJ_ENROLLMENT_STATE_PENDING = 1, + KAJ_ENROLLMENT_STATE_COMPLETE = 2 + } + /** Properties of a SaaEnrollmentResponse. */ interface ISaaEnrollmentResponse { @@ -1413,26 +1533,10 @@ export namespace google { } } - /** ComplianceRegime enum. */ - enum ComplianceRegime { - COMPLIANCE_REGIME_UNSPECIFIED = 0, - IL4 = 1, - CJIS = 2, - FEDRAMP_HIGH = 3, - FEDRAMP_MODERATE = 4, - US_REGIONAL_ACCESS = 5, - HIPAA = 6, - HITRUST = 7, - EU_REGIONS_AND_SUPPORT = 8, - CA_REGIONS_AND_SUPPORT = 9, - ITAR = 10 - } - - /** KajEnrollmentState enum. */ - enum KajEnrollmentState { - KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0, - KAJ_ENROLLMENT_STATE_PENDING = 1, - KAJ_ENROLLMENT_STATE_COMPLETE = 2 + /** Partner enum. */ + enum Partner { + PARTNER_UNSPECIFIED = 0, + LOCAL_CONTROLS_BY_S3NS = 1 } } @@ -1550,6 +1654,1462 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a RestrictAllowedResourcesRequest. */ + interface IRestrictAllowedResourcesRequest { + + /** RestrictAllowedResourcesRequest name */ + name?: (string|null); + + /** RestrictAllowedResourcesRequest restrictionType */ + restrictionType?: (google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType|null); + } + + /** Represents a RestrictAllowedResourcesRequest. */ + class RestrictAllowedResourcesRequest implements IRestrictAllowedResourcesRequest { + + /** + * Constructs a new RestrictAllowedResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest); + + /** RestrictAllowedResourcesRequest name. */ + public name: string; + + /** RestrictAllowedResourcesRequest restrictionType. */ + public restrictionType: (google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType|keyof typeof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType); + + /** + * Creates a new RestrictAllowedResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictAllowedResourcesRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @param message RestrictAllowedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @param message RestrictAllowedResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; + + /** + * Verifies a RestrictAllowedResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest; + + /** + * Creates a plain object from a RestrictAllowedResourcesRequest message. Also converts values to other types if specified. + * @param message RestrictAllowedResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RestrictAllowedResourcesRequest { + + /** RestrictionType enum. */ + enum RestrictionType { + RESTRICTION_TYPE_UNSPECIFIED = 0, + ALLOW_ALL_GCP_RESOURCES = 1, + ALLOW_COMPLIANT_RESOURCES = 2 + } + } + + /** Properties of a RestrictAllowedResourcesResponse. */ + interface IRestrictAllowedResourcesResponse { + } + + /** Represents a RestrictAllowedResourcesResponse. */ + class RestrictAllowedResourcesResponse implements IRestrictAllowedResourcesResponse { + + /** + * Constructs a new RestrictAllowedResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse); + + /** + * Creates a new RestrictAllowedResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestrictAllowedResourcesResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @param message RestrictAllowedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @param message RestrictAllowedResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + + /** + * Verifies a RestrictAllowedResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestrictAllowedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestrictAllowedResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse; + + /** + * Creates a plain object from a RestrictAllowedResourcesResponse message. Also converts values to other types if specified. + * @param message RestrictAllowedResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestrictAllowedResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestrictAllowedResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcknowledgeViolationRequest. */ + interface IAcknowledgeViolationRequest { + + /** AcknowledgeViolationRequest name */ + name?: (string|null); + + /** AcknowledgeViolationRequest comment */ + comment?: (string|null); + + /** AcknowledgeViolationRequest nonCompliantOrgPolicy */ + nonCompliantOrgPolicy?: (string|null); + } + + /** Represents an AcknowledgeViolationRequest. */ + class AcknowledgeViolationRequest implements IAcknowledgeViolationRequest { + + /** + * Constructs a new AcknowledgeViolationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest); + + /** AcknowledgeViolationRequest name. */ + public name: string; + + /** AcknowledgeViolationRequest comment. */ + public comment: string; + + /** AcknowledgeViolationRequest nonCompliantOrgPolicy. */ + public nonCompliantOrgPolicy: string; + + /** + * Creates a new AcknowledgeViolationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeViolationRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest): google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; + + /** + * Encodes the specified AcknowledgeViolationRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.verify|verify} messages. + * @param message AcknowledgeViolationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeViolationRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.verify|verify} messages. + * @param message AcknowledgeViolationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeViolationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; + + /** + * Decodes an AcknowledgeViolationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; + + /** + * Verifies an AcknowledgeViolationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcknowledgeViolationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeViolationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest; + + /** + * Creates a plain object from an AcknowledgeViolationRequest message. Also converts values to other types if specified. + * @param message AcknowledgeViolationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeViolationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeViolationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcknowledgeViolationResponse. */ + interface IAcknowledgeViolationResponse { + } + + /** Represents an AcknowledgeViolationResponse. */ + class AcknowledgeViolationResponse implements IAcknowledgeViolationResponse { + + /** + * Constructs a new AcknowledgeViolationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse); + + /** + * Creates a new AcknowledgeViolationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AcknowledgeViolationResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse): google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; + + /** + * Encodes the specified AcknowledgeViolationResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.verify|verify} messages. + * @param message AcknowledgeViolationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcknowledgeViolationResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.verify|verify} messages. + * @param message AcknowledgeViolationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcknowledgeViolationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcknowledgeViolationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; + + /** + * Decodes an AcknowledgeViolationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcknowledgeViolationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; + + /** + * Verifies an AcknowledgeViolationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcknowledgeViolationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcknowledgeViolationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse; + + /** + * Creates a plain object from an AcknowledgeViolationResponse message. Also converts values to other types if specified. + * @param message AcknowledgeViolationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcknowledgeViolationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcknowledgeViolationResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { + + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.ITimeWindow): google.cloud.assuredworkloads.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.assuredworkloads.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.TimeWindow; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.TimeWindow; + + /** + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.TimeWindow; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListViolationsRequest. */ + interface IListViolationsRequest { + + /** ListViolationsRequest parent */ + parent?: (string|null); + + /** ListViolationsRequest interval */ + interval?: (google.cloud.assuredworkloads.v1.ITimeWindow|null); + + /** ListViolationsRequest pageSize */ + pageSize?: (number|null); + + /** ListViolationsRequest pageToken */ + pageToken?: (string|null); + + /** ListViolationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListViolationsRequest. */ + class ListViolationsRequest implements IListViolationsRequest { + + /** + * Constructs a new ListViolationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IListViolationsRequest); + + /** ListViolationsRequest parent. */ + public parent: string; + + /** ListViolationsRequest interval. */ + public interval?: (google.cloud.assuredworkloads.v1.ITimeWindow|null); + + /** ListViolationsRequest pageSize. */ + public pageSize: number; + + /** ListViolationsRequest pageToken. */ + public pageToken: string; + + /** ListViolationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListViolationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListViolationsRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IListViolationsRequest): google.cloud.assuredworkloads.v1.ListViolationsRequest; + + /** + * Encodes the specified ListViolationsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsRequest.verify|verify} messages. + * @param message ListViolationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IListViolationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListViolationsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsRequest.verify|verify} messages. + * @param message ListViolationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IListViolationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListViolationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListViolationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.ListViolationsRequest; + + /** + * Decodes a ListViolationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListViolationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.ListViolationsRequest; + + /** + * Verifies a ListViolationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListViolationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListViolationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.ListViolationsRequest; + + /** + * Creates a plain object from a ListViolationsRequest message. Also converts values to other types if specified. + * @param message ListViolationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.ListViolationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListViolationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListViolationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListViolationsResponse. */ + interface IListViolationsResponse { + + /** ListViolationsResponse violations */ + violations?: (google.cloud.assuredworkloads.v1.IViolation[]|null); + + /** ListViolationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListViolationsResponse. */ + class ListViolationsResponse implements IListViolationsResponse { + + /** + * Constructs a new ListViolationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IListViolationsResponse); + + /** ListViolationsResponse violations. */ + public violations: google.cloud.assuredworkloads.v1.IViolation[]; + + /** ListViolationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListViolationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListViolationsResponse instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IListViolationsResponse): google.cloud.assuredworkloads.v1.ListViolationsResponse; + + /** + * Encodes the specified ListViolationsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsResponse.verify|verify} messages. + * @param message ListViolationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IListViolationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListViolationsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsResponse.verify|verify} messages. + * @param message ListViolationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IListViolationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListViolationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListViolationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.ListViolationsResponse; + + /** + * Decodes a ListViolationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListViolationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.ListViolationsResponse; + + /** + * Verifies a ListViolationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListViolationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListViolationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.ListViolationsResponse; + + /** + * Creates a plain object from a ListViolationsResponse message. Also converts values to other types if specified. + * @param message ListViolationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.ListViolationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListViolationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListViolationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetViolationRequest. */ + interface IGetViolationRequest { + + /** GetViolationRequest name */ + name?: (string|null); + } + + /** Represents a GetViolationRequest. */ + class GetViolationRequest implements IGetViolationRequest { + + /** + * Constructs a new GetViolationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IGetViolationRequest); + + /** GetViolationRequest name. */ + public name: string; + + /** + * Creates a new GetViolationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetViolationRequest instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IGetViolationRequest): google.cloud.assuredworkloads.v1.GetViolationRequest; + + /** + * Encodes the specified GetViolationRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetViolationRequest.verify|verify} messages. + * @param message GetViolationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IGetViolationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetViolationRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetViolationRequest.verify|verify} messages. + * @param message GetViolationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IGetViolationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetViolationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.GetViolationRequest; + + /** + * Decodes a GetViolationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.GetViolationRequest; + + /** + * Verifies a GetViolationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetViolationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetViolationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.GetViolationRequest; + + /** + * Creates a plain object from a GetViolationRequest message. Also converts values to other types if specified. + * @param message GetViolationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.GetViolationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetViolationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetViolationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Violation. */ + interface IViolation { + + /** Violation name */ + name?: (string|null); + + /** Violation description */ + description?: (string|null); + + /** Violation beginTime */ + beginTime?: (google.protobuf.ITimestamp|null); + + /** Violation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Violation resolveTime */ + resolveTime?: (google.protobuf.ITimestamp|null); + + /** Violation category */ + category?: (string|null); + + /** Violation state */ + state?: (google.cloud.assuredworkloads.v1.Violation.State|keyof typeof google.cloud.assuredworkloads.v1.Violation.State|null); + + /** Violation orgPolicyConstraint */ + orgPolicyConstraint?: (string|null); + + /** Violation auditLogLink */ + auditLogLink?: (string|null); + + /** Violation nonCompliantOrgPolicy */ + nonCompliantOrgPolicy?: (string|null); + + /** Violation remediation */ + remediation?: (google.cloud.assuredworkloads.v1.Violation.IRemediation|null); + + /** Violation acknowledged */ + acknowledged?: (boolean|null); + + /** Violation acknowledgementTime */ + acknowledgementTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Violation. */ + class Violation implements IViolation { + + /** + * Constructs a new Violation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.IViolation); + + /** Violation name. */ + public name: string; + + /** Violation description. */ + public description: string; + + /** Violation beginTime. */ + public beginTime?: (google.protobuf.ITimestamp|null); + + /** Violation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Violation resolveTime. */ + public resolveTime?: (google.protobuf.ITimestamp|null); + + /** Violation category. */ + public category: string; + + /** Violation state. */ + public state: (google.cloud.assuredworkloads.v1.Violation.State|keyof typeof google.cloud.assuredworkloads.v1.Violation.State); + + /** Violation orgPolicyConstraint. */ + public orgPolicyConstraint: string; + + /** Violation auditLogLink. */ + public auditLogLink: string; + + /** Violation nonCompliantOrgPolicy. */ + public nonCompliantOrgPolicy: string; + + /** Violation remediation. */ + public remediation?: (google.cloud.assuredworkloads.v1.Violation.IRemediation|null); + + /** Violation acknowledged. */ + public acknowledged: boolean; + + /** Violation acknowledgementTime. */ + public acknowledgementTime?: (google.protobuf.ITimestamp|null); + + /** Violation _acknowledgementTime. */ + public _acknowledgementTime?: "acknowledgementTime"; + + /** + * Creates a new Violation instance using the specified properties. + * @param [properties] Properties to set + * @returns Violation instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.IViolation): google.cloud.assuredworkloads.v1.Violation; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.verify|verify} messages. + * @param message Violation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.IViolation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Violation; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Violation; + + /** + * Verifies a Violation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Violation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Violation; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @param message Violation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Violation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Violation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Violation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Violation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + RESOLVED = 2, + UNRESOLVED = 3, + EXCEPTION = 4 + } + + /** Properties of a Remediation. */ + interface IRemediation { + + /** Remediation instructions */ + instructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions|null); + + /** Remediation compliantValues */ + compliantValues?: (string[]|null); + + /** Remediation remediationType */ + remediationType?: (google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType|keyof typeof google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType|null); + } + + /** Represents a Remediation. */ + class Remediation implements IRemediation { + + /** + * Constructs a new Remediation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Violation.IRemediation); + + /** Remediation instructions. */ + public instructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions|null); + + /** Remediation compliantValues. */ + public compliantValues: string[]; + + /** Remediation remediationType. */ + public remediationType: (google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType|keyof typeof google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType); + + /** + * Creates a new Remediation instance using the specified properties. + * @param [properties] Properties to set + * @returns Remediation instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Violation.IRemediation): google.cloud.assuredworkloads.v1.Violation.Remediation; + + /** + * Encodes the specified Remediation message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.verify|verify} messages. + * @param message Remediation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Violation.IRemediation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Remediation message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.verify|verify} messages. + * @param message Remediation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Violation.IRemediation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Remediation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Remediation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Violation.Remediation; + + /** + * Decodes a Remediation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Remediation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Violation.Remediation; + + /** + * Verifies a Remediation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Remediation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Remediation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Violation.Remediation; + + /** + * Creates a plain object from a Remediation message. Also converts values to other types if specified. + * @param message Remediation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Violation.Remediation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Remediation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Remediation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Remediation { + + /** RemediationType enum. */ + enum RemediationType { + REMEDIATION_TYPE_UNSPECIFIED = 0, + REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1, + REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2, + REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3, + REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4 + } + + /** Properties of an Instructions. */ + interface IInstructions { + + /** Instructions gcloudInstructions */ + gcloudInstructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud|null); + + /** Instructions consoleInstructions */ + consoleInstructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole|null); + } + + /** Represents an Instructions. */ + class Instructions implements IInstructions { + + /** + * Constructs a new Instructions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions); + + /** Instructions gcloudInstructions. */ + public gcloudInstructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud|null); + + /** Instructions consoleInstructions. */ + public consoleInstructions?: (google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole|null); + + /** + * Creates a new Instructions instance using the specified properties. + * @param [properties] Properties to set + * @returns Instructions instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions; + + /** + * Encodes the specified Instructions message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.verify|verify} messages. + * @param message Instructions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instructions message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.verify|verify} messages. + * @param message Instructions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instructions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions; + + /** + * Decodes an Instructions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions; + + /** + * Verifies an Instructions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Instructions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instructions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions; + + /** + * Creates a plain object from an Instructions message. Also converts values to other types if specified. + * @param message Instructions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instructions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instructions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instructions { + + /** Properties of a Gcloud. */ + interface IGcloud { + + /** Gcloud gcloudCommands */ + gcloudCommands?: (string[]|null); + + /** Gcloud steps */ + steps?: (string[]|null); + + /** Gcloud additionalLinks */ + additionalLinks?: (string[]|null); + } + + /** Represents a Gcloud. */ + class Gcloud implements IGcloud { + + /** + * Constructs a new Gcloud. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud); + + /** Gcloud gcloudCommands. */ + public gcloudCommands: string[]; + + /** Gcloud steps. */ + public steps: string[]; + + /** Gcloud additionalLinks. */ + public additionalLinks: string[]; + + /** + * Creates a new Gcloud instance using the specified properties. + * @param [properties] Properties to set + * @returns Gcloud instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud; + + /** + * Encodes the specified Gcloud message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.verify|verify} messages. + * @param message Gcloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Gcloud message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.verify|verify} messages. + * @param message Gcloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Gcloud message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Gcloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud; + + /** + * Decodes a Gcloud message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Gcloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud; + + /** + * Verifies a Gcloud message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Gcloud message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Gcloud + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud; + + /** + * Creates a plain object from a Gcloud message. Also converts values to other types if specified. + * @param message Gcloud + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Gcloud to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Gcloud + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Console. */ + interface IConsole { + + /** Console consoleUris */ + consoleUris?: (string[]|null); + + /** Console steps */ + steps?: (string[]|null); + + /** Console additionalLinks */ + additionalLinks?: (string[]|null); + } + + /** Represents a Console. */ + class Console implements IConsole { + + /** + * Constructs a new Console. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole); + + /** Console consoleUris. */ + public consoleUris: string[]; + + /** Console steps. */ + public steps: string[]; + + /** Console additionalLinks. */ + public additionalLinks: string[]; + + /** + * Creates a new Console instance using the specified properties. + * @param [properties] Properties to set + * @returns Console instance + */ + public static create(properties?: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console; + + /** + * Encodes the specified Console message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.verify|verify} messages. + * @param message Console message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Console message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.verify|verify} messages. + * @param message Console message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Console message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Console + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console; + + /** + * Decodes a Console message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Console + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console; + + /** + * Verifies a Console message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Console message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Console + */ + public static fromObject(object: { [k: string]: any }): google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console; + + /** + * Creates a plain object from a Console message. Also converts values to other types if specified. + * @param message Console + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Console to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Console + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 919e49e0ddc..c5f561685a8 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -164,6 +164,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|restrictAllowedResources}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef RestrictAllowedResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} [response] RestrictAllowedResourcesResponse + */ + + /** + * Calls RestrictAllowedResources. + * @function restrictAllowedResources + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest} request RestrictAllowedResourcesRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.RestrictAllowedResourcesCallback} callback Node-style callback called with the error, if any, and RestrictAllowedResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.restrictAllowedResources = function restrictAllowedResources(request, callback) { + return this.rpcCall(restrictAllowedResources, $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest, $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse, request, callback); + }, "name", { value: "RestrictAllowedResources" }); + + /** + * Calls RestrictAllowedResources. + * @function restrictAllowedResources + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest} request RestrictAllowedResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|deleteWorkload}. * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService @@ -263,6 +296,105 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|listViolations}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef ListViolationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.ListViolationsResponse} [response] ListViolationsResponse + */ + + /** + * Calls ListViolations. + * @function listViolations + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest} request ListViolationsRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListViolationsCallback} callback Node-style callback called with the error, if any, and ListViolationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.listViolations = function listViolations(request, callback) { + return this.rpcCall(listViolations, $root.google.cloud.assuredworkloads.v1.ListViolationsRequest, $root.google.cloud.assuredworkloads.v1.ListViolationsResponse, request, callback); + }, "name", { value: "ListViolations" }); + + /** + * Calls ListViolations. + * @function listViolations + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest} request ListViolationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|getViolation}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef GetViolationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.Violation} [response] Violation + */ + + /** + * Calls GetViolation. + * @function getViolation + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest} request GetViolationRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetViolationCallback} callback Node-style callback called with the error, if any, and Violation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.getViolation = function getViolation(request, callback) { + return this.rpcCall(getViolation, $root.google.cloud.assuredworkloads.v1.GetViolationRequest, $root.google.cloud.assuredworkloads.v1.Violation, request, callback); + }, "name", { value: "GetViolation" }); + + /** + * Calls GetViolation. + * @function getViolation + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest} request GetViolationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.assuredworkloads.v1.AssuredWorkloadsService|acknowledgeViolation}. + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @typedef AcknowledgeViolationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} [response] AcknowledgeViolationResponse + */ + + /** + * Calls AcknowledgeViolation. + * @function acknowledgeViolation + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest} request AcknowledgeViolationRequest message or plain object + * @param {google.cloud.assuredworkloads.v1.AssuredWorkloadsService.AcknowledgeViolationCallback} callback Node-style callback called with the error, if any, and AcknowledgeViolationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssuredWorkloadsService.prototype.acknowledgeViolation = function acknowledgeViolation(request, callback) { + return this.rpcCall(acknowledgeViolation, $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest, $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse, request, callback); + }, "name", { value: "AcknowledgeViolation" }); + + /** + * Calls AcknowledgeViolation. + * @function acknowledgeViolation + * @memberof google.cloud.assuredworkloads.v1.AssuredWorkloadsService + * @instance + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest} request AcknowledgeViolationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return AssuredWorkloadsService; })(); @@ -1729,6 +1861,8 @@ * @property {google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState|null} [kajEnrollmentState] Workload kajEnrollmentState * @property {boolean|null} [enableSovereignControls] Workload enableSovereignControls * @property {google.cloud.assuredworkloads.v1.Workload.ISaaEnrollmentResponse|null} [saaEnrollmentResponse] Workload saaEnrollmentResponse + * @property {Array.|null} [compliantButDisallowedServices] Workload compliantButDisallowedServices + * @property {google.cloud.assuredworkloads.v1.Workload.Partner|null} [partner] Workload partner */ /** @@ -1743,6 +1877,7 @@ this.resources = []; this.labels = {}; this.resourceSettings = []; + this.compliantButDisallowedServices = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1861,6 +1996,22 @@ */ Workload.prototype.saaEnrollmentResponse = null; + /** + * Workload compliantButDisallowedServices. + * @member {Array.} compliantButDisallowedServices + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.compliantButDisallowedServices = $util.emptyArray; + + /** + * Workload partner. + * @member {google.cloud.assuredworkloads.v1.Workload.Partner} partner + * @memberof google.cloud.assuredworkloads.v1.Workload + * @instance + */ + Workload.prototype.partner = 0; + /** * Creates a new Workload instance using the specified properties. * @function create @@ -1916,6 +2067,11 @@ writer.uint32(/* id 18, wireType 0 =*/144).bool(message.enableSovereignControls); if (message.saaEnrollmentResponse != null && Object.hasOwnProperty.call(message, "saaEnrollmentResponse")) $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.encode(message.saaEnrollmentResponse, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.compliantButDisallowedServices != null && message.compliantButDisallowedServices.length) + for (var i = 0; i < message.compliantButDisallowedServices.length; ++i) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.compliantButDisallowedServices[i]); + if (message.partner != null && Object.hasOwnProperty.call(message, "partner")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.partner); return writer; }; @@ -2029,6 +2185,16 @@ message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.decode(reader, reader.uint32()); break; } + case 24: { + if (!(message.compliantButDisallowedServices && message.compliantButDisallowedServices.length)) + message.compliantButDisallowedServices = []; + message.compliantButDisallowedServices.push(reader.string()); + break; + } + case 25: { + message.partner = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2094,6 +2260,7 @@ case 8: case 9: case 10: + case 12: break; } if (message.createTime != null && message.hasOwnProperty("createTime")) { @@ -2149,6 +2316,21 @@ if (error) return "saaEnrollmentResponse." + error; } + if (message.compliantButDisallowedServices != null && message.hasOwnProperty("compliantButDisallowedServices")) { + if (!Array.isArray(message.compliantButDisallowedServices)) + return "compliantButDisallowedServices: array expected"; + for (var i = 0; i < message.compliantButDisallowedServices.length; ++i) + if (!$util.isString(message.compliantButDisallowedServices[i])) + return "compliantButDisallowedServices: string[] expected"; + } + if (message.partner != null && message.hasOwnProperty("partner")) + switch (message.partner) { + default: + return "partner: enum value expected"; + case 0: + case 1: + break; + } return null; }; @@ -2223,6 +2405,10 @@ case 10: message.complianceRegime = 10; break; + case "ASSURED_WORKLOADS_FOR_PARTNERS": + case 12: + message.complianceRegime = 12; + break; } if (object.createTime != null) { if (typeof object.createTime !== "object") @@ -2278,6 +2464,23 @@ throw TypeError(".google.cloud.assuredworkloads.v1.Workload.saaEnrollmentResponse: object expected"); message.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.fromObject(object.saaEnrollmentResponse); } + if (object.compliantButDisallowedServices) { + if (!Array.isArray(object.compliantButDisallowedServices)) + throw TypeError(".google.cloud.assuredworkloads.v1.Workload.compliantButDisallowedServices: array expected"); + message.compliantButDisallowedServices = []; + for (var i = 0; i < object.compliantButDisallowedServices.length; ++i) + message.compliantButDisallowedServices[i] = String(object.compliantButDisallowedServices[i]); + } + switch (object.partner) { + case "PARTNER_UNSPECIFIED": + case 0: + message.partner = 0; + break; + case "LOCAL_CONTROLS_BY_S3NS": + case 1: + message.partner = 1; + break; + } return message; }; @@ -2297,6 +2500,7 @@ if (options.arrays || options.defaults) { object.resources = []; object.resourceSettings = []; + object.compliantButDisallowedServices = []; } if (options.objects || options.defaults) object.labels = {}; @@ -2312,6 +2516,7 @@ object.kajEnrollmentState = options.enums === String ? "KAJ_ENROLLMENT_STATE_UNSPECIFIED" : 0; object.enableSovereignControls = false; object.saaEnrollmentResponse = null; + object.partner = options.enums === String ? "PARTNER_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2351,6 +2556,13 @@ object.enableSovereignControls = message.enableSovereignControls; if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) object.saaEnrollmentResponse = $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.toObject(message.saaEnrollmentResponse, options); + if (message.compliantButDisallowedServices && message.compliantButDisallowedServices.length) { + object.compliantButDisallowedServices = []; + for (var j = 0; j < message.compliantButDisallowedServices.length; ++j) + object.compliantButDisallowedServices[j] = message.compliantButDisallowedServices[j]; + } + if (message.partner != null && message.hasOwnProperty("partner")) + object.partner = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.Partner[message.partner] : message.partner; return object; }; @@ -2535,6 +2747,7 @@ return "resourceType: enum value expected"; case 0: case 1: + case 4: case 2: case 3: break; @@ -2572,6 +2785,10 @@ case 1: message.resourceType = 1; break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; case "ENCRYPTION_KEYS_PROJECT": case 2: message.resourceType = 2; @@ -2647,6 +2864,7 @@ * @enum {number} * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value * @property {number} CONSUMER_PROJECT=1 CONSUMER_PROJECT value + * @property {number} CONSUMER_FOLDER=4 CONSUMER_FOLDER value * @property {number} ENCRYPTION_KEYS_PROJECT=2 ENCRYPTION_KEYS_PROJECT value * @property {number} KEYRING=3 KEYRING value */ @@ -2654,6 +2872,7 @@ var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "CONSUMER_PROJECT"] = 1; + values[valuesById[4] = "CONSUMER_FOLDER"] = 4; values[valuesById[2] = "ENCRYPTION_KEYS_PROJECT"] = 2; values[valuesById[3] = "KEYRING"] = 3; return values; @@ -2662,6 +2881,40 @@ return ResourceInfo; })(); + /** + * ComplianceRegime enum. + * @name google.cloud.assuredworkloads.v1.Workload.ComplianceRegime + * @enum {number} + * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value + * @property {number} IL4=1 IL4 value + * @property {number} CJIS=2 CJIS value + * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value + * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value + * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value + * @property {number} HIPAA=6 HIPAA value + * @property {number} HITRUST=7 HITRUST value + * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value + * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value + * @property {number} ITAR=10 ITAR value + * @property {number} ASSURED_WORKLOADS_FOR_PARTNERS=12 ASSURED_WORKLOADS_FOR_PARTNERS value + */ + Workload.ComplianceRegime = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; + values[valuesById[1] = "IL4"] = 1; + values[valuesById[2] = "CJIS"] = 2; + values[valuesById[3] = "FEDRAMP_HIGH"] = 3; + values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; + values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; + values[valuesById[6] = "HIPAA"] = 6; + values[valuesById[7] = "HITRUST"] = 7; + values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; + values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; + values[valuesById[10] = "ITAR"] = 10; + values[valuesById[12] = "ASSURED_WORKLOADS_FOR_PARTNERS"] = 12; + return values; + })(); + Workload.KMSSettings = (function() { /** @@ -3069,6 +3322,7 @@ return "resourceType: enum value expected"; case 0: case 1: + case 4: case 2: case 3: break; @@ -3102,6 +3356,10 @@ case 1: message.resourceType = 1; break; + case "CONSUMER_FOLDER": + case 4: + message.resourceType = 4; + break; case "ENCRYPTION_KEYS_PROJECT": case 2: message.resourceType = 2; @@ -3172,6 +3430,22 @@ return ResourceSettings; })(); + /** + * KajEnrollmentState enum. + * @name google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState + * @enum {number} + * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value + * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value + * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + */ + Workload.KajEnrollmentState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; + values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; + return values; + })(); + Workload.SaaEnrollmentResponse = (function() { /** @@ -3526,50 +3800,16 @@ })(); /** - * ComplianceRegime enum. - * @name google.cloud.assuredworkloads.v1.Workload.ComplianceRegime - * @enum {number} - * @property {number} COMPLIANCE_REGIME_UNSPECIFIED=0 COMPLIANCE_REGIME_UNSPECIFIED value - * @property {number} IL4=1 IL4 value - * @property {number} CJIS=2 CJIS value - * @property {number} FEDRAMP_HIGH=3 FEDRAMP_HIGH value - * @property {number} FEDRAMP_MODERATE=4 FEDRAMP_MODERATE value - * @property {number} US_REGIONAL_ACCESS=5 US_REGIONAL_ACCESS value - * @property {number} HIPAA=6 HIPAA value - * @property {number} HITRUST=7 HITRUST value - * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value - * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value - * @property {number} ITAR=10 ITAR value - */ - Workload.ComplianceRegime = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPLIANCE_REGIME_UNSPECIFIED"] = 0; - values[valuesById[1] = "IL4"] = 1; - values[valuesById[2] = "CJIS"] = 2; - values[valuesById[3] = "FEDRAMP_HIGH"] = 3; - values[valuesById[4] = "FEDRAMP_MODERATE"] = 4; - values[valuesById[5] = "US_REGIONAL_ACCESS"] = 5; - values[valuesById[6] = "HIPAA"] = 6; - values[valuesById[7] = "HITRUST"] = 7; - values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; - values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; - values[valuesById[10] = "ITAR"] = 10; - return values; - })(); - - /** - * KajEnrollmentState enum. - * @name google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState + * Partner enum. + * @name google.cloud.assuredworkloads.v1.Workload.Partner * @enum {number} - * @property {number} KAJ_ENROLLMENT_STATE_UNSPECIFIED=0 KAJ_ENROLLMENT_STATE_UNSPECIFIED value - * @property {number} KAJ_ENROLLMENT_STATE_PENDING=1 KAJ_ENROLLMENT_STATE_PENDING value - * @property {number} KAJ_ENROLLMENT_STATE_COMPLETE=2 KAJ_ENROLLMENT_STATE_COMPLETE value + * @property {number} PARTNER_UNSPECIFIED=0 PARTNER_UNSPECIFIED value + * @property {number} LOCAL_CONTROLS_BY_S3NS=1 LOCAL_CONTROLS_BY_S3NS value */ - Workload.KajEnrollmentState = (function() { + Workload.Partner = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KAJ_ENROLLMENT_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "KAJ_ENROLLMENT_STATE_PENDING"] = 1; - values[valuesById[2] = "KAJ_ENROLLMENT_STATE_COMPLETE"] = 2; + values[valuesById[0] = "PARTNER_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOCAL_CONTROLS_BY_S3NS"] = 1; return values; })(); @@ -3778,6 +4018,7 @@ case 8: case 9: case 10: + case 12: break; } return null; @@ -3849,6 +4090,10 @@ case 10: message.complianceRegime = 10; break; + case "ASSURED_WORKLOADS_FOR_PARTNERS": + case 12: + message.complianceRegime = 12; + break; } return message; }; @@ -3912,6 +4157,3575 @@ return CreateWorkloadOperationMetadata; })(); + v1.RestrictAllowedResourcesRequest = (function() { + + /** + * Properties of a RestrictAllowedResourcesRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IRestrictAllowedResourcesRequest + * @property {string|null} [name] RestrictAllowedResourcesRequest name + * @property {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType|null} [restrictionType] RestrictAllowedResourcesRequest restrictionType + */ + + /** + * Constructs a new RestrictAllowedResourcesRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a RestrictAllowedResourcesRequest. + * @implements IRestrictAllowedResourcesRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest=} [properties] Properties to set + */ + function RestrictAllowedResourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestrictAllowedResourcesRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @instance + */ + RestrictAllowedResourcesRequest.prototype.name = ""; + + /** + * RestrictAllowedResourcesRequest restrictionType. + * @member {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType} restrictionType + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @instance + */ + RestrictAllowedResourcesRequest.prototype.restrictionType = 0; + + /** + * Creates a new RestrictAllowedResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest instance + */ + RestrictAllowedResourcesRequest.create = function create(properties) { + return new RestrictAllowedResourcesRequest(properties); + }; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictAllowedResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.restrictionType != null && Object.hasOwnProperty.call(message, "restrictionType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.restrictionType); + return writer; + }; + + /** + * Encodes the specified RestrictAllowedResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictAllowedResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictAllowedResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.restrictionType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestrictAllowedResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictAllowedResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestrictAllowedResourcesRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestrictAllowedResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + switch (message.restrictionType) { + default: + return "restrictionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RestrictAllowedResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} RestrictAllowedResourcesRequest + */ + RestrictAllowedResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.restrictionType) { + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.restrictionType = 0; + break; + case "ALLOW_ALL_GCP_RESOURCES": + case 1: + message.restrictionType = 1; + break; + case "ALLOW_COMPLIANT_RESOURCES": + case 2: + message.restrictionType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RestrictAllowedResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest} message RestrictAllowedResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestrictAllowedResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.restrictionType = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) + object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; + return object; + }; + + /** + * Converts this RestrictAllowedResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + RestrictAllowedResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestrictAllowedResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest"; + }; + + /** + * RestrictionType enum. + * @name google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType + * @enum {number} + * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value + * @property {number} ALLOW_ALL_GCP_RESOURCES=1 ALLOW_ALL_GCP_RESOURCES value + * @property {number} ALLOW_COMPLIANT_RESOURCES=2 ALLOW_COMPLIANT_RESOURCES value + */ + RestrictAllowedResourcesRequest.RestrictionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW_ALL_GCP_RESOURCES"] = 1; + values[valuesById[2] = "ALLOW_COMPLIANT_RESOURCES"] = 2; + return values; + })(); + + return RestrictAllowedResourcesRequest; + })(); + + v1.RestrictAllowedResourcesResponse = (function() { + + /** + * Properties of a RestrictAllowedResourcesResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IRestrictAllowedResourcesResponse + */ + + /** + * Constructs a new RestrictAllowedResourcesResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a RestrictAllowedResourcesResponse. + * @implements IRestrictAllowedResourcesResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse=} [properties] Properties to set + */ + function RestrictAllowedResourcesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RestrictAllowedResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse instance + */ + RestrictAllowedResourcesResponse.create = function create(properties) { + return new RestrictAllowedResourcesResponse(properties); + }; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictAllowedResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestrictAllowedResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestrictAllowedResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictAllowedResourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestrictAllowedResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestrictAllowedResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestrictAllowedResourcesResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestrictAllowedResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestrictAllowedResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} RestrictAllowedResourcesResponse + */ + RestrictAllowedResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) + return object; + return new $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse(); + }; + + /** + * Creates a plain object from a RestrictAllowedResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse} message RestrictAllowedResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestrictAllowedResourcesResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestrictAllowedResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + RestrictAllowedResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestrictAllowedResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestrictAllowedResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse"; + }; + + return RestrictAllowedResourcesResponse; + })(); + + v1.AcknowledgeViolationRequest = (function() { + + /** + * Properties of an AcknowledgeViolationRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IAcknowledgeViolationRequest + * @property {string|null} [name] AcknowledgeViolationRequest name + * @property {string|null} [comment] AcknowledgeViolationRequest comment + * @property {string|null} [nonCompliantOrgPolicy] AcknowledgeViolationRequest nonCompliantOrgPolicy + */ + + /** + * Constructs a new AcknowledgeViolationRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents an AcknowledgeViolationRequest. + * @implements IAcknowledgeViolationRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest=} [properties] Properties to set + */ + function AcknowledgeViolationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcknowledgeViolationRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @instance + */ + AcknowledgeViolationRequest.prototype.name = ""; + + /** + * AcknowledgeViolationRequest comment. + * @member {string} comment + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @instance + */ + AcknowledgeViolationRequest.prototype.comment = ""; + + /** + * AcknowledgeViolationRequest nonCompliantOrgPolicy. + * @member {string} nonCompliantOrgPolicy + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @instance + */ + AcknowledgeViolationRequest.prototype.nonCompliantOrgPolicy = ""; + + /** + * Creates a new AcknowledgeViolationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} AcknowledgeViolationRequest instance + */ + AcknowledgeViolationRequest.create = function create(properties) { + return new AcknowledgeViolationRequest(properties); + }; + + /** + * Encodes the specified AcknowledgeViolationRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest} message AcknowledgeViolationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeViolationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.comment); + if (message.nonCompliantOrgPolicy != null && Object.hasOwnProperty.call(message, "nonCompliantOrgPolicy")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nonCompliantOrgPolicy); + return writer; + }; + + /** + * Encodes the specified AcknowledgeViolationRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest} message AcknowledgeViolationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeViolationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeViolationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} AcknowledgeViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeViolationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.comment = reader.string(); + break; + } + case 3: { + message.nonCompliantOrgPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeViolationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} AcknowledgeViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeViolationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeViolationRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeViolationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + if (message.nonCompliantOrgPolicy != null && message.hasOwnProperty("nonCompliantOrgPolicy")) + if (!$util.isString(message.nonCompliantOrgPolicy)) + return "nonCompliantOrgPolicy: string expected"; + return null; + }; + + /** + * Creates an AcknowledgeViolationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} AcknowledgeViolationRequest + */ + AcknowledgeViolationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.comment != null) + message.comment = String(object.comment); + if (object.nonCompliantOrgPolicy != null) + message.nonCompliantOrgPolicy = String(object.nonCompliantOrgPolicy); + return message; + }; + + /** + * Creates a plain object from an AcknowledgeViolationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest} message AcknowledgeViolationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeViolationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.comment = ""; + object.nonCompliantOrgPolicy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + if (message.nonCompliantOrgPolicy != null && message.hasOwnProperty("nonCompliantOrgPolicy")) + object.nonCompliantOrgPolicy = message.nonCompliantOrgPolicy; + return object; + }; + + /** + * Converts this AcknowledgeViolationRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeViolationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeViolationRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeViolationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest"; + }; + + return AcknowledgeViolationRequest; + })(); + + v1.AcknowledgeViolationResponse = (function() { + + /** + * Properties of an AcknowledgeViolationResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IAcknowledgeViolationResponse + */ + + /** + * Constructs a new AcknowledgeViolationResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents an AcknowledgeViolationResponse. + * @implements IAcknowledgeViolationResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse=} [properties] Properties to set + */ + function AcknowledgeViolationResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new AcknowledgeViolationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} AcknowledgeViolationResponse instance + */ + AcknowledgeViolationResponse.create = function create(properties) { + return new AcknowledgeViolationResponse(properties); + }; + + /** + * Encodes the specified AcknowledgeViolationResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse} message AcknowledgeViolationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeViolationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AcknowledgeViolationResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse} message AcknowledgeViolationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcknowledgeViolationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcknowledgeViolationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} AcknowledgeViolationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeViolationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcknowledgeViolationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} AcknowledgeViolationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcknowledgeViolationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcknowledgeViolationResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcknowledgeViolationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AcknowledgeViolationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} AcknowledgeViolationResponse + */ + AcknowledgeViolationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) + return object; + return new $root.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse(); + }; + + /** + * Creates a plain object from an AcknowledgeViolationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse} message AcknowledgeViolationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcknowledgeViolationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AcknowledgeViolationResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @instance + * @returns {Object.} JSON object + */ + AcknowledgeViolationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcknowledgeViolationResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcknowledgeViolationResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse"; + }; + + return AcknowledgeViolationResponse; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.assuredworkloads.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.assuredworkloads.v1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {google.cloud.assuredworkloads.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.assuredworkloads.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {google.cloud.assuredworkloads.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {google.cloud.assuredworkloads.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.TimeWindow) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {google.cloud.assuredworkloads.v1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.TimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.TimeWindow"; + }; + + return TimeWindow; + })(); + + v1.ListViolationsRequest = (function() { + + /** + * Properties of a ListViolationsRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IListViolationsRequest + * @property {string|null} [parent] ListViolationsRequest parent + * @property {google.cloud.assuredworkloads.v1.ITimeWindow|null} [interval] ListViolationsRequest interval + * @property {number|null} [pageSize] ListViolationsRequest pageSize + * @property {string|null} [pageToken] ListViolationsRequest pageToken + * @property {string|null} [filter] ListViolationsRequest filter + */ + + /** + * Constructs a new ListViolationsRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a ListViolationsRequest. + * @implements IListViolationsRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest=} [properties] Properties to set + */ + function ListViolationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListViolationsRequest parent. + * @member {string} parent + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + */ + ListViolationsRequest.prototype.parent = ""; + + /** + * ListViolationsRequest interval. + * @member {google.cloud.assuredworkloads.v1.ITimeWindow|null|undefined} interval + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + */ + ListViolationsRequest.prototype.interval = null; + + /** + * ListViolationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + */ + ListViolationsRequest.prototype.pageSize = 0; + + /** + * ListViolationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + */ + ListViolationsRequest.prototype.pageToken = ""; + + /** + * ListViolationsRequest filter. + * @member {string} filter + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + */ + ListViolationsRequest.prototype.filter = ""; + + /** + * Creates a new ListViolationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.ListViolationsRequest} ListViolationsRequest instance + */ + ListViolationsRequest.create = function create(properties) { + return new ListViolationsRequest(properties); + }; + + /** + * Encodes the specified ListViolationsRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest} message ListViolationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViolationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.assuredworkloads.v1.TimeWindow.encode(message.interval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListViolationsRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsRequest} message ListViolationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViolationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListViolationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.ListViolationsRequest} ListViolationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViolationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.ListViolationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.interval = $root.google.cloud.assuredworkloads.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListViolationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.ListViolationsRequest} ListViolationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViolationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListViolationsRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListViolationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.interval != null && message.hasOwnProperty("interval")) { + var error = $root.google.cloud.assuredworkloads.v1.TimeWindow.verify(message.interval); + if (error) + return "interval." + error; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListViolationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.ListViolationsRequest} ListViolationsRequest + */ + ListViolationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.ListViolationsRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.ListViolationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.ListViolationsRequest.interval: object expected"); + message.interval = $root.google.cloud.assuredworkloads.v1.TimeWindow.fromObject(object.interval); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListViolationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {google.cloud.assuredworkloads.v1.ListViolationsRequest} message ListViolationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListViolationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.interval = null; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.interval != null && message.hasOwnProperty("interval")) + object.interval = $root.google.cloud.assuredworkloads.v1.TimeWindow.toObject(message.interval, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListViolationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListViolationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListViolationsRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.ListViolationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListViolationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.ListViolationsRequest"; + }; + + return ListViolationsRequest; + })(); + + v1.ListViolationsResponse = (function() { + + /** + * Properties of a ListViolationsResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IListViolationsResponse + * @property {Array.|null} [violations] ListViolationsResponse violations + * @property {string|null} [nextPageToken] ListViolationsResponse nextPageToken + */ + + /** + * Constructs a new ListViolationsResponse. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a ListViolationsResponse. + * @implements IListViolationsResponse + * @constructor + * @param {google.cloud.assuredworkloads.v1.IListViolationsResponse=} [properties] Properties to set + */ + function ListViolationsResponse(properties) { + this.violations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListViolationsResponse violations. + * @member {Array.} violations + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @instance + */ + ListViolationsResponse.prototype.violations = $util.emptyArray; + + /** + * ListViolationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @instance + */ + ListViolationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListViolationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsResponse=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.ListViolationsResponse} ListViolationsResponse instance + */ + ListViolationsResponse.create = function create(properties) { + return new ListViolationsResponse(properties); + }; + + /** + * Encodes the specified ListViolationsResponse message. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsResponse} message ListViolationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViolationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.violations != null && message.violations.length) + for (var i = 0; i < message.violations.length; ++i) + $root.google.cloud.assuredworkloads.v1.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListViolationsResponse message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.ListViolationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.IListViolationsResponse} message ListViolationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListViolationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListViolationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.ListViolationsResponse} ListViolationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViolationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.ListViolationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.violations && message.violations.length)) + message.violations = []; + message.violations.push($root.google.cloud.assuredworkloads.v1.Violation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListViolationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.ListViolationsResponse} ListViolationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListViolationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListViolationsResponse message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListViolationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.violations != null && message.hasOwnProperty("violations")) { + if (!Array.isArray(message.violations)) + return "violations: array expected"; + for (var i = 0; i < message.violations.length; ++i) { + var error = $root.google.cloud.assuredworkloads.v1.Violation.verify(message.violations[i]); + if (error) + return "violations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListViolationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.ListViolationsResponse} ListViolationsResponse + */ + ListViolationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.ListViolationsResponse) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.ListViolationsResponse(); + if (object.violations) { + if (!Array.isArray(object.violations)) + throw TypeError(".google.cloud.assuredworkloads.v1.ListViolationsResponse.violations: array expected"); + message.violations = []; + for (var i = 0; i < object.violations.length; ++i) { + if (typeof object.violations[i] !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.ListViolationsResponse.violations: object expected"); + message.violations[i] = $root.google.cloud.assuredworkloads.v1.Violation.fromObject(object.violations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListViolationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {google.cloud.assuredworkloads.v1.ListViolationsResponse} message ListViolationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListViolationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.violations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.violations && message.violations.length) { + object.violations = []; + for (var j = 0; j < message.violations.length; ++j) + object.violations[j] = $root.google.cloud.assuredworkloads.v1.Violation.toObject(message.violations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListViolationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListViolationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListViolationsResponse + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.ListViolationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListViolationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.ListViolationsResponse"; + }; + + return ListViolationsResponse; + })(); + + v1.GetViolationRequest = (function() { + + /** + * Properties of a GetViolationRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IGetViolationRequest + * @property {string|null} [name] GetViolationRequest name + */ + + /** + * Constructs a new GetViolationRequest. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a GetViolationRequest. + * @implements IGetViolationRequest + * @constructor + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest=} [properties] Properties to set + */ + function GetViolationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetViolationRequest name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @instance + */ + GetViolationRequest.prototype.name = ""; + + /** + * Creates a new GetViolationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.GetViolationRequest} GetViolationRequest instance + */ + GetViolationRequest.create = function create(properties) { + return new GetViolationRequest(properties); + }; + + /** + * Encodes the specified GetViolationRequest message. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetViolationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest} message GetViolationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetViolationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetViolationRequest message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.GetViolationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.IGetViolationRequest} message GetViolationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetViolationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetViolationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.GetViolationRequest} GetViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetViolationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.GetViolationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetViolationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.GetViolationRequest} GetViolationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetViolationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetViolationRequest message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetViolationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetViolationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.GetViolationRequest} GetViolationRequest + */ + GetViolationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.GetViolationRequest) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.GetViolationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetViolationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {google.cloud.assuredworkloads.v1.GetViolationRequest} message GetViolationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetViolationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetViolationRequest to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @instance + * @returns {Object.} JSON object + */ + GetViolationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetViolationRequest + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.GetViolationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetViolationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.GetViolationRequest"; + }; + + return GetViolationRequest; + })(); + + v1.Violation = (function() { + + /** + * Properties of a Violation. + * @memberof google.cloud.assuredworkloads.v1 + * @interface IViolation + * @property {string|null} [name] Violation name + * @property {string|null} [description] Violation description + * @property {google.protobuf.ITimestamp|null} [beginTime] Violation beginTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Violation updateTime + * @property {google.protobuf.ITimestamp|null} [resolveTime] Violation resolveTime + * @property {string|null} [category] Violation category + * @property {google.cloud.assuredworkloads.v1.Violation.State|null} [state] Violation state + * @property {string|null} [orgPolicyConstraint] Violation orgPolicyConstraint + * @property {string|null} [auditLogLink] Violation auditLogLink + * @property {string|null} [nonCompliantOrgPolicy] Violation nonCompliantOrgPolicy + * @property {google.cloud.assuredworkloads.v1.Violation.IRemediation|null} [remediation] Violation remediation + * @property {boolean|null} [acknowledged] Violation acknowledged + * @property {google.protobuf.ITimestamp|null} [acknowledgementTime] Violation acknowledgementTime + */ + + /** + * Constructs a new Violation. + * @memberof google.cloud.assuredworkloads.v1 + * @classdesc Represents a Violation. + * @implements IViolation + * @constructor + * @param {google.cloud.assuredworkloads.v1.IViolation=} [properties] Properties to set + */ + function Violation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Violation name. + * @member {string} name + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.name = ""; + + /** + * Violation description. + * @member {string} description + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.description = ""; + + /** + * Violation beginTime. + * @member {google.protobuf.ITimestamp|null|undefined} beginTime + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.beginTime = null; + + /** + * Violation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.updateTime = null; + + /** + * Violation resolveTime. + * @member {google.protobuf.ITimestamp|null|undefined} resolveTime + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.resolveTime = null; + + /** + * Violation category. + * @member {string} category + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.category = ""; + + /** + * Violation state. + * @member {google.cloud.assuredworkloads.v1.Violation.State} state + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.state = 0; + + /** + * Violation orgPolicyConstraint. + * @member {string} orgPolicyConstraint + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.orgPolicyConstraint = ""; + + /** + * Violation auditLogLink. + * @member {string} auditLogLink + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.auditLogLink = ""; + + /** + * Violation nonCompliantOrgPolicy. + * @member {string} nonCompliantOrgPolicy + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.nonCompliantOrgPolicy = ""; + + /** + * Violation remediation. + * @member {google.cloud.assuredworkloads.v1.Violation.IRemediation|null|undefined} remediation + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.remediation = null; + + /** + * Violation acknowledged. + * @member {boolean} acknowledged + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.acknowledged = false; + + /** + * Violation acknowledgementTime. + * @member {google.protobuf.ITimestamp|null|undefined} acknowledgementTime + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.acknowledgementTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Violation _acknowledgementTime. + * @member {"acknowledgementTime"|undefined} _acknowledgementTime + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Object.defineProperty(Violation.prototype, "_acknowledgementTime", { + get: $util.oneOfGetter($oneOfFields = ["acknowledgementTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Violation instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {google.cloud.assuredworkloads.v1.IViolation=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Violation} Violation instance + */ + Violation.create = function create(properties) { + return new Violation(properties); + }; + + /** + * Encodes the specified Violation message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {google.cloud.assuredworkloads.v1.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.beginTime != null && Object.hasOwnProperty.call(message, "beginTime")) + $root.google.protobuf.Timestamp.encode(message.beginTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resolveTime != null && Object.hasOwnProperty.call(message, "resolveTime")) + $root.google.protobuf.Timestamp.encode(message.resolveTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.category); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.orgPolicyConstraint != null && Object.hasOwnProperty.call(message, "orgPolicyConstraint")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.orgPolicyConstraint); + if (message.auditLogLink != null && Object.hasOwnProperty.call(message, "auditLogLink")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.auditLogLink); + if (message.nonCompliantOrgPolicy != null && Object.hasOwnProperty.call(message, "nonCompliantOrgPolicy")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.nonCompliantOrgPolicy); + if (message.remediation != null && Object.hasOwnProperty.call(message, "remediation")) + $root.google.cloud.assuredworkloads.v1.Violation.Remediation.encode(message.remediation, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.acknowledged != null && Object.hasOwnProperty.call(message, "acknowledged")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.acknowledged); + if (message.acknowledgementTime != null && Object.hasOwnProperty.call(message, "acknowledgementTime")) + $root.google.protobuf.Timestamp.encode(message.acknowledgementTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Violation message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {google.cloud.assuredworkloads.v1.IViolation} message Violation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Violation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Violation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Violation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.beginTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.resolveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.category = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.orgPolicyConstraint = reader.string(); + break; + } + case 11: { + message.auditLogLink = reader.string(); + break; + } + case 12: { + message.nonCompliantOrgPolicy = reader.string(); + break; + } + case 13: { + message.remediation = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.decode(reader, reader.uint32()); + break; + } + case 14: { + message.acknowledged = reader.bool(); + break; + } + case 15: { + message.acknowledgementTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Violation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Violation} Violation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Violation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Violation message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Violation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.beginTime != null && message.hasOwnProperty("beginTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.beginTime); + if (error) + return "beginTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.resolveTime != null && message.hasOwnProperty("resolveTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.resolveTime); + if (error) + return "resolveTime." + error; + } + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 2: + case 3: + case 4: + break; + } + if (message.orgPolicyConstraint != null && message.hasOwnProperty("orgPolicyConstraint")) + if (!$util.isString(message.orgPolicyConstraint)) + return "orgPolicyConstraint: string expected"; + if (message.auditLogLink != null && message.hasOwnProperty("auditLogLink")) + if (!$util.isString(message.auditLogLink)) + return "auditLogLink: string expected"; + if (message.nonCompliantOrgPolicy != null && message.hasOwnProperty("nonCompliantOrgPolicy")) + if (!$util.isString(message.nonCompliantOrgPolicy)) + return "nonCompliantOrgPolicy: string expected"; + if (message.remediation != null && message.hasOwnProperty("remediation")) { + var error = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.verify(message.remediation); + if (error) + return "remediation." + error; + } + if (message.acknowledged != null && message.hasOwnProperty("acknowledged")) + if (typeof message.acknowledged !== "boolean") + return "acknowledged: boolean expected"; + if (message.acknowledgementTime != null && message.hasOwnProperty("acknowledgementTime")) { + properties._acknowledgementTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.acknowledgementTime); + if (error) + return "acknowledgementTime." + error; + } + } + return null; + }; + + /** + * Creates a Violation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Violation} Violation + */ + Violation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Violation) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Violation(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.beginTime != null) { + if (typeof object.beginTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.beginTime: object expected"); + message.beginTime = $root.google.protobuf.Timestamp.fromObject(object.beginTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.resolveTime != null) { + if (typeof object.resolveTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.resolveTime: object expected"); + message.resolveTime = $root.google.protobuf.Timestamp.fromObject(object.resolveTime); + } + if (object.category != null) + message.category = String(object.category); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RESOLVED": + case 2: + message.state = 2; + break; + case "UNRESOLVED": + case 3: + message.state = 3; + break; + case "EXCEPTION": + case 4: + message.state = 4; + break; + } + if (object.orgPolicyConstraint != null) + message.orgPolicyConstraint = String(object.orgPolicyConstraint); + if (object.auditLogLink != null) + message.auditLogLink = String(object.auditLogLink); + if (object.nonCompliantOrgPolicy != null) + message.nonCompliantOrgPolicy = String(object.nonCompliantOrgPolicy); + if (object.remediation != null) { + if (typeof object.remediation !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.remediation: object expected"); + message.remediation = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.fromObject(object.remediation); + } + if (object.acknowledged != null) + message.acknowledged = Boolean(object.acknowledged); + if (object.acknowledgementTime != null) { + if (typeof object.acknowledgementTime !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.acknowledgementTime: object expected"); + message.acknowledgementTime = $root.google.protobuf.Timestamp.fromObject(object.acknowledgementTime); + } + return message; + }; + + /** + * Creates a plain object from a Violation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {google.cloud.assuredworkloads.v1.Violation} message Violation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Violation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.beginTime = null; + object.updateTime = null; + object.resolveTime = null; + object.category = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.orgPolicyConstraint = ""; + object.auditLogLink = ""; + object.nonCompliantOrgPolicy = ""; + object.remediation = null; + object.acknowledged = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.beginTime != null && message.hasOwnProperty("beginTime")) + object.beginTime = $root.google.protobuf.Timestamp.toObject(message.beginTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.resolveTime != null && message.hasOwnProperty("resolveTime")) + object.resolveTime = $root.google.protobuf.Timestamp.toObject(message.resolveTime, options); + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.State[message.state] : message.state; + if (message.orgPolicyConstraint != null && message.hasOwnProperty("orgPolicyConstraint")) + object.orgPolicyConstraint = message.orgPolicyConstraint; + if (message.auditLogLink != null && message.hasOwnProperty("auditLogLink")) + object.auditLogLink = message.auditLogLink; + if (message.nonCompliantOrgPolicy != null && message.hasOwnProperty("nonCompliantOrgPolicy")) + object.nonCompliantOrgPolicy = message.nonCompliantOrgPolicy; + if (message.remediation != null && message.hasOwnProperty("remediation")) + object.remediation = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.toObject(message.remediation, options); + if (message.acknowledged != null && message.hasOwnProperty("acknowledged")) + object.acknowledged = message.acknowledged; + if (message.acknowledgementTime != null && message.hasOwnProperty("acknowledgementTime")) { + object.acknowledgementTime = $root.google.protobuf.Timestamp.toObject(message.acknowledgementTime, options); + if (options.oneofs) + object._acknowledgementTime = "acknowledgementTime"; + } + return object; + }; + + /** + * Converts this Violation to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + * @returns {Object.} JSON object + */ + Violation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Violation + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Violation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Violation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Violation"; + }; + + /** + * State enum. + * @name google.cloud.assuredworkloads.v1.Violation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} RESOLVED=2 RESOLVED value + * @property {number} UNRESOLVED=3 UNRESOLVED value + * @property {number} EXCEPTION=4 EXCEPTION value + */ + Violation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[2] = "RESOLVED"] = 2; + values[valuesById[3] = "UNRESOLVED"] = 3; + values[valuesById[4] = "EXCEPTION"] = 4; + return values; + })(); + + Violation.Remediation = (function() { + + /** + * Properties of a Remediation. + * @memberof google.cloud.assuredworkloads.v1.Violation + * @interface IRemediation + * @property {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions|null} [instructions] Remediation instructions + * @property {Array.|null} [compliantValues] Remediation compliantValues + * @property {google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType|null} [remediationType] Remediation remediationType + */ + + /** + * Constructs a new Remediation. + * @memberof google.cloud.assuredworkloads.v1.Violation + * @classdesc Represents a Remediation. + * @implements IRemediation + * @constructor + * @param {google.cloud.assuredworkloads.v1.Violation.IRemediation=} [properties] Properties to set + */ + function Remediation(properties) { + this.compliantValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Remediation instructions. + * @member {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions|null|undefined} instructions + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @instance + */ + Remediation.prototype.instructions = null; + + /** + * Remediation compliantValues. + * @member {Array.} compliantValues + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @instance + */ + Remediation.prototype.compliantValues = $util.emptyArray; + + /** + * Remediation remediationType. + * @member {google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType} remediationType + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @instance + */ + Remediation.prototype.remediationType = 0; + + /** + * Creates a new Remediation instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.IRemediation=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation} Remediation instance + */ + Remediation.create = function create(properties) { + return new Remediation(properties); + }; + + /** + * Encodes the specified Remediation message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.IRemediation} message Remediation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remediation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) + $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.encode(message.instructions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.compliantValues != null && message.compliantValues.length) + for (var i = 0; i < message.compliantValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.compliantValues[i]); + if (message.remediationType != null && Object.hasOwnProperty.call(message, "remediationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.remediationType); + return writer; + }; + + /** + * Encodes the specified Remediation message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.IRemediation} message Remediation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Remediation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Remediation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation} Remediation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remediation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.compliantValues && message.compliantValues.length)) + message.compliantValues = []; + message.compliantValues.push(reader.string()); + break; + } + case 3: { + message.remediationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Remediation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation} Remediation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Remediation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Remediation message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Remediation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instructions != null && message.hasOwnProperty("instructions")) { + var error = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.verify(message.instructions); + if (error) + return "instructions." + error; + } + if (message.compliantValues != null && message.hasOwnProperty("compliantValues")) { + if (!Array.isArray(message.compliantValues)) + return "compliantValues: array expected"; + for (var i = 0; i < message.compliantValues.length; ++i) + if (!$util.isString(message.compliantValues[i])) + return "compliantValues: string[] expected"; + } + if (message.remediationType != null && message.hasOwnProperty("remediationType")) + switch (message.remediationType) { + default: + return "remediationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Remediation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation} Remediation + */ + Remediation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Violation.Remediation) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation(); + if (object.instructions != null) { + if (typeof object.instructions !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.instructions: object expected"); + message.instructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.fromObject(object.instructions); + } + if (object.compliantValues) { + if (!Array.isArray(object.compliantValues)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.compliantValues: array expected"); + message.compliantValues = []; + for (var i = 0; i < object.compliantValues.length; ++i) + message.compliantValues[i] = String(object.compliantValues[i]); + } + switch (object.remediationType) { + case "REMEDIATION_TYPE_UNSPECIFIED": + case 0: + message.remediationType = 0; + break; + case "REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION": + case 1: + message.remediationType = 1; + break; + case "REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION": + case 2: + message.remediationType = 2; + break; + case "REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION": + case 3: + message.remediationType = 3; + break; + case "REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION": + case 4: + message.remediationType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Remediation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation} message Remediation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Remediation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.compliantValues = []; + if (options.defaults) { + object.instructions = null; + object.remediationType = options.enums === String ? "REMEDIATION_TYPE_UNSPECIFIED" : 0; + } + if (message.instructions != null && message.hasOwnProperty("instructions")) + object.instructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.toObject(message.instructions, options); + if (message.compliantValues && message.compliantValues.length) { + object.compliantValues = []; + for (var j = 0; j < message.compliantValues.length; ++j) + object.compliantValues[j] = message.compliantValues[j]; + } + if (message.remediationType != null && message.hasOwnProperty("remediationType")) + object.remediationType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType[message.remediationType] : message.remediationType; + return object; + }; + + /** + * Converts this Remediation to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @instance + * @returns {Object.} JSON object + */ + Remediation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Remediation + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Remediation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Violation.Remediation"; + }; + + /** + * RemediationType enum. + * @name google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType + * @enum {number} + * @property {number} REMEDIATION_TYPE_UNSPECIFIED=0 REMEDIATION_TYPE_UNSPECIFIED value + * @property {number} REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION=1 REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION value + * @property {number} REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION=2 REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION value + * @property {number} REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION=3 REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION value + * @property {number} REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION=4 REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION value + */ + Remediation.RemediationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REMEDIATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION"] = 1; + values[valuesById[2] = "REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION"] = 2; + values[valuesById[3] = "REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION"] = 3; + values[valuesById[4] = "REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION"] = 4; + return values; + })(); + + Remediation.Instructions = (function() { + + /** + * Properties of an Instructions. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @interface IInstructions + * @property {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud|null} [gcloudInstructions] Instructions gcloudInstructions + * @property {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole|null} [consoleInstructions] Instructions consoleInstructions + */ + + /** + * Constructs a new Instructions. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation + * @classdesc Represents an Instructions. + * @implements IInstructions + * @constructor + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions=} [properties] Properties to set + */ + function Instructions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instructions gcloudInstructions. + * @member {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud|null|undefined} gcloudInstructions + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @instance + */ + Instructions.prototype.gcloudInstructions = null; + + /** + * Instructions consoleInstructions. + * @member {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole|null|undefined} consoleInstructions + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @instance + */ + Instructions.prototype.consoleInstructions = null; + + /** + * Creates a new Instructions instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} Instructions instance + */ + Instructions.create = function create(properties) { + return new Instructions(properties); + }; + + /** + * Encodes the specified Instructions message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions} message Instructions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instructions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcloudInstructions != null && Object.hasOwnProperty.call(message, "gcloudInstructions")) + $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.encode(message.gcloudInstructions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.consoleInstructions != null && Object.hasOwnProperty.call(message, "consoleInstructions")) + $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.encode(message.consoleInstructions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instructions message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.IInstructions} message Instructions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instructions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instructions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} Instructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instructions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcloudInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.decode(reader, reader.uint32()); + break; + } + case 2: { + message.consoleInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instructions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} Instructions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instructions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instructions message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instructions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcloudInstructions != null && message.hasOwnProperty("gcloudInstructions")) { + var error = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.verify(message.gcloudInstructions); + if (error) + return "gcloudInstructions." + error; + } + if (message.consoleInstructions != null && message.hasOwnProperty("consoleInstructions")) { + var error = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.verify(message.consoleInstructions); + if (error) + return "consoleInstructions." + error; + } + return null; + }; + + /** + * Creates an Instructions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} Instructions + */ + Instructions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions(); + if (object.gcloudInstructions != null) { + if (typeof object.gcloudInstructions !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.gcloudInstructions: object expected"); + message.gcloudInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.fromObject(object.gcloudInstructions); + } + if (object.consoleInstructions != null) { + if (typeof object.consoleInstructions !== "object") + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.consoleInstructions: object expected"); + message.consoleInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.fromObject(object.consoleInstructions); + } + return message; + }; + + /** + * Creates a plain object from an Instructions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions} message Instructions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instructions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcloudInstructions = null; + object.consoleInstructions = null; + } + if (message.gcloudInstructions != null && message.hasOwnProperty("gcloudInstructions")) + object.gcloudInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.toObject(message.gcloudInstructions, options); + if (message.consoleInstructions != null && message.hasOwnProperty("consoleInstructions")) + object.consoleInstructions = $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.toObject(message.consoleInstructions, options); + return object; + }; + + /** + * Converts this Instructions to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @instance + * @returns {Object.} JSON object + */ + Instructions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instructions + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instructions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions"; + }; + + Instructions.Gcloud = (function() { + + /** + * Properties of a Gcloud. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @interface IGcloud + * @property {Array.|null} [gcloudCommands] Gcloud gcloudCommands + * @property {Array.|null} [steps] Gcloud steps + * @property {Array.|null} [additionalLinks] Gcloud additionalLinks + */ + + /** + * Constructs a new Gcloud. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @classdesc Represents a Gcloud. + * @implements IGcloud + * @constructor + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud=} [properties] Properties to set + */ + function Gcloud(properties) { + this.gcloudCommands = []; + this.steps = []; + this.additionalLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Gcloud gcloudCommands. + * @member {Array.} gcloudCommands + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @instance + */ + Gcloud.prototype.gcloudCommands = $util.emptyArray; + + /** + * Gcloud steps. + * @member {Array.} steps + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @instance + */ + Gcloud.prototype.steps = $util.emptyArray; + + /** + * Gcloud additionalLinks. + * @member {Array.} additionalLinks + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @instance + */ + Gcloud.prototype.additionalLinks = $util.emptyArray; + + /** + * Creates a new Gcloud instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} Gcloud instance + */ + Gcloud.create = function create(properties) { + return new Gcloud(properties); + }; + + /** + * Encodes the specified Gcloud message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud} message Gcloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcloud.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcloudCommands != null && message.gcloudCommands.length) + for (var i = 0; i < message.gcloudCommands.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcloudCommands[i]); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.steps[i]); + if (message.additionalLinks != null && message.additionalLinks.length) + for (var i = 0; i < message.additionalLinks.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.additionalLinks[i]); + return writer; + }; + + /** + * Encodes the specified Gcloud message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IGcloud} message Gcloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Gcloud.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Gcloud message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} Gcloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcloud.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gcloudCommands && message.gcloudCommands.length)) + message.gcloudCommands = []; + message.gcloudCommands.push(reader.string()); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push(reader.string()); + break; + } + case 3: { + if (!(message.additionalLinks && message.additionalLinks.length)) + message.additionalLinks = []; + message.additionalLinks.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Gcloud message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} Gcloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Gcloud.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Gcloud message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Gcloud.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcloudCommands != null && message.hasOwnProperty("gcloudCommands")) { + if (!Array.isArray(message.gcloudCommands)) + return "gcloudCommands: array expected"; + for (var i = 0; i < message.gcloudCommands.length; ++i) + if (!$util.isString(message.gcloudCommands[i])) + return "gcloudCommands: string[] expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) + if (!$util.isString(message.steps[i])) + return "steps: string[] expected"; + } + if (message.additionalLinks != null && message.hasOwnProperty("additionalLinks")) { + if (!Array.isArray(message.additionalLinks)) + return "additionalLinks: array expected"; + for (var i = 0; i < message.additionalLinks.length; ++i) + if (!$util.isString(message.additionalLinks[i])) + return "additionalLinks: string[] expected"; + } + return null; + }; + + /** + * Creates a Gcloud message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} Gcloud + */ + Gcloud.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud(); + if (object.gcloudCommands) { + if (!Array.isArray(object.gcloudCommands)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.gcloudCommands: array expected"); + message.gcloudCommands = []; + for (var i = 0; i < object.gcloudCommands.length; ++i) + message.gcloudCommands[i] = String(object.gcloudCommands[i]); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) + message.steps[i] = String(object.steps[i]); + } + if (object.additionalLinks) { + if (!Array.isArray(object.additionalLinks)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud.additionalLinks: array expected"); + message.additionalLinks = []; + for (var i = 0; i < object.additionalLinks.length; ++i) + message.additionalLinks[i] = String(object.additionalLinks[i]); + } + return message; + }; + + /** + * Creates a plain object from a Gcloud message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud} message Gcloud + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Gcloud.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gcloudCommands = []; + object.steps = []; + object.additionalLinks = []; + } + if (message.gcloudCommands && message.gcloudCommands.length) { + object.gcloudCommands = []; + for (var j = 0; j < message.gcloudCommands.length; ++j) + object.gcloudCommands[j] = message.gcloudCommands[j]; + } + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = message.steps[j]; + } + if (message.additionalLinks && message.additionalLinks.length) { + object.additionalLinks = []; + for (var j = 0; j < message.additionalLinks.length; ++j) + object.additionalLinks[j] = message.additionalLinks[j]; + } + return object; + }; + + /** + * Converts this Gcloud to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @instance + * @returns {Object.} JSON object + */ + Gcloud.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Gcloud + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Gcloud.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Gcloud"; + }; + + return Gcloud; + })(); + + Instructions.Console = (function() { + + /** + * Properties of a Console. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @interface IConsole + * @property {Array.|null} [consoleUris] Console consoleUris + * @property {Array.|null} [steps] Console steps + * @property {Array.|null} [additionalLinks] Console additionalLinks + */ + + /** + * Constructs a new Console. + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions + * @classdesc Represents a Console. + * @implements IConsole + * @constructor + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole=} [properties] Properties to set + */ + function Console(properties) { + this.consoleUris = []; + this.steps = []; + this.additionalLinks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Console consoleUris. + * @member {Array.} consoleUris + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @instance + */ + Console.prototype.consoleUris = $util.emptyArray; + + /** + * Console steps. + * @member {Array.} steps + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @instance + */ + Console.prototype.steps = $util.emptyArray; + + /** + * Console additionalLinks. + * @member {Array.} additionalLinks + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @instance + */ + Console.prototype.additionalLinks = $util.emptyArray; + + /** + * Creates a new Console instance using the specified properties. + * @function create + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole=} [properties] Properties to set + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} Console instance + */ + Console.create = function create(properties) { + return new Console(properties); + }; + + /** + * Encodes the specified Console message. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.verify|verify} messages. + * @function encode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole} message Console message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Console.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consoleUris != null && message.consoleUris.length) + for (var i = 0; i < message.consoleUris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.consoleUris[i]); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.steps[i]); + if (message.additionalLinks != null && message.additionalLinks.length) + for (var i = 0; i < message.additionalLinks.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.additionalLinks[i]); + return writer; + }; + + /** + * Encodes the specified Console message, length delimited. Does not implicitly {@link google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.IConsole} message Console message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Console.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Console message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} Console + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Console.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.consoleUris && message.consoleUris.length)) + message.consoleUris = []; + message.consoleUris.push(reader.string()); + break; + } + case 2: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push(reader.string()); + break; + } + case 3: { + if (!(message.additionalLinks && message.additionalLinks.length)) + message.additionalLinks = []; + message.additionalLinks.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Console message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} Console + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Console.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Console message. + * @function verify + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Console.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consoleUris != null && message.hasOwnProperty("consoleUris")) { + if (!Array.isArray(message.consoleUris)) + return "consoleUris: array expected"; + for (var i = 0; i < message.consoleUris.length; ++i) + if (!$util.isString(message.consoleUris[i])) + return "consoleUris: string[] expected"; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) + if (!$util.isString(message.steps[i])) + return "steps: string[] expected"; + } + if (message.additionalLinks != null && message.hasOwnProperty("additionalLinks")) { + if (!Array.isArray(message.additionalLinks)) + return "additionalLinks: array expected"; + for (var i = 0; i < message.additionalLinks.length; ++i) + if (!$util.isString(message.additionalLinks[i])) + return "additionalLinks: string[] expected"; + } + return null; + }; + + /** + * Creates a Console message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} Console + */ + Console.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console) + return object; + var message = new $root.google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console(); + if (object.consoleUris) { + if (!Array.isArray(object.consoleUris)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.consoleUris: array expected"); + message.consoleUris = []; + for (var i = 0; i < object.consoleUris.length; ++i) + message.consoleUris[i] = String(object.consoleUris[i]); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) + message.steps[i] = String(object.steps[i]); + } + if (object.additionalLinks) { + if (!Array.isArray(object.additionalLinks)) + throw TypeError(".google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console.additionalLinks: array expected"); + message.additionalLinks = []; + for (var i = 0; i < object.additionalLinks.length; ++i) + message.additionalLinks[i] = String(object.additionalLinks[i]); + } + return message; + }; + + /** + * Creates a plain object from a Console message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console} message Console + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Console.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.consoleUris = []; + object.steps = []; + object.additionalLinks = []; + } + if (message.consoleUris && message.consoleUris.length) { + object.consoleUris = []; + for (var j = 0; j < message.consoleUris.length; ++j) + object.consoleUris[j] = message.consoleUris[j]; + } + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = message.steps[j]; + } + if (message.additionalLinks && message.additionalLinks.length) { + object.additionalLinks = []; + for (var j = 0; j < message.additionalLinks.length; ++j) + object.additionalLinks[j] = message.additionalLinks[j]; + } + return object; + }; + + /** + * Converts this Console to JSON. + * @function toJSON + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @instance + * @returns {Object.} JSON object + */ + Console.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Console + * @function getTypeUrl + * @memberof google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Console.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.assuredworkloads.v1.Violation.Remediation.Instructions.Console"; + }; + + return Console; + })(); + + return Instructions; + })(); + + return Remediation; + })(); + + return Violation; + })(); + return v1; })(); diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index ca76c2e6e61..15959c0d268 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -73,6 +73,22 @@ } ] }, + "RestrictAllowedResources": { + "requestType": "RestrictAllowedResourcesRequest", + "responseType": "RestrictAllowedResourcesResponse", + "options": { + "(google.api.http).post": "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources", + "body": "*" + } + } + ] + }, "DeleteWorkload": { "requestType": "DeleteWorkloadRequest", "responseType": "google.protobuf.Empty", @@ -126,6 +142,34 @@ "(google.api.method_signature)": "parent" } ] + }, + "ListViolations": { + "requestType": "ListViolationsRequest", + "responseType": "ListViolationsResponse", + "options": { + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetViolation": { + "requestType": "GetViolationRequest", + "responseType": "Violation", + "options": { + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.method_signature)": "name" + } + ] + }, + "AcknowledgeViolation": { + "requestType": "AcknowledgeViolationRequest", + "responseType": "AcknowledgeViolationResponse" } } }, @@ -287,7 +331,7 @@ "type": "string", "id": 6, "options": { - "(google.api.field_behavior)": "INPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "etag": { @@ -316,6 +360,7 @@ "type": "KMSSettings", "id": 14, "options": { + "deprecated": true, "(google.api.field_behavior)": "INPUT_ONLY" } }, @@ -347,6 +392,21 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "compliantButDisallowedServices": { + "rule": "repeated", + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "partner": { + "type": "Partner", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -366,13 +426,33 @@ "values": { "RESOURCE_TYPE_UNSPECIFIED": 0, "CONSUMER_PROJECT": 1, + "CONSUMER_FOLDER": 4, "ENCRYPTION_KEYS_PROJECT": 2, "KEYRING": 3 } } } }, + "ComplianceRegime": { + "values": { + "COMPLIANCE_REGIME_UNSPECIFIED": 0, + "IL4": 1, + "CJIS": 2, + "FEDRAMP_HIGH": 3, + "FEDRAMP_MODERATE": 4, + "US_REGIONAL_ACCESS": 5, + "HIPAA": 6, + "HITRUST": 7, + "EU_REGIONS_AND_SUPPORT": 8, + "CA_REGIONS_AND_SUPPORT": 9, + "ITAR": 10, + "ASSURED_WORKLOADS_FOR_PARTNERS": 12 + } + }, "KMSSettings": { + "options": { + "deprecated": true + }, "fields": { "nextRotationTime": { "type": "google.protobuf.Timestamp", @@ -406,6 +486,13 @@ } } }, + "KajEnrollmentState": { + "values": { + "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, + "KAJ_ENROLLMENT_STATE_PENDING": 1, + "KAJ_ENROLLMENT_STATE_COMPLETE": 2 + } + }, "SaaEnrollmentResponse": { "oneofs": { "_setupStatus": { @@ -447,26 +534,10 @@ } } }, - "ComplianceRegime": { - "values": { - "COMPLIANCE_REGIME_UNSPECIFIED": 0, - "IL4": 1, - "CJIS": 2, - "FEDRAMP_HIGH": 3, - "FEDRAMP_MODERATE": 4, - "US_REGIONAL_ACCESS": 5, - "HIPAA": 6, - "HITRUST": 7, - "EU_REGIONS_AND_SUPPORT": 8, - "CA_REGIONS_AND_SUPPORT": 9, - "ITAR": 10 - } - }, - "KajEnrollmentState": { + "Partner": { "values": { - "KAJ_ENROLLMENT_STATE_UNSPECIFIED": 0, - "KAJ_ENROLLMENT_STATE_PENDING": 1, - "KAJ_ENROLLMENT_STATE_COMPLETE": 2 + "PARTNER_UNSPECIFIED": 0, + "LOCAL_CONTROLS_BY_S3NS": 1 } } } @@ -502,6 +573,344 @@ } } } + }, + "RestrictAllowedResourcesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "restrictionType": { + "type": "RestrictionType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RestrictionType": { + "values": { + "RESTRICTION_TYPE_UNSPECIFIED": 0, + "ALLOW_ALL_GCP_RESOURCES": 1, + "ALLOW_COMPLIANT_RESOURCES": 2 + } + } + } + }, + "RestrictAllowedResourcesResponse": { + "fields": {} + }, + "AcknowledgeViolationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "comment": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nonCompliantOrgPolicy": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AcknowledgeViolationResponse": { + "fields": {} + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "ListViolationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "assuredworkloads.googleapis.com/Violation" + } + }, + "interval": { + "type": "TimeWindow", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListViolationsResponse": { + "fields": { + "violations": { + "rule": "repeated", + "type": "Violation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetViolationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "assuredworkloads.googleapis.com/Violation" + } + } + } + }, + "Violation": { + "options": { + "(google.api.resource).type": "assuredworkloads.googleapis.com/Violation", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}" + }, + "oneofs": { + "_acknowledgementTime": { + "oneof": [ + "acknowledgementTime" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "beginTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resolveTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "category": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "orgPolicyConstraint": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "auditLogLink": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "nonCompliantOrgPolicy": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "remediation": { + "type": "Remediation", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "acknowledged": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "acknowledgementTime": { + "type": "google.protobuf.Timestamp", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "RESOLVED": 2, + "UNRESOLVED": 3, + "EXCEPTION": 4 + } + }, + "Remediation": { + "fields": { + "instructions": { + "type": "Instructions", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "compliantValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "remediationType": { + "type": "RemediationType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RemediationType": { + "values": { + "REMEDIATION_TYPE_UNSPECIFIED": 0, + "REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION": 1, + "REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION": 2, + "REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION": 3, + "REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION": 4 + } + }, + "Instructions": { + "fields": { + "gcloudInstructions": { + "type": "Gcloud", + "id": 1 + }, + "consoleInstructions": { + "type": "Console", + "id": 2 + } + }, + "nested": { + "Gcloud": { + "fields": { + "gcloudCommands": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "additionalLinks": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Console": { + "fields": { + "consoleUris": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "steps": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "additionalLinks": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } } } }, diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js new file mode 100644 index 00000000000..a8477d7e8a3 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, comment) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_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. + */ + /** + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + */ + // const name = 'abc123' + /** + * Required. Business justification explaining the need for violation acknowledgement + */ + // const comment = 'abc123' + /** + * Optional. Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + */ + // const nonCompliantOrgPolicy = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callAcknowledgeViolation() { + // Construct request + const request = { + name, + comment, + }; + + // Run request + const response = await assuredworkloadsClient.acknowledgeViolation(request); + console.log(response); + } + + callAcknowledgeViolation(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index b90e3f669a8..60914b5826c 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -38,8 +38,8 @@ function main(parent, workload) { */ // const workload = {} /** - * Optional. A identifier associated with the workload and underlying projects - * which allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js new file mode 100644 index 00000000000..bc59deb1157 --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_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. + */ + /** + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + */ + // const name = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callGetViolation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assuredworkloadsClient.getViolation(request); + console.log(response); + } + + callGetViolation(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index 8b1be84be6f..f222a13cf60 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Workload to fetch. This is the - * workloads's relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js new file mode 100644 index 00000000000..519c31fd0ec --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_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. + */ + /** + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + */ + // const parent = 'abc123' + /** + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + */ + // const interval = {} + /** + * Optional. Page size. + */ + // const pageSize = 1234 + /** + * Optional. Page token returned from previous request. + */ + // const pageToken = 'abc123' + /** + * Optional. A custom filter for filtering by the Violations properties. + */ + // const filter = 'abc123' + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callListViolations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await assuredworkloadsClient.listViolationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListViolations(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js new file mode 100644 index 00000000000..b480dde877f --- /dev/null +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, restrictionType) { + // [START assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_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. + */ + /** + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + */ + // const name = 'abc123' + /** + * Required. The type of restriction for using gcp products in the Workload environment. + */ + // const restrictionType = {} + + // Imports the Assuredworkloads library + const {AssuredWorkloadsServiceClient} = require('@google-cloud/assured-workloads').v1; + + // Instantiates a client + const assuredworkloadsClient = new AssuredWorkloadsServiceClient(); + + async function callRestrictAllowedResources() { + // Construct request + const request = { + name, + restrictionType, + }; + + // Run request + const response = await assuredworkloadsClient.restrictAllowedResources(request); + console.log(response); + } + + callRestrictAllowedResources(); + // [END assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index 02bf9444d64..27da2ba0065 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -30,7 +30,7 @@ function main(workload, updateMask) { */ /** * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. + * The workload's `name` field is used to identify the workload to be updated. * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} */ diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index e8c2e83063b..6f03d5883d5 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -103,6 +103,50 @@ } } }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_async", + "title": "AssuredWorkloadsService restrictAllowedResources Sample", + "origin": "API_DEFINITION", + "description": " Restrict the list of resources allowed in the Workload environment. The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.", + "canonical": true, + "file": "assured_workloads_service.restrict_allowed_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestrictAllowedResources", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.RestrictAllowedResources", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "restriction_type", + "type": ".google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "RestrictAllowedResources", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.RestrictAllowedResources", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, { "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_async", "title": "AssuredWorkloadsService deleteWorkload Sample", @@ -238,6 +282,150 @@ } } } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_async", + "title": "AssuredWorkloadsService listViolations Sample", + "origin": "API_DEFINITION", + "description": " Lists the Violations in the AssuredWorkload Environment. Callers may also choose to read across multiple Workloads as per [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format `organizations/{org_id}/locations/{location}/workloads/-`", + "canonical": true, + "file": "assured_workloads_service.list_violations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListViolations", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListViolations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "interval", + "type": ".google.cloud.assuredworkloads.v1.TimeWindow" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.ListViolationsResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "ListViolations", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.ListViolations", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_async", + "title": "AssuredWorkloadsService getViolation Sample", + "origin": "API_DEFINITION", + "description": " Retrieves Assured Workload Violation based on ID.", + "canonical": true, + "file": "assured_workloads_service.get_violation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetViolation", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetViolation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.Violation", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "GetViolation", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.GetViolation", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } + }, + { + "regionTag": "assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_async", + "title": "AssuredWorkloadsService acknowledgeViolation Sample", + "origin": "API_DEFINITION", + "description": " Acknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.", + "canonical": true, + "file": "assured_workloads_service.acknowledge_violation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcknowledgeViolation", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.AcknowledgeViolation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "comment", + "type": "TYPE_STRING" + }, + { + "name": "non_compliant_org_policy", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse", + "client": { + "shortName": "AssuredWorkloadsServiceClient", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsServiceClient" + }, + "method": { + "shortName": "AcknowledgeViolation", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService.AcknowledgeViolation", + "service": { + "shortName": "AssuredWorkloadsService", + "fullName": "google.cloud.assuredworkloads.v1.AssuredWorkloadsService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 55c884014a9..146118be283 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -185,6 +185,9 @@ export class AssuredWorkloadsServiceClient { organizationPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}' ), + violationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}' + ), workloadPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/workloads/{workload}' ), @@ -199,6 +202,11 @@ export class AssuredWorkloadsServiceClient { 'nextPageToken', 'workloads' ), + listViolations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'violations' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -293,9 +301,13 @@ export class AssuredWorkloadsServiceClient { const assuredWorkloadsServiceStubMethods = [ 'createWorkload', 'updateWorkload', + 'restrictAllowedResources', 'deleteWorkload', 'getWorkload', 'listWorkloads', + 'listViolations', + 'getViolation', + 'acknowledgeViolation', ]; for (const methodName of assuredWorkloadsServiceStubMethods) { const callPromise = this.assuredWorkloadsServiceStub.then( @@ -392,7 +404,7 @@ export class AssuredWorkloadsServiceClient { * The request object that will be sent. * @param {google.cloud.assuredworkloads.v1.Workload} request.workload * Required. The workload to update. - * The workload’s `name` field is used to identify the workload to be updated. + * The workload's `name` field is used to identify the workload to be updated. * Format: * organizations/{org_id}/locations/{location_id}/workloads/{workload_id} * @param {google.protobuf.FieldMask} request.updateMask @@ -487,6 +499,118 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.updateWorkload(request, options, callback); } + /** + * Restrict the list of resources allowed in the Workload environment. + * The current list of allowed products can be found at + * https://cloud.google.com/assured-workloads/docs/supported-products + * In addition to assuredworkloads.workload.update permission, the user should + * also have orgpolicy.policy.set permission on the folder resource + * to use this functionality. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Workload. This is the workloads's + * relative path in the API, formatted as + * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". + * For example, + * "organizations/123/locations/us-east1/workloads/assured-workload-1". + * @param {google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType} request.restrictionType + * Required. The type of restriction for using gcp products in the Workload environment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RestrictAllowedResourcesResponse]{@link google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_async + */ + restrictAllowedResources( + request?: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined + ] + >; + restrictAllowedResources( + request: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedResources( + request: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + restrictAllowedResources( + request?: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.restrictAllowedResources( + request, + options, + callback + ); + } /** * Deletes the workload. Make sure that workload's direct children are already * in a deleted state, otherwise the request will fail with a @@ -597,8 +721,8 @@ export class AssuredWorkloadsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the - * workloads's relative path in the API, formatted as + * Required. The resource name of the Workload to fetch. This is the workloads's + * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, * "organizations/123/locations/us-east1/workloads/assured-workload-1". @@ -686,6 +810,202 @@ export class AssuredWorkloadsServiceClient { this.initialize(); return this.innerApiCalls.getWorkload(request, options, callback); } + /** + * Retrieves Assured Workload Violation based on ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Violation to fetch (ie. Violation.name). + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Violation]{@link google.cloud.assuredworkloads.v1.Violation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.get_violation.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_async + */ + getViolation( + request?: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IViolation, + protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | undefined, + {} | undefined + ] + >; + getViolation( + request: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IViolation, + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getViolation( + request: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IViolation, + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getViolation( + request?: protos.google.cloud.assuredworkloads.v1.IGetViolationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1.IViolation, + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1.IViolation, + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IViolation, + protos.google.cloud.assuredworkloads.v1.IGetViolationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.getViolation(request, options, callback); + } + /** + * Acknowledges an existing violation. By acknowledging a violation, users + * acknowledge the existence of a compliance violation in their workload and + * decide to ignore it due to a valid business justification. Acknowledgement + * is a permanent operation and it cannot be reverted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Violation to acknowledge. + * Format: + * organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation} + * @param {string} request.comment + * Required. Business justification explaining the need for violation acknowledgement + * @param {string} [request.nonCompliantOrgPolicy] + * Optional. Name of the OrgPolicy which was modified with non-compliant change and + * resulted in this violation. + * Format: + * projects/{project_number}/policies/{constraint_name} + * folders/{folder_id}/policies/{constraint_name} + * organizations/{organization_id}/policies/{constraint_name} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AcknowledgeViolationResponse]{@link google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.acknowledge_violation.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_async + */ + acknowledgeViolation( + request?: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | undefined + ), + {} | undefined + ] + >; + acknowledgeViolation( + request: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + acknowledgeViolation( + request: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, + callback: Callback< + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + acknowledgeViolation( + request?: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.acknowledgeViolation(request, options, callback); + } /** * Creates Assured Workload. @@ -698,8 +1018,8 @@ export class AssuredWorkloadsServiceClient { * @param {google.cloud.assuredworkloads.v1.Workload} request.workload * Required. Assured Workload to create * @param {string} [request.externalId] - * Optional. A identifier associated with the workload and underlying projects - * which allows for the break down of billing costs for a workload. The value + * Optional. A identifier associated with the workload and underlying projects which + * allows for the break down of billing costs for a workload. The value * provided for the identifier will add a label to the workload and contained * projects with the identifier as the value. * @param {object} [options] @@ -1040,6 +1360,385 @@ export class AssuredWorkloadsServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists the Violations in the AssuredWorkload Environment. + * Callers may also choose to read across multiple Workloads as per + * [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash + * character) as a wildcard character instead of workload-id in the parent. + * Format `organizations/{org_id}/locations/{location}/workloads/-` + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @param {google.cloud.assuredworkloads.v1.TimeWindow} [request.interval] + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous request. + * @param {string} [request.filter] + * Optional. A custom filter for filtering by the Violations properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Violation]{@link google.cloud.assuredworkloads.v1.Violation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listViolationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listViolations( + request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IViolation[], + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + ] + >; + listViolations( + request: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + | protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IViolation + > + ): void; + listViolations( + request: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + callback: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + | protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IViolation + > + ): void; + listViolations( + request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + | protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IViolation + >, + callback?: PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + | protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IViolation + > + ): Promise< + [ + protos.google.cloud.assuredworkloads.v1.IViolation[], + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + return this.innerApiCalls.listViolations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @param {google.cloud.assuredworkloads.v1.TimeWindow} [request.interval] + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous request. + * @param {string} [request.filter] + * Optional. A custom filter for filtering by the Violations properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Violation]{@link google.cloud.assuredworkloads.v1.Violation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listViolationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listViolationsStream( + request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listViolations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listViolations.createStream( + this.innerApiCalls.listViolations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listViolations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Workload name. + * Format `organizations/{org_id}/locations/{location}/workloads/{workload}`. + * @param {google.cloud.assuredworkloads.v1.TimeWindow} [request.interval] + * Optional. Specifies the time window for retrieving active Violations. + * When specified, retrieves Violations that were active between start_time + * and end_time. + * @param {number} [request.pageSize] + * Optional. Page size. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous request. + * @param {string} [request.filter] + * Optional. A custom filter for filtering by the Violations properties. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Violation]{@link google.cloud.assuredworkloads.v1.Violation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/assured_workloads_service.list_violations.js + * region_tag:assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_async + */ + listViolationsAsync( + request?: protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listViolations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listViolations.asyncIterate( + this.innerApiCalls['listViolations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -1105,6 +1804,77 @@ export class AssuredWorkloadsServiceClient { .organization; } + /** + * Return a fully-qualified violation resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} workload + * @param {string} violation + * @returns {string} Resource name string. + */ + violationPath( + organization: string, + location: string, + workload: string, + violation: string + ) { + return this.pathTemplates.violationPathTemplate.render({ + organization: organization, + location: location, + workload: workload, + violation: violation, + }); + } + + /** + * Parse the organization from Violation resource. + * + * @param {string} violationName + * A fully-qualified path representing Violation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromViolationName(violationName: string) { + return this.pathTemplates.violationPathTemplate.match(violationName) + .organization; + } + + /** + * Parse the location from Violation resource. + * + * @param {string} violationName + * A fully-qualified path representing Violation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromViolationName(violationName: string) { + return this.pathTemplates.violationPathTemplate.match(violationName) + .location; + } + + /** + * Parse the workload from Violation resource. + * + * @param {string} violationName + * A fully-qualified path representing Violation resource. + * @returns {string} A string representing the workload. + */ + matchWorkloadFromViolationName(violationName: string) { + return this.pathTemplates.violationPathTemplate.match(violationName) + .workload; + } + + /** + * Parse the violation from Violation resource. + * + * @param {string} violationName + * A fully-qualified path representing Violation resource. + * @returns {string} A string representing the violation. + */ + matchViolationFromViolationName(violationName: string) { + return this.pathTemplates.violationPathTemplate.match(violationName) + .violation; + } + /** * Return a fully-qualified workload resource name string. * diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json index 7265c2dfa05..9ee0dc24f1d 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client_config.json @@ -30,6 +30,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RestrictAllowedResources": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteWorkload": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -44,6 +49,21 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ListViolations": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetViolation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AcknowledgeViolation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json index 5871c800273..c8a5659f415 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json +++ b/packages/google-cloud-assuredworkloads/src/v1/gapic_metadata.json @@ -15,6 +15,11 @@ "updateWorkload" ] }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, "DeleteWorkload": { "methods": [ "deleteWorkload" @@ -25,6 +30,16 @@ "getWorkload" ] }, + "GetViolation": { + "methods": [ + "getViolation" + ] + }, + "AcknowledgeViolation": { + "methods": [ + "acknowledgeViolation" + ] + }, "CreateWorkload": { "methods": [ "createWorkload" @@ -36,6 +51,13 @@ "listWorkloadsStream", "listWorkloadsAsync" ] + }, + "ListViolations": { + "methods": [ + "listViolations", + "listViolationsStream", + "listViolationsAsync" + ] } } }, @@ -47,6 +69,11 @@ "updateWorkload" ] }, + "RestrictAllowedResources": { + "methods": [ + "restrictAllowedResources" + ] + }, "DeleteWorkload": { "methods": [ "deleteWorkload" @@ -57,6 +84,16 @@ "getWorkload" ] }, + "GetViolation": { + "methods": [ + "getViolation" + ] + }, + "AcknowledgeViolation": { + "methods": [ + "acknowledgeViolation" + ] + }, "CreateWorkload": { "methods": [ "createWorkload" @@ -68,6 +105,13 @@ "listWorkloadsStream", "listWorkloadsAsync" ] + }, + "ListViolations": { + "methods": [ + "listViolations", + "listViolationsStream", + "listViolationsAsync" + ] } } } diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 214ea07d3af..1002d00671f 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -407,6 +407,147 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); }); + describe('restrictAllowedResources', () => { + it('invokes restrictAllowedResources without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse() + ); + client.innerApiCalls.restrictAllowedResources = + stubSimpleCall(expectedResponse); + const [response] = await client.restrictAllowedResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restrictAllowedResources without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse() + ); + client.innerApiCalls.restrictAllowedResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restrictAllowedResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restrictAllowedResources with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restrictAllowedResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.restrictAllowedResources(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restrictAllowedResources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restrictAllowedResources with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.restrictAllowedResources(request), + expectedError + ); + }); + }); + describe('deleteWorkload', () => { it('invokes deleteWorkload without error', async () => { const client = @@ -675,6 +816,181 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); }); + describe('getViolation', () => { + it('invokes getViolation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetViolationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ); + client.innerApiCalls.getViolation = stubSimpleCall(expectedResponse); + const [response] = await client.getViolation(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes getViolation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetViolationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ); + client.innerApiCalls.getViolation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getViolation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IViolation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes getViolation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetViolationRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.getViolation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getViolation(request), expectedError); + }); + + it('invokes getViolation with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.GetViolationRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getViolation(request), expectedError); + }); + }); + + describe('acknowledgeViolation', () => { + it('invokes acknowledgeViolation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse() + ); + client.innerApiCalls.acknowledgeViolation = + stubSimpleCall(expectedResponse); + const [response] = await client.acknowledgeViolation(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes acknowledgeViolation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse() + ); + client.innerApiCalls.acknowledgeViolation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acknowledgeViolation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes acknowledgeViolation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.acknowledgeViolation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.acknowledgeViolation(request), expectedError); + }); + + it('invokes acknowledgeViolation with closed client', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.acknowledgeViolation(request), expectedError); + }); + }); + describe('createWorkload', () => { it('invokes createWorkload without error', async () => { const client = @@ -1210,21 +1526,579 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); }); - describe('Path templates', () => { - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - organization: 'organizationValue', - location: 'locationValue', - }; + describe('listViolations', () => { + it('invokes listViolations without error', async () => { const client = new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + ]; + client.innerApiCalls.listViolations = stubSimpleCall(expectedResponse); + const [response] = await client.listViolations(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listViolations without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + ]; + client.innerApiCalls.listViolations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listViolations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.assuredworkloads.v1.IViolation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listViolations with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listViolations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listViolations(request), expectedError); + }); + + it('invokes listViolationsStream without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + ]; + client.descriptors.page.listViolations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listViolationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1.Violation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1.Violation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listViolations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listViolations, request) + ); + }); + + it('invokes listViolationsStream with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listViolations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listViolationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.assuredworkloads.v1.Violation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.assuredworkloads.v1.Violation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listViolations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listViolations, request) + ); + }); + + it('uses async iteration with listViolations without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.Violation() + ), + ]; + client.descriptors.page.listViolations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.assuredworkloads.v1.IViolation[] = + []; + const iterable = client.listViolationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listViolations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listViolations with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.assuredworkloads.v1.ListViolationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listViolations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listViolationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.assuredworkloads.v1.IViolation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listViolations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + }; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() .returns(fakePath); client.pathTemplates.locationPathTemplate.match = sinon .stub() @@ -1303,6 +2177,83 @@ describe('v1.AssuredWorkloadsServiceClient', () => { }); }); + describe('violation', () => { + const fakePath = '/rendered/path/violation'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + workload: 'workloadValue', + violation: 'violationValue', + }; + const client = + new assuredworkloadsserviceModule.v1.AssuredWorkloadsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.violationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.violationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('violationPath', () => { + const result = client.violationPath( + 'organizationValue', + 'locationValue', + 'workloadValue', + 'violationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.violationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromViolationName', () => { + const result = client.matchOrganizationFromViolationName(fakePath); + assert.strictEqual(result, 'organizationValue'); + assert( + (client.pathTemplates.violationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromViolationName', () => { + const result = client.matchLocationFromViolationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.violationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkloadFromViolationName', () => { + const result = client.matchWorkloadFromViolationName(fakePath); + assert.strictEqual(result, 'workloadValue'); + assert( + (client.pathTemplates.violationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchViolationFromViolationName', () => { + const result = client.matchViolationFromViolationName(fakePath); + assert.strictEqual(result, 'violationValue'); + assert( + (client.pathTemplates.violationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('workload', () => { const fakePath = '/rendered/path/workload'; const expectedParameters = { From 3e6d051dfb55b52af4cc8df60f66149a7249a9bd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:30:27 -0700 Subject: [PATCH 109/116] feat: add new field for exception audit log link (#193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new field for exception audit log link feat: add support of new compliance regime for regions and new partner T systems docs: fix some typos in documentation Deprecated non_compliant_org_policy from AcknowledgeViolationRequest. It has no effect and shouldn't be used. Committer: @viswask PiperOrigin-RevId: 480599318 Source-Link: https://github.com/googleapis/googleapis/commit/7090dbed5f8b2b9f7fcc3fedf16ba17f736e99f3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/94a1322d7678dd93678b9277b0fa59c2de2319e9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTRhMTMyMmQ3Njc4ZGQ5MzY3OGI5Mjc3YjBmYTU5YzJkZTIzMTllOSJ9 * 🦉 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 --- .../v1/assuredworkloads.proto | 36 ++++++++++++++----- .../protos/protos.d.ts | 7 ++++ .../protos/protos.js | 35 ++++++++++++++++++ .../protos/protos.json | 9 +++++ ...workloads_service.acknowledge_violation.js | 3 +- .../assured_workloads_service.get_workload.js | 2 +- ...data.google.cloud.assuredworkloads.v1.json | 2 +- .../v1/assured_workloads_service_client.ts | 5 +-- 8 files changed, 86 insertions(+), 13 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 7068506f612..f6349f35fd5 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -181,7 +181,7 @@ message DeleteWorkloadRequest { // Request for fetching a workload. message GetWorkloadRequest { - // Required. The resource name of the Workload to fetch. This is the workloads's + // Required. The resource name of the Workload to fetch. This is the workload's // relative path in the API, formatted as // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". // For example, @@ -227,7 +227,7 @@ message ListWorkloadsResponse { string next_page_token = 2; } -// An Workload object for managing highly regulated workloads of cloud +// A Workload object for managing highly regulated workloads of cloud // customers. message Workload { option (google.api.resource) = { @@ -302,11 +302,19 @@ message Workload { // International Traffic in Arms Regulations ITAR = 10; - // Assured Workloads for Partners; + // Assured Workloads for Australia Regions and Support controls + // Available for public preview consumption. + // Don't create production workloads. + AU_REGIONS_AND_US_SUPPORT = 11; + + // Assured Workloads for Partners ASSURED_WORKLOADS_FOR_PARTNERS = 12; } // Settings specific to the Key Management Service. + // This message is deprecated. + // In order to create a Keyring, callers should specify, + // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field. message KMSSettings { option deprecated = true; @@ -338,7 +346,7 @@ message Workload { string resource_id = 1; // Indicates the type of resource. This field should be specified to - // correspond the id to the right project type (CONSUMER_PROJECT or + // correspond the id to the right resource type (CONSUMER_FOLDER or // ENCRYPTION_KEYS_PROJECT) ResourceInfo.ResourceType resource_type = 2; @@ -404,10 +412,10 @@ message Workload { // Supported Assured Workloads Partners. enum Partner { - // Unknown compliance regime. + // Unknown partner regime/controls. PARTNER_UNSPECIFIED = 0; - // S3NS regime + // S3NS regime/controls. LOCAL_CONTROLS_BY_S3NS = 1; } @@ -567,13 +575,17 @@ message AcknowledgeViolationRequest { // Required. Business justification explaining the need for violation acknowledgement string comment = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Name of the OrgPolicy which was modified with non-compliant change and + // Optional. This field is deprecated and will be removed in future version of the API. + // Name of the OrgPolicy which was modified with non-compliant change and // resulted in this violation. // Format: // projects/{project_number}/policies/{constraint_name} // folders/{folder_id}/policies/{constraint_name} // organizations/{organization_id}/policies/{constraint_name} - string non_compliant_org_policy = 3 [(google.api.field_behavior) = OPTIONAL]; + string non_compliant_org_policy = 3 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; } // Response for violation acknowledgement @@ -795,4 +807,12 @@ message Violation { // Optional. Timestamp when this violation was acknowledged last. // This will be absent when acknowledged field is marked as false. optional google.protobuf.Timestamp acknowledgement_time = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Immutable. Audit Log link to find business justification provided for violation + // exception. Format: + // https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization} + string exception_audit_log_link = 16 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IMMUTABLE + ]; } diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 216d22a3be3..1b62e7e8887 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1186,6 +1186,7 @@ export namespace google { EU_REGIONS_AND_SUPPORT = 8, CA_REGIONS_AND_SUPPORT = 9, ITAR = 10, + AU_REGIONS_AND_US_SUPPORT = 11, ASSURED_WORKLOADS_FOR_PARTNERS = 12 } @@ -2524,6 +2525,9 @@ export namespace google { /** Violation acknowledgementTime */ acknowledgementTime?: (google.protobuf.ITimestamp|null); + + /** Violation exceptionAuditLogLink */ + exceptionAuditLogLink?: (string|null); } /** Represents a Violation. */ @@ -2574,6 +2578,9 @@ export namespace google { /** Violation acknowledgementTime. */ public acknowledgementTime?: (google.protobuf.ITimestamp|null); + /** Violation exceptionAuditLogLink. */ + public exceptionAuditLogLink: string; + /** Violation _acknowledgementTime. */ public _acknowledgementTime?: "acknowledgementTime"; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index c5f561685a8..8054368336d 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -2260,6 +2260,7 @@ case 8: case 9: case 10: + case 11: case 12: break; } @@ -2405,6 +2406,10 @@ case 10: message.complianceRegime = 10; break; + case "AU_REGIONS_AND_US_SUPPORT": + case 11: + message.complianceRegime = 11; + break; case "ASSURED_WORKLOADS_FOR_PARTNERS": case 12: message.complianceRegime = 12; @@ -2896,6 +2901,7 @@ * @property {number} EU_REGIONS_AND_SUPPORT=8 EU_REGIONS_AND_SUPPORT value * @property {number} CA_REGIONS_AND_SUPPORT=9 CA_REGIONS_AND_SUPPORT value * @property {number} ITAR=10 ITAR value + * @property {number} AU_REGIONS_AND_US_SUPPORT=11 AU_REGIONS_AND_US_SUPPORT value * @property {number} ASSURED_WORKLOADS_FOR_PARTNERS=12 ASSURED_WORKLOADS_FOR_PARTNERS value */ Workload.ComplianceRegime = (function() { @@ -2911,6 +2917,7 @@ values[valuesById[8] = "EU_REGIONS_AND_SUPPORT"] = 8; values[valuesById[9] = "CA_REGIONS_AND_SUPPORT"] = 9; values[valuesById[10] = "ITAR"] = 10; + values[valuesById[11] = "AU_REGIONS_AND_US_SUPPORT"] = 11; values[valuesById[12] = "ASSURED_WORKLOADS_FOR_PARTNERS"] = 12; return values; })(); @@ -4018,6 +4025,7 @@ case 8: case 9: case 10: + case 11: case 12: break; } @@ -4090,6 +4098,10 @@ case 10: message.complianceRegime = 10; break; + case "AU_REGIONS_AND_US_SUPPORT": + case 11: + message.complianceRegime = 11; + break; case "ASSURED_WORKLOADS_FOR_PARTNERS": case 12: message.complianceRegime = 12; @@ -6026,6 +6038,7 @@ * @property {google.cloud.assuredworkloads.v1.Violation.IRemediation|null} [remediation] Violation remediation * @property {boolean|null} [acknowledged] Violation acknowledged * @property {google.protobuf.ITimestamp|null} [acknowledgementTime] Violation acknowledgementTime + * @property {string|null} [exceptionAuditLogLink] Violation exceptionAuditLogLink */ /** @@ -6147,6 +6160,14 @@ */ Violation.prototype.acknowledgementTime = null; + /** + * Violation exceptionAuditLogLink. + * @member {string} exceptionAuditLogLink + * @memberof google.cloud.assuredworkloads.v1.Violation + * @instance + */ + Violation.prototype.exceptionAuditLogLink = ""; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -6211,6 +6232,8 @@ writer.uint32(/* id 14, wireType 0 =*/112).bool(message.acknowledged); if (message.acknowledgementTime != null && Object.hasOwnProperty.call(message, "acknowledgementTime")) $root.google.protobuf.Timestamp.encode(message.acknowledgementTime, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.exceptionAuditLogLink != null && Object.hasOwnProperty.call(message, "exceptionAuditLogLink")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.exceptionAuditLogLink); return writer; }; @@ -6297,6 +6320,10 @@ message.acknowledgementTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } + case 16: { + message.exceptionAuditLogLink = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6392,6 +6419,9 @@ return "acknowledgementTime." + error; } } + if (message.exceptionAuditLogLink != null && message.hasOwnProperty("exceptionAuditLogLink")) + if (!$util.isString(message.exceptionAuditLogLink)) + return "exceptionAuditLogLink: string expected"; return null; }; @@ -6464,6 +6494,8 @@ throw TypeError(".google.cloud.assuredworkloads.v1.Violation.acknowledgementTime: object expected"); message.acknowledgementTime = $root.google.protobuf.Timestamp.fromObject(object.acknowledgementTime); } + if (object.exceptionAuditLogLink != null) + message.exceptionAuditLogLink = String(object.exceptionAuditLogLink); return message; }; @@ -6493,6 +6525,7 @@ object.nonCompliantOrgPolicy = ""; object.remediation = null; object.acknowledged = false; + object.exceptionAuditLogLink = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6523,6 +6556,8 @@ if (options.oneofs) object._acknowledgementTime = "acknowledgementTime"; } + if (message.exceptionAuditLogLink != null && message.hasOwnProperty("exceptionAuditLogLink")) + object.exceptionAuditLogLink = message.exceptionAuditLogLink; return object; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 15959c0d268..611c5b7a873 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -446,6 +446,7 @@ "EU_REGIONS_AND_SUPPORT": 8, "CA_REGIONS_AND_SUPPORT": 9, "ITAR": 10, + "AU_REGIONS_AND_US_SUPPORT": 11, "ASSURED_WORKLOADS_FOR_PARTNERS": 12 } }, @@ -624,6 +625,7 @@ "type": "string", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL" } } @@ -813,6 +815,13 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "exceptionAuditLogLink": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js index a8477d7e8a3..8dda249ceaf 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js @@ -39,7 +39,8 @@ function main(name, comment) { */ // const comment = 'abc123' /** - * Optional. Name of the OrgPolicy which was modified with non-compliant change and + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and * resulted in this violation. * Format: * projects/{project_number}/policies/{constraint_name} diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index f222a13cf60..a80589fcf5d 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -29,7 +29,7 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the Workload to fetch. This is the workloads's + * Required. The resource name of the Workload to fetch. This is the workload's * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index 6f03d5883d5..392c1e4a96c 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -390,7 +390,7 @@ "segments": [ { "start": 25, - "end": 69, + "end": 70, "type": "FULL" } ], diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 146118be283..c53023ffcfb 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -721,7 +721,7 @@ export class AssuredWorkloadsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the Workload to fetch. This is the workloads's + * Required. The resource name of the Workload to fetch. This is the workload's * relative path in the API, formatted as * "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". * For example, @@ -914,7 +914,8 @@ export class AssuredWorkloadsServiceClient { * @param {string} request.comment * Required. Business justification explaining the need for violation acknowledgement * @param {string} [request.nonCompliantOrgPolicy] - * Optional. Name of the OrgPolicy which was modified with non-compliant change and + * Optional. This field is deprecated and will be removed in future version of the API. + * Name of the OrgPolicy which was modified with non-compliant change and * resulted in this violation. * Format: * projects/{project_number}/policies/{constraint_name} From c90c6225b4c19729f5278200dd81ea830f0172a4 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:41:34 -0700 Subject: [PATCH 110/116] fix(deps): use google-gax v3.5.2 (#196) --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index cdbdce7f6a4..44d14b4392b 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 33636fe544a303e1f3b16f76fc3ed4e40fafc6cf Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:20:15 +0100 Subject: [PATCH 111/116] chore(deps): update dependency @types/node to v18 (#194) 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 | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### 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, check this box --- 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-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 44d14b4392b..500622cb50d 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.3.0", "gts": "^3.1.0", From 55b2b6714d89a7515d77945c49710aec4cb7dbf6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:38:26 +0000 Subject: [PATCH 112/116] fix: regenerated protos JS and TS definitions (#199) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../protos/protos.js | 224 +++++++++++++++--- .../protos/protos.json | 10 + 3 files changed, 206 insertions(+), 30 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index 1b62e7e8887..47efba2ddf5 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index 8054368336d..df3e627b90b 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -2362,6 +2362,12 @@ } } switch (object.complianceRegime) { + default: + if (typeof object.complianceRegime === "number") { + message.complianceRegime = object.complianceRegime; + break; + } + break; case "COMPLIANCE_REGIME_UNSPECIFIED": case 0: message.complianceRegime = 0; @@ -2449,6 +2455,12 @@ } } switch (object.kajEnrollmentState) { + default: + if (typeof object.kajEnrollmentState === "number") { + message.kajEnrollmentState = object.kajEnrollmentState; + break; + } + break; case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": case 0: message.kajEnrollmentState = 0; @@ -2477,6 +2489,12 @@ message.compliantButDisallowedServices[i] = String(object.compliantButDisallowedServices[i]); } switch (object.partner) { + default: + if (typeof object.partner === "number") { + message.partner = object.partner; + break; + } + break; case "PARTNER_UNSPECIFIED": case 0: message.partner = 0; @@ -2533,7 +2551,7 @@ object.resources[j] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.toObject(message.resources[j], options); } if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] === undefined ? message.complianceRegime : $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) @@ -2556,7 +2574,7 @@ object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); } if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) - object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; + object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState[message.kajEnrollmentState] === undefined ? message.kajEnrollmentState : $root.google.cloud.assuredworkloads.v1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) object.enableSovereignControls = message.enableSovereignControls; if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) @@ -2567,7 +2585,7 @@ object.compliantButDisallowedServices[j] = message.compliantButDisallowedServices[j]; } if (message.partner != null && message.hasOwnProperty("partner")) - object.partner = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.Partner[message.partner] : message.partner; + object.partner = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.Partner[message.partner] === undefined ? message.partner : $root.google.cloud.assuredworkloads.v1.Workload.Partner[message.partner] : message.partner; return object; }; @@ -2782,6 +2800,12 @@ else if (typeof object.resourceId === "object") message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; case "RESOURCE_TYPE_UNSPECIFIED": case 0: message.resourceType = 0; @@ -2833,7 +2857,7 @@ else object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; return object; }; @@ -3355,6 +3379,12 @@ if (object.resourceId != null) message.resourceId = String(object.resourceId); switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; case "RESOURCE_TYPE_UNSPECIFIED": case 0: message.resourceType = 0; @@ -3402,7 +3432,7 @@ if (message.resourceId != null && message.hasOwnProperty("resourceId")) object.resourceId = message.resourceId; if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.assuredworkloads.v1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; return object; @@ -3668,6 +3698,12 @@ return object; var message = new $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse(); switch (object.setupStatus) { + default: + if (typeof object.setupStatus === "number") { + message.setupStatus = object.setupStatus; + break; + } + break; case "SETUP_STATE_UNSPECIFIED": case 0: message.setupStatus = 0; @@ -3688,6 +3724,10 @@ for (var i = 0; i < object.setupErrors.length; ++i) switch (object.setupErrors[i]) { default: + if (typeof object.setupErrors[i] === "number") { + message.setupErrors[i] = object.setupErrors[i]; + break; + } case "SETUP_ERROR_UNSPECIFIED": case 0: message.setupErrors[i] = 0; @@ -3729,14 +3769,14 @@ if (options.arrays || options.defaults) object.setupErrors = []; if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { - object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; + object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] === undefined ? message.setupStatus : $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; if (options.oneofs) object._setupStatus = "setupStatus"; } if (message.setupErrors && message.setupErrors.length) { object.setupErrors = []; for (var j = 0; j < message.setupErrors.length; ++j) - object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] === undefined ? message.setupErrors[j] : $root.google.cloud.assuredworkloads.v1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; } return object; }; @@ -4054,6 +4094,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.complianceRegime) { + default: + if (typeof object.complianceRegime === "number") { + message.complianceRegime = object.complianceRegime; + break; + } + break; case "COMPLIANCE_REGIME_UNSPECIFIED": case 0: message.complianceRegime = 0; @@ -4136,7 +4182,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] === undefined ? message.complianceRegime : $root.google.cloud.assuredworkloads.v1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; return object; }; @@ -4345,6 +4391,12 @@ if (object.name != null) message.name = String(object.name); switch (object.restrictionType) { + default: + if (typeof object.restrictionType === "number") { + message.restrictionType = object.restrictionType; + break; + } + break; case "RESTRICTION_TYPE_UNSPECIFIED": case 0: message.restrictionType = 0; @@ -4381,7 +4433,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) - object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; + object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] === undefined ? message.restrictionType : $root.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; return object; }; @@ -6459,6 +6511,12 @@ if (object.category != null) message.category = String(object.category); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -6540,7 +6598,7 @@ if (message.category != null && message.hasOwnProperty("category")) object.category = message.category; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.State[message.state] === undefined ? message.state : $root.google.cloud.assuredworkloads.v1.Violation.State[message.state] : message.state; if (message.orgPolicyConstraint != null && message.hasOwnProperty("orgPolicyConstraint")) object.orgPolicyConstraint = message.orgPolicyConstraint; if (message.auditLogLink != null && message.hasOwnProperty("auditLogLink")) @@ -6821,6 +6879,12 @@ message.compliantValues[i] = String(object.compliantValues[i]); } switch (object.remediationType) { + default: + if (typeof object.remediationType === "number") { + message.remediationType = object.remediationType; + break; + } + break; case "REMEDIATION_TYPE_UNSPECIFIED": case 0: message.remediationType = 0; @@ -6872,7 +6936,7 @@ object.compliantValues[j] = message.compliantValues[j]; } if (message.remediationType != null && message.hasOwnProperty("remediationType")) - object.remediationType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType[message.remediationType] : message.remediationType; + object.remediationType = options.enums === String ? $root.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType[message.remediationType] === undefined ? message.remediationType : $root.google.cloud.assuredworkloads.v1.Violation.Remediation.RemediationType[message.remediationType] : message.remediationType; return object; }; @@ -8441,6 +8505,12 @@ if (object.name != null) message.name = String(object.name); switch (object.restrictionType) { + default: + if (typeof object.restrictionType === "number") { + message.restrictionType = object.restrictionType; + break; + } + break; case "RESTRICTION_TYPE_UNSPECIFIED": case 0: message.restrictionType = 0; @@ -8477,7 +8547,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.restrictionType != null && message.hasOwnProperty("restrictionType")) - object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; + object.restrictionType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] === undefined ? message.restrictionType : $root.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesRequest.RestrictionType[message.restrictionType] : message.restrictionType; return object; }; @@ -10755,6 +10825,12 @@ } } switch (object.complianceRegime) { + default: + if (typeof object.complianceRegime === "number") { + message.complianceRegime = object.complianceRegime; + break; + } + break; case "COMPLIANCE_REGIME_UNSPECIFIED": case 0: message.complianceRegime = 0; @@ -10858,6 +10934,12 @@ } } switch (object.kajEnrollmentState) { + default: + if (typeof object.kajEnrollmentState === "number") { + message.kajEnrollmentState = object.kajEnrollmentState; + break; + } + break; case "KAJ_ENROLLMENT_STATE_UNSPECIFIED": case 0: message.kajEnrollmentState = 0; @@ -10931,7 +11013,7 @@ object.resources[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.toObject(message.resources[j], options); } if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] === undefined ? message.complianceRegime : $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.billingAccount != null && message.hasOwnProperty("billingAccount")) @@ -10974,7 +11056,7 @@ object.resourceSettings[j] = $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceSettings.toObject(message.resourceSettings[j], options); } if (message.kajEnrollmentState != null && message.hasOwnProperty("kajEnrollmentState")) - object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; + object.kajEnrollmentState = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] === undefined ? message.kajEnrollmentState : $root.google.cloud.assuredworkloads.v1beta1.Workload.KajEnrollmentState[message.kajEnrollmentState] : message.kajEnrollmentState; if (message.enableSovereignControls != null && message.hasOwnProperty("enableSovereignControls")) object.enableSovereignControls = message.enableSovereignControls; if (message.saaEnrollmentResponse != null && message.hasOwnProperty("saaEnrollmentResponse")) @@ -11198,6 +11280,12 @@ else if (typeof object.resourceId === "object") message.resourceId = new $util.LongBits(object.resourceId.low >>> 0, object.resourceId.high >>> 0).toNumber(); switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; case "RESOURCE_TYPE_UNSPECIFIED": case 0: message.resourceType = 0; @@ -11249,7 +11337,7 @@ else object.resourceId = options.longs === String ? $util.Long.prototype.toString.call(message.resourceId) : options.longs === Number ? new $util.LongBits(message.resourceId.low >>> 0, message.resourceId.high >>> 0).toNumber() : message.resourceId; if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; return object; }; @@ -12601,6 +12689,12 @@ if (object.resourceId != null) message.resourceId = String(object.resourceId); switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; case "RESOURCE_TYPE_UNSPECIFIED": case 0: message.resourceType = 0; @@ -12648,7 +12742,7 @@ if (message.resourceId != null && message.hasOwnProperty("resourceId")) object.resourceId = message.resourceId; if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; + object.resourceType = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.assuredworkloads.v1beta1.Workload.ResourceInfo.ResourceType[message.resourceType] : message.resourceType; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; return object; @@ -12914,6 +13008,12 @@ return object; var message = new $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse(); switch (object.setupStatus) { + default: + if (typeof object.setupStatus === "number") { + message.setupStatus = object.setupStatus; + break; + } + break; case "SETUP_STATE_UNSPECIFIED": case 0: message.setupStatus = 0; @@ -12934,6 +13034,10 @@ for (var i = 0; i < object.setupErrors.length; ++i) switch (object.setupErrors[i]) { default: + if (typeof object.setupErrors[i] === "number") { + message.setupErrors[i] = object.setupErrors[i]; + break; + } case "SETUP_ERROR_UNSPECIFIED": case 0: message.setupErrors[i] = 0; @@ -12975,14 +13079,14 @@ if (options.arrays || options.defaults) object.setupErrors = []; if (message.setupStatus != null && message.hasOwnProperty("setupStatus")) { - object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; + object.setupStatus = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] === undefined ? message.setupStatus : $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupState[message.setupStatus] : message.setupStatus; if (options.oneofs) object._setupStatus = "setupStatus"; } if (message.setupErrors && message.setupErrors.length) { object.setupErrors = []; for (var j = 0; j < message.setupErrors.length; ++j) - object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; + object.setupErrors[j] = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] === undefined ? message.setupErrors[j] : $root.google.cloud.assuredworkloads.v1beta1.Workload.SaaEnrollmentResponse.SetupError[message.setupErrors[j]] : message.setupErrors[j]; } return object; }; @@ -13313,6 +13417,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.complianceRegime) { + default: + if (typeof object.complianceRegime === "number") { + message.complianceRegime = object.complianceRegime; + break; + } + break; case "COMPLIANCE_REGIME_UNSPECIFIED": case 0: message.complianceRegime = 0; @@ -13403,7 +13513,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.complianceRegime != null && message.hasOwnProperty("complianceRegime")) - object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; + object.complianceRegime = options.enums === String ? $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] === undefined ? message.complianceRegime : $root.google.cloud.assuredworkloads.v1beta1.Workload.ComplianceRegime[message.complianceRegime] : message.complianceRegime; if (message.resourceSettings && message.resourceSettings.length) { object.resourceSettings = []; for (var j = 0; j < message.resourceSettings.length; ++j) @@ -15018,6 +15128,12 @@ if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; case "HISTORY_UNSPECIFIED": case 0: message.history = 0; @@ -15042,6 +15158,10 @@ for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; @@ -15089,7 +15209,7 @@ if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; if (message.plural != null && message.hasOwnProperty("plural")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) @@ -15097,7 +15217,7 @@ if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; @@ -17908,6 +18028,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -17922,6 +18048,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -18048,9 +18180,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -20397,6 +20529,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -20505,7 +20643,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -21307,6 +21445,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -21323,6 +21467,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -21361,6 +21511,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -21431,7 +21585,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -21439,7 +21593,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $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")) @@ -21452,7 +21606,7 @@ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); @@ -22829,6 +22983,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -22898,7 +23058,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -24653,6 +24813,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -24702,7 +24868,7 @@ 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; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; diff --git a/packages/google-cloud-assuredworkloads/protos/protos.json b/packages/google-cloud-assuredworkloads/protos/protos.json index 611c5b7a873..2bde22887ae 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.json +++ b/packages/google-cloud-assuredworkloads/protos/protos.json @@ -423,6 +423,11 @@ }, "nested": { "ResourceType": { + "valuesOptions": { + "CONSUMER_PROJECT": { + "deprecated": true + } + }, "values": { "RESOURCE_TYPE_UNSPECIFIED": 0, "CONSUMER_PROJECT": 1, @@ -1287,6 +1292,11 @@ }, "nested": { "ResourceType": { + "valuesOptions": { + "CONSUMER_PROJECT": { + "deprecated": true + } + }, "values": { "RESOURCE_TYPE_UNSPECIFIED": 0, "CONSUMER_PROJECT": 1, From fc31a798fa415356b9d457a08f1861208f0898b4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 13:34:16 +0100 Subject: [PATCH 113/116] chore(deps): update dependency jsdoc to v4 (#198) 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 | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.5` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### 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, check this box --- 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-assured-workloads). --- packages/google-cloud-assuredworkloads/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 500622cb50d..3061255a157 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -47,7 +47,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.3.0", "gts": "^3.1.0", - "jsdoc": "^3.6.5", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From df11448c6ff3daa6ba638c22b4066a4e1abe9a56 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 01:42:09 -0800 Subject: [PATCH 114/116] chore(main): release 3.5.0 (#187) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.5.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../CHANGELOG.md | 20 +++++++++++++++++++ .../package.json | 2 +- ...data.google.cloud.assuredworkloads.v1.json | 2 +- ...google.cloud.assuredworkloads.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index d586dd5fd2b..633920dd57a 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [3.5.0](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.4.1...v3.5.0) (2022-11-10) + + +### Features + +* Add apis for AssuredWorkload monitoring feature and to restrict allowed resources ([#192](https://github.com/googleapis/nodejs-assured-workloads/issues/192)) ([ab33d32](https://github.com/googleapis/nodejs-assured-workloads/commit/ab33d32d2585d0c0de372660001b5d1bfcea4cd7)) +* Add compliant_but_disallowed_services field to the v1beta1 Workload proto ([3101b18](https://github.com/googleapis/nodejs-assured-workloads/commit/3101b1896af8f684c4cf26b634411980a74f1b66)) +* Add new field for exception audit log link ([#193](https://github.com/googleapis/nodejs-assured-workloads/issues/193)) ([89f20ba](https://github.com/googleapis/nodejs-assured-workloads/commit/89f20baa4487638eb53ddaf018dce8f880d36973)) +* Updated v1beta1 analyzeWorkloadMove documentation ([e02a438](https://github.com/googleapis/nodejs-assured-workloads/commit/e02a4381a79b94e8bd745ee6435f15770824f592)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#185](https://github.com/googleapis/nodejs-assured-workloads/issues/185)) ([e02a438](https://github.com/googleapis/nodejs-assured-workloads/commit/e02a4381a79b94e8bd745ee6435f15770824f592)) +* **deps:** Use google-gax v3.5.2 ([#196](https://github.com/googleapis/nodejs-assured-workloads/issues/196)) ([cfa9ce8](https://github.com/googleapis/nodejs-assured-workloads/commit/cfa9ce8356937cbbf99ffba80d5a3631f1f8480b)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-assured-workloads/issues/1553)) ([#186](https://github.com/googleapis/nodejs-assured-workloads/issues/186)) ([bc1ee5f](https://github.com/googleapis/nodejs-assured-workloads/commit/bc1ee5ffab28bce1803829ab275c687d2e4e1360)) +* Preserve default values in x-goog-request-params header ([#188](https://github.com/googleapis/nodejs-assured-workloads/issues/188)) ([3101b18](https://github.com/googleapis/nodejs-assured-workloads/commit/3101b1896af8f684c4cf26b634411980a74f1b66)) +* Regenerated protos JS and TS definitions ([#199](https://github.com/googleapis/nodejs-assured-workloads/issues/199)) ([c23065a](https://github.com/googleapis/nodejs-assured-workloads/commit/c23065a364233fbc045798891973dc8b2a8001b5)) +* use google-gax v3.3.0 ([bc1ee5f](https://github.com/googleapis/nodejs-assured-workloads/commit/bc1ee5ffab28bce1803829ab275c687d2e4e1360)) + ## [3.4.1](https://github.com/googleapis/nodejs-assured-workloads/compare/v3.4.0...v3.4.1) (2022-08-23) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 3061255a157..18fc12cca65 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "3.4.1", + "version": "3.5.0", "description": "Assured Workloads client for Node.js", "repository": "googleapis/nodejs-assured-workloads", "license": "Apache-2.0", diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index 392c1e4a96c..5512d19e10a 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.4.1", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 66a415fb145..9f67a249e6d 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "3.4.1", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index cb7788bf813..843c24a0bc3 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^3.4.1" + "@google-cloud/assured-workloads": "^3.5.0" }, "devDependencies": { "c8": "^7.3.0", From 4b5550124b90c88b23bd329f47085717d28032b2 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 01:46:34 -0800 Subject: [PATCH 115/116] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../{.github => }/.OwlBot.yaml | 6 +- .../google-cloud-assuredworkloads/.mocharc.js | 2 +- .../.prettierrc.js | 2 +- .../.repo-metadata.json | 2 +- .../google-cloud-assuredworkloads/README.md | 32 +- .../package.json | 13 +- .../samples/README.md | 336 +++++++++++++++++- .../src/index.ts | 2 +- release-please-config.json | 3 +- 10 files changed, 373 insertions(+), 26 deletions(-) rename packages/google-cloud-assuredworkloads/{.github => }/.OwlBot.yaml (78%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..56588cfb1a8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,7 @@ { "packages/gapic-node-templating": "0.0.0", "packages/google-api-apikeys": "0.1.3", + "packages/google-cloud-assuredworkloads": "3.5.0", "packages/google-cloud-batch": "0.3.2", "packages/google-cloud-beyondcorp-appconnections": "0.2.3", "packages/google-cloud-beyondcorp-appconnectors": "0.3.3", diff --git a/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml b/packages/google-cloud-assuredworkloads/.OwlBot.yaml similarity index 78% rename from packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml rename to packages/google-cloud-assuredworkloads/.OwlBot.yaml index 535ba88d921..21a7a5caae8 100644 --- a/packages/google-cloud-assuredworkloads/.github/.OwlBot.yaml +++ b/packages/google-cloud-assuredworkloads/.OwlBot.yaml @@ -11,13 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/assuredworkloads/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/assuredworkloads/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-assuredworkloads/$1 diff --git a/packages/google-cloud-assuredworkloads/.mocharc.js b/packages/google-cloud-assuredworkloads/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-assuredworkloads/.mocharc.js +++ b/packages/google-cloud-assuredworkloads/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/.prettierrc.js b/packages/google-cloud-assuredworkloads/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-assuredworkloads/.prettierrc.js +++ b/packages/google-cloud-assuredworkloads/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/.repo-metadata.json b/packages/google-cloud-assuredworkloads/.repo-metadata.json index b275a226d35..c3a4a92f109 100644 --- a/packages/google-cloud-assuredworkloads/.repo-metadata.json +++ b/packages/google-cloud-assuredworkloads/.repo-metadata.json @@ -6,7 +6,7 @@ "default_version": "v1", "language": "nodejs", "name_pretty": "Assured Workloads for Government", - "repo": "googleapis/nodejs-assured-workloads", + "repo": "googleapis/google-cloud-node", "product_documentation": "https://cloud.google.com/assured-workloads/docs", "requires_billing": true, "name": "assuredworkloads", diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 7dd3fce1e1d..027e2c07c48 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/nodejs-assured-workloads) +# [Assured Workloads for Government: Node.js Client](https://github.com/googleapis/google-cloud-node) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/assured-workloads.svg)](https://www.npmjs.org/package/@google-cloud/assured-workloads) @@ -14,11 +14,11 @@ Assured Workloads client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-assured-workloads/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads/CHANGELOG.md). * [Assured Workloads for Government Node.js Client API Reference][client-docs] * [Assured Workloads for Government Documentation][product-docs] -* [github.com/googleapis/nodejs-assured-workloads](https://github.com/googleapis/nodejs-assured-workloads) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-assuredworkloads](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -83,11 +83,29 @@ listWorkloads(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-assured-workloads/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Assured_workloads_service.acknowledge_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) | +| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) | +| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) | +| Assured_workloads_service.get_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) | +| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) | +| Assured_workloads_service.list_violations | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) | +| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | +| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) | +| Assured_workloads_service.analyze_workload_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) | +| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) | +| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) | +| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) | +| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) | +| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) | @@ -137,7 +155,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-assured-workloads/blob/main/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -149,7 +167,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-assured-workloads/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/assured-workloads/latest [product-docs]: https://cloud.google.com/assured-workloads/docs diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index 18fc12cca65..a86077e5d8f 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -2,7 +2,11 @@ "name": "@google-cloud/assured-workloads", "version": "3.5.0", "description": "Assured Workloads client for Node.js", - "repository": "googleapis/nodejs-assured-workloads", + "repository": { + "type": "git", + "directory": "packages/google-cloud-assuredworkloads", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -34,8 +38,8 @@ "lint": "gts check", "prelint": "cd samples; npm link ../; npm i", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "samples-test": "cd samples/ && npm link ../ && npm test", + "system-test": "npm run compile && c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", "test": "c8 mocha build/test" }, "dependencies": { @@ -62,5 +66,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads" } diff --git a/packages/google-cloud-assuredworkloads/samples/README.md b/packages/google-cloud-assuredworkloads/samples/README.md index 4e2938f7b6b..2c84478e872 100644 --- a/packages/google-cloud-assuredworkloads/samples/README.md +++ b/packages/google-cloud-assuredworkloads/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Assured Workloads for Government: Node.js Samples](https://github.com/googleapis/nodejs-assured-workloads) +# [Assured Workloads for Government: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,12 +12,30 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Assured_workloads_service.acknowledge_violation](#assured_workloads_service.acknowledge_violation) + * [Assured_workloads_service.create_workload](#assured_workloads_service.create_workload) + * [Assured_workloads_service.delete_workload](#assured_workloads_service.delete_workload) + * [Assured_workloads_service.get_violation](#assured_workloads_service.get_violation) + * [Assured_workloads_service.get_workload](#assured_workloads_service.get_workload) + * [Assured_workloads_service.list_violations](#assured_workloads_service.list_violations) + * [Assured_workloads_service.list_workloads](#assured_workloads_service.list_workloads) + * [Assured_workloads_service.restrict_allowed_resources](#assured_workloads_service.restrict_allowed_resources) + * [Assured_workloads_service.update_workload](#assured_workloads_service.update_workload) + * [Assured_workloads_service.analyze_workload_move](#assured_workloads_service.analyze_workload_move) + * [Assured_workloads_service.create_workload](#assured_workloads_service.create_workload) + * [Assured_workloads_service.delete_workload](#assured_workloads_service.delete_workload) + * [Assured_workloads_service.get_workload](#assured_workloads_service.get_workload) + * [Assured_workloads_service.list_workloads](#assured_workloads_service.list_workloads) + * [Assured_workloads_service.restrict_allowed_resources](#assured_workloads_service.restrict_allowed_resources) + * [Assured_workloads_service.restrict_allowed_services](#assured_workloads_service.restrict_allowed_services) + * [Assured_workloads_service.update_workload](#assured_workloads_service.update_workload) + * [Quickstart](#quickstart) * [Quickstart](#quickstart) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-assured-workloads#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -29,16 +47,322 @@ Before running the samples, make sure you've followed the steps outlined in +### Assured_workloads_service.acknowledge_violation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js` + + +----- + + + + +### Assured_workloads_service.create_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js` + + +----- + + + + +### Assured_workloads_service.delete_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js` + + +----- + + + + +### Assured_workloads_service.get_violation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js` + + +----- + + + + +### Assured_workloads_service.get_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js` + + +----- + + + + +### Assured_workloads_service.list_violations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js` + + +----- + + + + +### Assured_workloads_service.list_workloads + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js` + + +----- + + + + +### Assured_workloads_service.restrict_allowed_resources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js` + + +----- + + + + +### Assured_workloads_service.update_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js` + + +----- + + + + +### Assured_workloads_service.analyze_workload_move + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js` + + +----- + + + + +### Assured_workloads_service.create_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js` + + +----- + + + + +### Assured_workloads_service.delete_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js` + + +----- + + + + +### Assured_workloads_service.get_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js` + + +----- + + + + +### Assured_workloads_service.list_workloads + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js` + + +----- + + + + +### Assured_workloads_service.restrict_allowed_resources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js` + + +----- + + + + +### Assured_workloads_service.restrict_allowed_services + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js` + + +----- + + + + +### Assured_workloads_service.update_workload + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/quickstart.js` + + +----- + + + + ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-assured-workloads/blob/main/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node /workspace/google-cloud-node/samples/test/quickstart.js` @@ -46,5 +370,5 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-assured-workloads&page=editor&open_in_editor=samples/README.md +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md [product-docs]: https://cloud.google.com/assured-workloads/docs diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index 94b984f4237..24a68b838b5 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/release-please-config.json b/release-please-config.json index ca8fb90627b..1ce86ce595f 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -2,6 +2,7 @@ "initial-version": "0.1.0", "packages": { "packages/google-api-apikeys": {}, + "packages/google-cloud-assuredworkloads": {}, "packages/google-cloud-batch": {}, "packages/google-cloud-beyondcorp-appconnections": {}, "packages/google-cloud-beyondcorp-appconnectors": {}, @@ -49,4 +50,4 @@ } ], "release-type": "node" -} \ No newline at end of file +} From e4417970a2e61a2009d7d7ef6c1b01752c72dd3d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Nov 2022 10:10:56 +0000 Subject: [PATCH 116/116] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-assuredworkloads/README.md | 38 +++--- .../samples/README.md | 114 +++++++++--------- release-please-config.json | 2 +- 3 files changed, 77 insertions(+), 77 deletions(-) diff --git a/packages/google-cloud-assuredworkloads/README.md b/packages/google-cloud-assuredworkloads/README.md index 027e2c07c48..9a609031a4b 100644 --- a/packages/google-cloud-assuredworkloads/README.md +++ b/packages/google-cloud-assuredworkloads/README.md @@ -87,25 +87,25 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Assured_workloads_service.acknowledge_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) | -| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) | -| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) | -| Assured_workloads_service.get_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) | -| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) | -| Assured_workloads_service.list_violations | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) | -| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) | -| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | -| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) | -| Assured_workloads_service.analyze_workload_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) | -| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) | -| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) | -| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) | -| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) | -| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | -| Assured_workloads_service.restrict_allowed_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) | -| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) | +| Assured_workloads_service.acknowledge_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) | +| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) | +| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) | +| Assured_workloads_service.get_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) | +| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) | +| Assured_workloads_service.list_violations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) | +| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | +| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) | +| Assured_workloads_service.analyze_workload_move | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) | +| Assured_workloads_service.create_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) | +| Assured_workloads_service.delete_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) | +| Assured_workloads_service.get_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) | +| Assured_workloads_service.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) | +| Assured_workloads_service.restrict_allowed_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) | +| Assured_workloads_service.update_workload | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/test/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-assuredworkloads/samples/README.md b/packages/google-cloud-assuredworkloads/samples/README.md index 2c84478e872..e9a5ea069fd 100644 --- a/packages/google-cloud-assuredworkloads/samples/README.md +++ b/packages/google-cloud-assuredworkloads/samples/README.md @@ -49,14 +49,14 @@ Before running the samples, make sure you've followed the steps outlined in ### Assured_workloads_service.acknowledge_violation -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.acknowledge_violation.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js` ----- @@ -66,14 +66,14 @@ __Usage:__ ### Assured_workloads_service.create_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.create_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js` ----- @@ -83,14 +83,14 @@ __Usage:__ ### Assured_workloads_service.delete_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.delete_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js` ----- @@ -100,14 +100,14 @@ __Usage:__ ### Assured_workloads_service.get_violation -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_violation.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js` ----- @@ -117,14 +117,14 @@ __Usage:__ ### Assured_workloads_service.get_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.get_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js` ----- @@ -134,14 +134,14 @@ __Usage:__ ### Assured_workloads_service.list_violations -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_violations.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js` ----- @@ -151,14 +151,14 @@ __Usage:__ ### Assured_workloads_service.list_workloads -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.list_workloads.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js` ----- @@ -168,14 +168,14 @@ __Usage:__ ### Assured_workloads_service.restrict_allowed_resources -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js` ----- @@ -185,14 +185,14 @@ __Usage:__ ### Assured_workloads_service.update_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/assured_workloads_service.update_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js` ----- @@ -202,14 +202,14 @@ __Usage:__ ### Assured_workloads_service.analyze_workload_move -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js` ----- @@ -219,14 +219,14 @@ __Usage:__ ### Assured_workloads_service.create_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.create_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js` ----- @@ -236,14 +236,14 @@ __Usage:__ ### Assured_workloads_service.delete_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.delete_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js` ----- @@ -253,14 +253,14 @@ __Usage:__ ### Assured_workloads_service.get_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.get_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js` ----- @@ -270,14 +270,14 @@ __Usage:__ ### Assured_workloads_service.list_workloads -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.list_workloads.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js` ----- @@ -287,14 +287,14 @@ __Usage:__ ### Assured_workloads_service.restrict_allowed_resources -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js` ----- @@ -304,14 +304,14 @@ __Usage:__ ### Assured_workloads_service.restrict_allowed_services -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_services.js` ----- @@ -321,14 +321,14 @@ __Usage:__ ### Assured_workloads_service.update_workload -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/assured_workloads_service.update_workload.js` +`node packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js` ----- @@ -338,14 +338,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/quickstart.js` +`node packages/google-cloud-assuredworkloads/samples/quickstart.js` ----- @@ -355,14 +355,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-assuredworkloads/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-assuredworkloads/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/test/quickstart.js` +`node packages/google-cloud-assuredworkloads/samples/test/quickstart.js` diff --git a/release-please-config.json b/release-please-config.json index 1ce86ce595f..479bd9c077e 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -50,4 +50,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file